jdk/src/java.base/share/native/libjli/parse_manifest.c
changeset 29389 348a32f79d79
parent 27938 7f7f8bf64dd7
child 29713 eeabfe673c97
--- a/jdk/src/java.base/share/native/libjli/parse_manifest.c	Wed Mar 04 17:35:40 2015 -0800
+++ b/jdk/src/java.base/share/native/libjli/parse_manifest.c	Tue Mar 10 14:23:03 2015 -0700
@@ -138,7 +138,7 @@
         return -1;
     if ((bytes = read(fd, ep, ZIP64_LOCHDR)) < 0)
         return -1;
-    if (GETSIG(ep) == ZIP64_LOCSIG)
+    if (ZIP64_LOCSIG_AT(ep))
        return end64pos;
     return -1;
 }
@@ -176,7 +176,7 @@
         return (-1);
     if ((bytes = read(fd, eb, ENDHDR)) < 0)
         return (-1);
-    if (GETSIG(eb) == ENDSIG) {
+    if (ENDSIG_AT(eb)) {
         return haveZIP64(eb) ? find_end64(fd, eb, pos) : pos;
     }
 
@@ -200,14 +200,11 @@
 
     /*
      * Search backwards from the end of file stopping when the END header
-     * signature is found. (The first condition of the "if" is just a
-     * fast fail, because the GETSIG macro isn't always cheap.  The
-     * final condition protects against false positives.)
+     * signature is found.
      */
     endpos = &buffer[bytes];
     for (cp = &buffer[bytes - ENDHDR]; cp >= &buffer[0]; cp--)
-        if ((*cp == (ENDSIG & 0xFF)) && (GETSIG(cp) == ENDSIG) &&
-          (cp + ENDHDR + ENDCOM(cp) == endpos)) {
+        if (ENDSIG_AT(cp) && (cp + ENDHDR + ENDCOM(cp) == endpos)) {
             (void) memcpy(eb, cp, ENDHDR);
             free(buffer);
             pos = flen - (endpos - cp);
@@ -267,7 +264,7 @@
         if ((bytes = read(fd, buffer, MINREAD)) < 0) {
             return (-1);
         }
-        if (GETSIG(buffer) != ZIP64_ENDSIG) {
+        if (!ZIP64_ENDSIG_AT(buffer)) {
             return -1;
         }
         if ((offset = ZIP64_ENDOFF(buffer)) < (jlong)0) {
@@ -356,7 +353,7 @@
      * Loop through the Central Directory Headers. Note that a valid zip/jar
      * must have an ENDHDR (with ENDSIG) after the Central Directory.
      */
-    while (GETSIG(p) == CENSIG) {
+    while (CENSIG_AT(p)) {
 
         /*
          * If a complete header isn't in the buffer, shift the contents
@@ -403,7 +400,7 @@
                 free(buffer);
                 return (-1);
             }
-            if (GETSIG(locbuf) != LOCSIG) {
+            if (!LOCSIG_AT(locbuf)) {
                 free(buffer);
                 return (-1);
             }