]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Add cleanup for defines that might be set before inclusion of chunkset_tpl.h
authorPavel P <pavlov.pavel@gmail.com>
Wed, 21 Jan 2026 11:10:03 +0000 (13:10 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sat, 24 Jan 2026 21:50:22 +0000 (22:50 +0100)
 + remove unused `HAVE_CHUNKUNROLL`
 + type `utilisation` => `utilization`

chunkset_tpl.h

index 2087e66f5e362990e323aa1659167b915aa1dedf..035bb92cd1a8316128e7c77fa7bc6d95a79da8d7 100644 (file)
@@ -16,7 +16,7 @@ static inline size_t CHUNKSIZE(void) {
    sizeof chunk_t bytes (or that they don't overlap at all or simply that
    the distance is less than the length of the copy).
 
-   Aside from better memory bus utilisation, this means that short copies
+   Aside from better memory bus utilization, this means that short copies
    (chunk_t bytes or fewer) will fall straight through the loop
    without iteration, which will hopefully make the branch prediction more
    reliable. */
@@ -49,7 +49,6 @@ static inline uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len
    This assumption holds because inflate_fast() starts every iteration with at
    least 258 bytes of output space available (258 being the maximum length
    output from a single token; see inflate_fast()'s assumptions below). */
-#ifndef HAVE_CHUNKUNROLL
 static inline uint8_t* CHUNKUNROLL(uint8_t *out, unsigned *dist, unsigned *len) {
     unsigned char const *from = out - *dist;
     chunk_t chunk;
@@ -62,7 +61,6 @@ static inline uint8_t* CHUNKUNROLL(uint8_t *out, unsigned *dist, unsigned *len)
     }
     return out;
 }
-#endif
 
 #ifndef HAVE_CHUNK_MAG
 /* Loads a magazine to feed into memory of the pattern */
@@ -281,3 +279,19 @@ static inline uint8_t *CHUNKCOPY_SAFE(uint8_t *out, uint8_t *from, uint64_t len,
 
     return CHUNKMEMSET(out, from, (unsigned)len);
 }
+
+// Cleanup
+#undef CHUNKCOPY
+#undef CHUNKMEMSET
+#undef CHUNKMEMSET_SAFE
+#undef CHUNKSIZE
+#undef CHUNKUNROLL
+#undef HAVE_CHUNKCOPY
+#undef HAVE_CHUNKMEMSET_2
+#undef HAVE_CHUNKMEMSET_4
+#undef HAVE_CHUNKMEMSET_8
+#undef HAVE_CHUNKMEMSET_16
+#undef HAVE_CHUNK_MAG
+#undef HAVE_HALFCHUNKCOPY
+#undef HAVE_HALF_CHUNK
+#undef HAVE_MASKED_READWRITE