Blame SOURCES/1-remove-comments-from-templates.patch

8041ed
diff --git a/src/build/source_templates/compress.template b/src/build/source_templates/compress.template
8041ed
index 32008e9..09a5df4 100644
8041ed
--- a/src/build/source_templates/compress.template
8041ed
+++ b/src/build/source_templates/compress.template
8041ed
@@ -31,7 +31,6 @@
8041ed
       main:
8041ed
       while (true) {
8041ed
 
8041ed
-        // find a match
8041ed
         int forwardOff = sOff;
8041ed
 
8041ed
         int ref;
8041ed
@@ -51,15 +50,12 @@
8041ed
           ${type}Utils.writeShort(hashTable, h, sOff - srcOff);
8041ed
         } while (!LZ4${utils}.readIntEquals(src, ref, sOff));
8041ed
 
8041ed
-        // catch up
8041ed
         final int excess = LZ4${utils}.commonBytesBackward(src, ref, sOff, srcOff, anchor);
8041ed
         sOff -= excess;
8041ed
         ref -= excess;
8041ed
 
8041ed
-        // sequence == refsequence
8041ed
         final int runLen = sOff - anchor;
8041ed
 
8041ed
-        // encode literal length
8041ed
         int tokenOff = dOff++;
8041ed
 
8041ed
         if (dOff + runLen + (2 + 1 + LAST_LITERALS) + (runLen >>> 8) > destEnd) {
8041ed
@@ -73,16 +69,13 @@
8041ed
           ${utils}.writeByte(dest, tokenOff, runLen << ML_BITS);
8041ed
         }
8041ed
 
8041ed
-        // copy literals
8041ed
         LZ4${utils}.wildArraycopy(src, anchor, dest, dOff, runLen);
8041ed
         dOff += runLen;
8041ed
 
8041ed
         while (true) {
8041ed
-          // encode offset
8041ed
           ${utils}.writeShortLE(dest, dOff, (short) (sOff - ref));
8041ed
           dOff += 2;
8041ed
 
8041ed
-          // count nb matches
8041ed
           sOff += MIN_MATCH;
8041ed
           ref += MIN_MATCH;
8041ed
           final int matchLen = LZ4${utils}.commonBytes(src, ref, sOff, srcLimit);
8041ed
@@ -91,7 +84,6 @@
8041ed
           }
8041ed
           sOff += matchLen;
8041ed
 
8041ed
-          // encode match len
8041ed
           if (matchLen >= ML_MASK) {
8041ed
             ${utils}.writeByte(dest, tokenOff, ${utils}.readByte(dest, tokenOff) | ML_MASK);
8041ed
             dOff = LZ4${utils}.writeLen(matchLen - ML_MASK, dest, dOff);
8041ed
@@ -99,16 +91,13 @@
8041ed
             ${utils}.writeByte(dest, tokenOff, ${utils}.readByte(dest, tokenOff) | matchLen);
8041ed
           }
8041ed
 
8041ed
-          // test end of chunk
8041ed
           if (sOff > mflimit) {
8041ed
             anchor = sOff;
8041ed
             break main;
8041ed
           }
8041ed
 
8041ed
-          // fill table
8041ed
           ${type}Utils.writeShort(hashTable, hash64k(${utils}.readInt(src, sOff - 2)), sOff - 2 - srcOff);
8041ed
 
8041ed
-          // test next position
8041ed
           final int h = hash64k(${utils}.readInt(src, sOff));
8041ed
           ref = srcOff + ${type}Utils.readShort(hashTable, h);
8041ed
           ${type}Utils.writeShort(hashTable, h, sOff - srcOff);
8041ed
@@ -121,7 +110,6 @@
8041ed
           ${utils}.writeByte(dest, tokenOff, 0);
8041ed
         }
8041ed
 
8041ed
-        // prepare next loop
8041ed
         anchor = sOff++;
8041ed
       }
8041ed
     }
8041ed
@@ -160,7 +148,6 @@
8041ed
     main:
