harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r830150 - in /harmony/enhanced/classlib/trunk/modules: archive/src/main/native/zip/shared/zipsup.c luni/src/main/native/hyzip/shared/zipsup.c
Date Tue, 27 Oct 2009 12:38:30 GMT
Author: hindessm
Date: Tue Oct 27 12:38:29 2009
New Revision: 830150

URL: http://svn.apache.org/viewvc?rev=830150&view=rev
Log:
Casts to avoid compiler warnings when we discard value "returned" by macro.

Modified:
    harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/shared/zipsup.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/hyzip/shared/zipsup.c

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/shared/zipsup.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/shared/zipsup.c?rev=830150&r1=830149&r2=830150&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/shared/zipsup.c (original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/shared/zipsup.c Tue
Oct 27 12:38:29 2009
@@ -347,13 +347,13 @@
                 {
                   /* Found it.  Read the data from the end-of-central-dir record. */
                   current = buffer + i + 4;
-                  ZIP_NEXT_U16 (endEntry->diskNumber, current);
-                  ZIP_NEXT_U16 (endEntry->dirStartDisk, current);
-                  ZIP_NEXT_U16 (endEntry->thisDiskEntries, current);
-                  ZIP_NEXT_U16 (endEntry->totalEntries, current);
-                  ZIP_NEXT_U32 (endEntry->dirSize, current);
-                  ZIP_NEXT_U32 (endEntry->dirOffset, current);
-                  ZIP_NEXT_U16 (endEntry->commentLength, current);
+                  (void) ZIP_NEXT_U16 (endEntry->diskNumber, current);
+                  (void) ZIP_NEXT_U16 (endEntry->dirStartDisk, current);
+                  (void) ZIP_NEXT_U16 (endEntry->thisDiskEntries, current);
+                  (void) ZIP_NEXT_U16 (endEntry->totalEntries, current);
+                  (void) ZIP_NEXT_U32 (endEntry->dirSize, current);
+                  (void) ZIP_NEXT_U32 (endEntry->dirOffset, current);
+                  (void) ZIP_NEXT_U16 (endEntry->commentLength, current);
 
                   /* Quick test to ensure that the header isn't invalid. 
                      Current dataSize is the number of bytes of data scanned, up to the ^H
in the stream. */
@@ -495,9 +495,9 @@
                     }
 
                   /* Read the data from the descriptor. */
-                  ZIP_NEXT_U32 (zipEntry->crc32, current);
-                  ZIP_NEXT_U32 (zipEntry->compressedSize, current);
-                  ZIP_NEXT_U32 (zipEntry->uncompressedSize, current);
+                  (void) ZIP_NEXT_U32 (zipEntry->crc32, current);
+                  (void) ZIP_NEXT_U32 (zipEntry->compressedSize, current);
+                  (void) ZIP_NEXT_U32 (zipEntry->uncompressedSize, current);
 
                   /* Quick test to ensure that the header isn't invalid. 
                      Current dataSize is the number of bytes of data scanned, up to the ^H
in the stream. */
@@ -647,7 +647,7 @@
             zipFile->pointer + (current - (buffer + bufferedSize));
 
           sig = 0;
-          ZIP_NEXT_U32 (sig, current);
+          (void) ZIP_NEXT_U32 (sig, current);
           if (sig == ZIP_CentralEnd)
             {
               /* We're done here. */
@@ -662,22 +662,22 @@
             }
 
           /* Read ZIP_CentralHeader entry */
-          ZIP_NEXT_U16 (entry.versionCreated, current);
-          ZIP_NEXT_U16 (entry.versionNeeded, current);
-          ZIP_NEXT_U16 (entry.flags, current);
-          ZIP_NEXT_U16 (entry.compressionMethod, current);
-          ZIP_NEXT_U16 (entry.lastModTime, current);
-          ZIP_NEXT_U16 (entry.lastModDate, current);
-          ZIP_NEXT_U32 (entry.crc32, current);
-          ZIP_NEXT_U32 (entry.compressedSize, current);
-          ZIP_NEXT_U32 (entry.uncompressedSize, current);
-          ZIP_NEXT_U16 (entry.filenameLength, current);
-          ZIP_NEXT_U16 (entry.extraFieldLength, current);
-          ZIP_NEXT_U16 (entry.fileCommentLength, current);
+          (void) ZIP_NEXT_U16 (entry.versionCreated, current);
+          (void) ZIP_NEXT_U16 (entry.versionNeeded, current);
+          (void) ZIP_NEXT_U16 (entry.flags, current);
+          (void) ZIP_NEXT_U16 (entry.compressionMethod, current);
+          (void) ZIP_NEXT_U16 (entry.lastModTime, current);
+          (void) ZIP_NEXT_U16 (entry.lastModDate, current);
+          (void) ZIP_NEXT_U32 (entry.crc32, current);
+          (void) ZIP_NEXT_U32 (entry.compressedSize, current);
+          (void) ZIP_NEXT_U32 (entry.uncompressedSize, current);
+          (void) ZIP_NEXT_U16 (entry.filenameLength, current);
+          (void) ZIP_NEXT_U16 (entry.extraFieldLength, current);
+          (void) ZIP_NEXT_U16 (entry.fileCommentLength, current);
           current += sizeof (U_16);     /* skip disk number field */
-          ZIP_NEXT_U16 (entry.internalAttributes, current);
+          (void) ZIP_NEXT_U16 (entry.internalAttributes, current);
           current += sizeof (U_32);     /* skip external attributes field */
-          ZIP_NEXT_U32 (localHeaderOffset, current);
+          (void) ZIP_NEXT_U32 (localHeaderOffset, current);
 
           /* Increase filename buffer size if necessary. */
           if (filenameSize < entry.filenameLength + 1)
@@ -876,7 +876,7 @@
     }
   zipFile->pointer += result;
   readLength = result;          /* If it's not enough, we'll catch that later */