8041ed
     while (true) {
8041ed
 
8041ed
-      // find a match
8041ed
       int forwardOff = sOff;
8041ed
 
8041ed
       int ref;
8041ed
@@ -187,10 +174,8 @@
8041ed
       sOff -= excess;
8041ed
       ref -= excess;
8041ed
 
8041ed
-      // sequence == refsequence
8041ed
       final int runLen = sOff - anchor;
8041ed
 
8041ed
-      // encode literal length
8041ed
       int tokenOff = dOff++;
8041ed
 
8041ed
       if (dOff + runLen + (2 + 1 + LAST_LITERALS) + (runLen >>> 8) > destEnd) {
8041ed
@@ -204,16 +189,13 @@
8041ed
         ${utils}.writeByte(dest, tokenOff, runLen << ML_BITS);
8041ed
       }
8041ed
 
8041ed
-      // copy literals
8041ed
       LZ4${utils}.wildArraycopy(src, anchor, dest, dOff, runLen);
8041ed
       dOff += runLen;
8041ed
 
8041ed
       while (true) {
8041ed
-        // encode offset
8041ed
         ${utils}.writeShortLE(dest, dOff, back);
8041ed
         dOff += 2;
8041ed
 
8041ed
-        // count nb matches
8041ed
         sOff += MIN_MATCH;
8041ed
         final int matchLen = LZ4${utils}.commonBytes(src, ref + MIN_MATCH, sOff, srcLimit);
8041ed
         if (dOff + (1 + LAST_LITERALS) + (matchLen >>> 8) > destEnd) {
8041ed
@@ -221,7 +203,6 @@
8041ed
         }
8041ed
         sOff += matchLen;
8041ed
 
8041ed
-        // encode match len
8041ed
         if (matchLen >= ML_MASK) {
8041ed
           ${utils}.writeByte(dest, tokenOff, ${utils}.readByte(dest, tokenOff) | ML_MASK);
8041ed
           dOff = LZ4${utils}.writeLen(matchLen - ML_MASK, dest, dOff);
8041ed
@@ -229,16 +210,13 @@
8041ed
           ${utils}.writeByte(dest, tokenOff, ${utils}.readByte(dest, tokenOff) | matchLen);
8041ed
         }
8041ed
 
8041ed
-        // test end of chunk
8041ed
         if (sOff > mflimit) {
8041ed
           anchor = sOff;
8041ed
           break main;
8041ed
         }
8041ed
 
8041ed
-        // fill table
8041ed
         ${type}Utils.writeInt(hashTable, hash(${utils}.readInt(src, sOff - 2)), sOff - 2);
8041ed
 
8041ed
-        // test next position
8041ed
         final int h = hash(${utils}.readInt(src, sOff));
8041ed
         ref = ${type}Utils.readInt(hashTable, h);
8041ed
         ${type}Utils.writeInt(hashTable, h, sOff);
8041ed
@@ -252,7 +230,6 @@
8041ed
         ${utils}.writeByte(dest, tokenOff, 0);
8041ed
       }
8041ed
 
8041ed
-      // prepare next loop
8041ed
       anchor = sOff++;
8041ed
     }
8041ed
 
8041ed
diff --git a/src/build/source_templates/compress_hc.template b/src/build/source_templates/compress_hc.template
8041ed
index 7179db3..7976ad1 100644
8041ed
--- a/src/build/source_templates/compress_hc.template
8041ed
+++ b/src/build/source_templates/compress_hc.template
8041ed
@@ -47,7 +47,6 @@
8041ed
         continue;
8041ed
       }
8041ed
 
8041ed
-      // saved, in case we would skip too much
8041ed
       copyTo(match1, match0);
8041ed
 
8041ed
       search2:
8041ed
@@ -55,20 +54,19 @@
8041ed
         assert match1.start >= anchor;
8041ed
         if (match1.end() >= mfLimit
8041ed
             || !ht.insertAndFindWiderMatch(src, match1.end() - 2, match1.start + 1, matchLimit, match1.len, match2)) {
8041ed
-          // no better match
8041ed
           dOff = LZ4${utils}.encodeSequence(src, anchor, match1.start, match1.ref, match1.len, dest, dOff, destEnd);
8041ed
           anchor = sOff = match1.end();
8041ed
           continue main;
8041ed
         }
8041ed
 
8041ed
         if (match0.start < match1.start) {
8041ed
-          if (match2.start < match1.start + match0.len) { // empirical
8041ed
+          if (match2.start < match1.start + match0.len) {
8041ed
             copyTo(match0, match1);
8041ed
           }
8041ed
         }
8041ed
         assert match2.start > match1.start;
8041ed
 
8041ed
-        if (match2.start - match1.start < 3) { // First Match too small : removed
8041ed
+        if (match2.start - match1.start < 3) {
8041ed
           copyTo(match2, match1);
8041ed
           continue search2;
8041ed
         }
8041ed
@@ -91,21 +89,18 @@
8041ed
 
8041ed
           if (match2.start + match2.len >= mfLimit
8041ed
               || !ht.insertAndFindWiderMatch(src, match2.end() - 3, match2.start, matchLimit, match2.len, match3)) {
8041ed
-            // no better match -> 2 sequences to encode
8041ed
             if (match2.start < match1.end()) {
8041ed
               match1.len = match2.start - match1.start;
8041ed
             }
8041ed
-            // encode seq 1
8041ed
             dOff = LZ4${utils}.encodeSequence(src, anchor, match1.start, match1.ref, match1.len, dest, dOff, destEnd);
8041ed
             anchor = sOff = match1.end();
8041ed
-            // encode seq 2
8041ed
             dOff = LZ4${utils}.encodeSequence(src, anchor, match2.start, match2.ref, match2.len, dest, dOff, destEnd);
8041ed
             anchor = sOff = match2.end();
8041ed
             continue main;
8041ed
           }
8041ed
 
8041ed
-          if (match3.start < match1.end() + 3) { // Not enough space for match 2 : remove it
8041ed
-            if (match3.start >= match1.end()) { // // can write Seq1 immediately ==> Seq2 is removed, so Seq3 becomes Seq1
8041ed
+          if (match3.start < match1.end() + 3) {
8041ed
+            if (match3.start >= match1.end()) {
8041ed
               if (match2.start < match1.end()) {
8041ed
                 final int correction = match1.end() - match2.start;
8041ed
                 match2.fix(correction);
8041ed
@@ -127,7 +122,6 @@
8041ed
             continue search3;
8041ed
           }
8041ed
 
8041ed
-          // OK, now we have 3 ascending matches; let's write at least the first one
8041ed
           if (match2.start < match1.end()) {
8041ed
             if (match2.start - match1.start < ML_MASK) {
8041ed
               if (match1.len > OPTIMAL_ML) {
8041ed
diff --git a/src/build/source_templates/decompress.template b/src/build/source_templates/decompress.template
8041ed
index f1c2890..1e2aa23 100644
8041ed
--- a/src/build/source_templates/decompress.template
8041ed
+++ b/src/build/source_templates/decompress.template
8041ed
@@ -55,7 +55,6 @@
8041ed
       final int token = ${utils}.readByte(src, sOff) & 0xFF;
8041ed
       ++sOff;
8041ed
 
8041ed
-      // literals
8041ed
       int literalLen = token >>> ML_BITS;
8041ed
       if (literalLen == RUN_MASK) {
8041ed
         byte len = (byte) 0xFF;
8041ed
@@ -81,7 +80,7 @@
8041ed
           LZ4${utils}.safeArraycopy(src, sOff, dest, dOff, literalLen);
8041ed
           sOff += literalLen;
8041ed
           dOff = literalCopyEnd;
8041ed
-          break; // EOF
8041ed
+          break;
8041ed
         }
8041ed
       }
8041ed
 
8041ed
@@ -89,7 +88,6 @@
8041ed
       sOff += literalLen;
8041ed
       dOff = literalCopyEnd;
8041ed
 
8041ed
-      // matchs
8041ed
       final int matchDec = ${utils}.readShortLE(src, sOff);
8041ed
       sOff += 2;
8041ed
       int matchOff = dOff - matchDec;
8041ed
diff --git a/src/build/source_templates/hashtable.template b/src/build/source_templates/hashtable.template
8041ed
index 174f8e8..91935f5 100644
8041ed
--- a/src/build/source_templates/hashtable.template
8041ed
+++ b/src/build/source_templates/hashtable.template
8041ed
@@ -92,8 +92,8 @@
8041ed
 
8041ed
       int ref = hashPointer(buf, off);
8041ed
 
8041ed
-      if (ref >= off - 4 && ref <= off && ref >= base) { // potential repetition
8041ed
-        if (LZ4${utils}.readIntEquals(buf, ref, off)) { // confirmed
8041ed
+      if (ref >= off - 4 && ref <= off && ref >= base) {
8041ed
+        if (LZ4${utils}.readIntEquals(buf, ref, off)) {
8041ed
           delta = off - ref;
8041ed
           repl = match.len = MIN_MATCH + LZ4${utils}.commonBytes(buf, ref + MIN_MATCH, off + MIN_MATCH, matchLimit);
8041ed
           match.ref = ref;
8041ed
@@ -119,7 +119,7 @@
8041ed
         int ptr = off;
8041ed
         final int end = off + repl - (MIN_MATCH - 1);
8041ed
         while (ptr < end - delta) {
8041ed
-          chainTable[ptr & MASK] = (short) delta; // pre load
8041ed
+          chainTable[ptr & MASK] = (short) delta;
8041ed
           ++ptr;
8041ed
         }
8041ed
         do {
8041ed
diff --git a/src/build/source_templates/xxhash32_streaming.template b/src/build/source_templates/xxhash32_streaming.template
8041ed
index 6166758..9fa55e8 100644
8041ed
--- a/src/build/source_templates/xxhash32_streaming.template
8041ed
+++ b/src/build/source_templates/xxhash32_streaming.template
8041ed
@@ -66,7 +66,7 @@ final class StreamingXXHash32Java${type} extends AbstractStreamingXXHash32Java {
8041ed
 
8041ed
     totalLen += len;
8041ed
 
8041ed
-    if (memSize + len < 16) { // fill in tmp buffer
8041ed
+    if (memSize + len < 16) {
8041ed
       System.arraycopy(buf, off, memory, memSize, len);
8041ed
       memSize += len;
8041ed
       return;
8041ed
@@ -74,7 +74,7 @@ final class StreamingXXHash32Java${type} extends AbstractStreamingXXHash32Java {
8041ed
 
8041ed
     final int end = off + len;
8041ed
 
8041ed
-    if (memSize > 0) { // data left from previous update
8041ed
+    if (memSize > 0) {
8041ed
       System.arraycopy(buf, off, memory, memSize, 16 - memSize);
8041ed
 
8041ed
       v1 += readIntLE(memory, 0) * PRIME2;
8041ed
diff --git a/src/build/source_templates/xxhash64_streaming.template b/src/build/source_templates/xxhash64_streaming.template
8041ed
index 2789ae0..e781746 100644
8041ed
--- a/src/build/source_templates/xxhash64_streaming.template
8041ed
+++ b/src/build/source_templates/xxhash64_streaming.template
8041ed
@@ -90,7 +90,7 @@ final class StreamingXXHash64Java${type} extends AbstractStreamingXXHash64Java {
8041ed
 
8041ed
     totalLen += len;
8041ed
 
8041ed
-    if (memSize + len < 32) { // fill in tmp buffer
8041ed
+    if (memSize + len < 32) {
8041ed
       System.arraycopy(buf, off, memory, memSize, len);
8041ed
       memSize += len;
8041ed
       return;
8041ed
@@ -98,7 +98,7 @@ final class StreamingXXHash64Java${type} extends AbstractStreamingXXHash64Java {
8041ed
 
8041ed
     final int end = off + len;
8041ed
 
8041ed
-    if (memSize > 0) { // data left from previous update
8041ed
+    if (memSize > 0) {
8041ed
       System.arraycopy(buf, off, memory, memSize, 32 - memSize);
8041ed
 
8041ed
       v1 += readLongLE(memory, 0) * PRIME64_2;