-  ZIP_NEXT_U32 (sig, current);
+  (void) ZIP_NEXT_U32 (sig, current);
 
   if (enumerationPointer)
     {
@@ -935,23 +935,23 @@
     {
       current += 2;             /* skip versionCreated field */
     }
-  ZIP_NEXT_U16 (zipEntry->versionNeeded, current);
-  ZIP_NEXT_U16 (zipEntry->flags, current);
-  ZIP_NEXT_U16 (zipEntry->compressionMethod, current);
-  ZIP_NEXT_U16 (zipEntry->lastModTime, current);
-  ZIP_NEXT_U16 (zipEntry->lastModDate, current);
-  ZIP_NEXT_U32 (zipEntry->crc32, current);
-  ZIP_NEXT_U32 (zipEntry->compressedSize, current);
-  ZIP_NEXT_U32 (zipEntry->uncompressedSize, current);
-  ZIP_NEXT_U16 (zipEntry->filenameLength, current);
-  ZIP_NEXT_U16 (zipEntry->extraFieldLength, current);
+  (void) ZIP_NEXT_U16 (zipEntry->versionNeeded, current);
+  (void) ZIP_NEXT_U16 (zipEntry->flags, current);
+  (void) ZIP_NEXT_U16 (zipEntry->compressionMethod, current);
+  (void) ZIP_NEXT_U16 (zipEntry->lastModTime, current);
+  (void) ZIP_NEXT_U16 (zipEntry->lastModDate, current);
+  (void) ZIP_NEXT_U32 (zipEntry->crc32, current);
+  (void) ZIP_NEXT_U32 (zipEntry->compressedSize, current);
+  (void) ZIP_NEXT_U32 (zipEntry->uncompressedSize, current);
+  (void) ZIP_NEXT_U16 (zipEntry->filenameLength, current);
+  (void) ZIP_NEXT_U16 (zipEntry->extraFieldLength, current);
   zipEntry->fileCommentLength = 0;
 
   if (sig == ZIP_CentralHeader)
     {
-      ZIP_NEXT_U16 (zipEntry->fileCommentLength, current);
+      (void) ZIP_NEXT_U16 (zipEntry->fileCommentLength, current);
       current += 8;             /* skip disk number start + internal attrs + external attrs
*/
-      ZIP_NEXT_U32 (localEntryPointer, current);
+      (void) ZIP_NEXT_U32 (localEntryPointer, current);
     }
 
   if (filename)
@@ -1048,7 +1048,7 @@
         {
           if (hyfile_read (zipFile->fd, buf, 2) == 2)
             {
-              ZIP_NEXT_U16 (lost, buf2);
+              (void) ZIP_NEXT_U16 (lost, buf2);
               zipEntry->dataPointer = zipEntry->extraFieldPointer + lost;
               zipFile->pointer = localEntryPointer + 30;
             }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/hyzip/shared/zipsup.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/hyzip/shared/zipsup.c?rev=830150&r1=830149&r2=830150&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/hyzip/shared/zipsup.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/hyzip/shared/zipsup.c Tue
Oct 27 12:38:29 2009
@@ -351,13 +351,13 @@
                 {
                   /* Found it.  Read the data from the end-of-central-dir record. */
                   current = buffer + i + 4;
-                  ZIP_NEXT_U16 (endEntry->diskNumber, current);
-                  ZIP_NEXT_U16 (endEntry->dirStartDisk, current);
-                  ZIP_NEXT_U16 (endEntry->thisDiskEntries, current);
-                  ZIP_NEXT_U16 (endEntry->totalEntries, current);
-                  ZIP_NEXT_U32 (endEntry->dirSize, current);
-                  ZIP_NEXT_U32 (endEntry->dirOffset, current);
-                  ZIP_NEXT_U16 (endEntry->commentLength, current);
+                  (void) ZIP_NEXT_U16 (endEntry->diskNumber, current);
+                  (void) ZIP_NEXT_U16 (endEntry->dirStartDisk, current);
+                  (void) ZIP_NEXT_U16 (endEntry->thisDiskEntries, current);
+                  (void) ZIP_NEXT_U16 (endEntry->totalEntries, current);
+                  (void) ZIP_NEXT_U32 (endEntry->dirSize, current);
+                  (void) ZIP_NEXT_U32 (endEntry->dirOffset, current);
+                  (void) ZIP_NEXT_U16 (endEntry->commentLength, current);
 
                   /* Quick test to ensure that the header isn't invalid. 
                      Current dataSize is the number of bytes of data scanned, up to the ^H
in the stream. */
@@ -499,9 +499,9 @@
                     }
 
                   /* Read the data from the descriptor. */
-                  ZIP_NEXT_U32 (zipEntry->crc32, current);
-                  ZIP_NEXT_U32 (zipEntry->compressedSize, current);
-                  ZIP_NEXT_U32 (zipEntry->uncompressedSize, current);
+                  (void) ZIP_NEXT_U32 (zipEntry->crc32, current);
+                  (void) ZIP_NEXT_U32 (zipEntry->compressedSize, current);
+                  (void) ZIP_NEXT_U32 (zipEntry->uncompressedSize, current);
 
                   /* Quick test to ensure that the header isn't invalid. 
                      Current dataSize is the number of bytes of data scanned, up to the ^H
in the stream. */
@@ -642,7 +642,7 @@
             zipFile->pointer + (current - (buffer + bufferedSize));
 
           sig = 0;
-          ZIP_NEXT_U32 (sig, current);
+          (void) ZIP_NEXT_U32 (sig, current);
           if (sig == ZIP_CentralEnd)
             {
               /* We're done here. */
@@ -657,22 +657,22 @@
             }
 
           /* Read ZIP_CentralHeader entry */
-          ZIP_NEXT_U16 (entry.versionCreated, current);
-          ZIP_NEXT_U16 (entry.versionNeeded, current);
-          ZIP_NEXT_U16 (entry.flags, current);
-          ZIP_NEXT_U16 (entry.compressionMethod, current);
-          ZIP_NEXT_U16 (entry.lastModTime, current);
-          ZIP_NEXT_U16 (entry.lastModDate, current);
-          ZIP_NEXT_U32 (entry.crc32, current);
-          ZIP_NEXT_U32 (entry.compressedSize, current);
-          ZIP_NEXT_U32 (entry.uncompressedSize, current);
-          ZIP_NEXT_U16 (entry.filenameLength, current);
-          ZIP_NEXT_U16 (entry.extraFieldLength, current);
-          ZIP_NEXT_U16 (entry.fileCommentLength, current);
+          (void) ZIP_NEXT_U16 (entry.versionCreated, current);
+          (void) ZIP_NEXT_U16 (entry.versionNeeded, current);
+          (void) ZIP_NEXT_U16 (entry.flags, current);
+          (void) ZIP_NEXT_U16 (entry.compressionMethod, current);
+          (void) ZIP_NEXT_U16 (entry.lastModTime, current);
+          (void) ZIP_NEXT_U16 (entry.lastModDate, current);
+          (void) ZIP_NEXT_U32 (entry.crc32, current);
+          (void) ZIP_NEXT_U32 (entry.compressedSize, current);
+          (void) ZIP_NEXT_U32 (entry.uncompressedSize, current);
+          (void) ZIP_NEXT_U16 (entry.filenameLength, current);
+          (void) ZIP_NEXT_U16 (entry.extraFieldLength, current);
+          (void) ZIP_NEXT_U16 (entry.fileCommentLength, current);
           current += sizeof (U_16);     /* skip disk number field */
-          ZIP_NEXT_U16 (entry.internalAttributes, current);
+          (void) ZIP_NEXT_U16 (entry.internalAttributes, current);
           current += sizeof (U_32);     /* skip external attributes field */
-          ZIP_NEXT_U32 (localHeaderOffset, current);
+          (void) ZIP_NEXT_U32 (localHeaderOffset, current);
 
           /* Increase filename buffer size if necessary. */
           if (filenameSize < entry.filenameLength + 1)
@@ -871,7 +871,7 @@
     }
   zipFile->pointer += result;
   readLength = result;          /* If it's not enough, we'll catch that later */
-  ZIP_NEXT_U32 (sig, current);
+  (void) ZIP_NEXT_U32 (sig, current);
 
   if (enumerationPointer)
     {
@@ -930,23 +930,23 @@
     {
       current += 2;             /* skip versionCreated field */
     }
-  ZIP_NEXT_U16 (zipEntry->versionNeeded, current);
-  ZIP_NEXT_U16 (zipEntry->flags, current);
-  ZIP_NEXT_U16 (zipEntry->compressionMethod, current);
-  ZIP_NEXT_U16 (zipEntry->lastModTime, current);
-  ZIP_NEXT_U16 (zipEntry->lastModDate, current);
-  ZIP_NEXT_U32 (zipEntry->crc32, current);
-  ZIP_NEXT_U32 (zipEntry->compressedSize, current);
-  ZIP_NEXT_U32 (zipEntry->uncompressedSize, current);
-  ZIP_NEXT_U16 (zipEntry->filenameLength, current);
-  ZIP_NEXT_U16 (zipEntry->extraFieldLength, current);
+  (void) ZIP_NEXT_U16 (zipEntry->versionNeeded, current);
+  (void) ZIP_NEXT_U16 (zipEntry->flags, current);
+  (void) ZIP_NEXT_U16 (zipEntry->compressionMethod, current);
+  (void) ZIP_NEXT_U16 (zipEntry->lastModTime, current);
+  (void) ZIP_NEXT_U16 (zipEntry->lastModDate, current);
+  (void) ZIP_NEXT_U32 (zipEntry->crc32, current);
+  (void) ZIP_NEXT_U32 (zipEntry->compressedSize, current);
+  (void) ZIP_NEXT_U32 (zipEntry->uncompressedSize, current);
+  (void) ZIP_NEXT_U16 (zipEntry->filenameLength, current);
+  (void) ZIP_NEXT_U16 (zipEntry->extraFieldLength, current);
   zipEntry->fileCommentLength = 0;
 
   if (sig == ZIP_CentralHeader)
     {
-      ZIP_NEXT_U16 (zipEntry->fileCommentLength, current);
+      (void) ZIP_NEXT_U16 (zipEntry->fileCommentLength, current);
       current += 8;             /* skip disk number start + internal attrs + external attrs
*/
-      ZIP_NEXT_U32 (localEntryPointer, current);
+      (void) ZIP_NEXT_U32 (localEntryPointer, current);
     }
 
   if (filename)
@@ -1043,7 +1043,7 @@
         {
           if (hyfile_read (zipFile->fd, buf, 2) == 2)
             {
-              ZIP_NEXT_U16 (lost, buf2);
+              (void) ZIP_NEXT_U16 (lost, buf2);
               zipEntry->dataPointer = zipEntry->extraFieldPointer + lost;
               zipFile->pointer = localEntryPointer + 30;
             }



Mime
View raw message