Blame SOURCES/f310c0868634a1dbacdcdcb2dbce9501a8a87868.patch

b822c0
From f310c0868634a1dbacdcdcb2dbce9501a8a87868 Mon Sep 17 00:00:00 2001
b822c0
From: Mark Adler <madler@alumni.caltech.edu>
b822c0
Date: Sun, 24 Jan 2021 21:39:26 -0800
b822c0
Subject: [PATCH] Fix usage of x2nmodp() when compiling for no threads.
b822c0
b822c0
---
b822c0
 pigz.c | 8 ++++++--
b822c0
 1 file changed, 6 insertions(+), 2 deletions(-)
b822c0
b822c0
diff --git a/pigz.c b/pigz.c
b822c0
index e5a094a..7430e1e 100644
b822c0
--- a/pigz.c
b822c0
+++ b/pigz.c
b822c0
@@ -545,7 +545,9 @@ local struct {
b822c0
     int procs;              // maximum number of compression threads (>= 1)
b822c0
     int setdict;            // true to initialize dictionary in each thread
b822c0
     size_t block;           // uncompressed input size per thread (>= 32K)
b822c0
+#ifndef NOTHREAD
b822c0
     crc_t shift;            // pre-calculated CRC-32 shift for length block
b822c0
+#endif
b822c0
 
b822c0
     // saved gzip/zip header data for decompression, testing, and listing
b822c0
     time_t stamp;           // time stamp from gzip header
b822c0
@@ -4286,13 +4288,13 @@ local void defaults(void) {
b822c0
     //  blocksplittingmax = 15
b822c0
     ZopfliInitOptions(&g.zopts);
b822c0
 #endif
b822c0
+    g.block = 131072UL;             // 128K
b822c0
 #ifdef NOTHREAD
b822c0
     g.procs = 1;
b822c0
 #else
b822c0
     g.procs = nprocs(8);
b822c0
-#endif
b822c0
-    g.block = 131072UL;             // 128K
b822c0
     g.shift = x2nmodp(g.block, 3);
b822c0
+#endif
b822c0
     g.rsync = 0;                    // don't do rsync blocking
b822c0
     g.setdict = 1;                  // initialize dictionary each thread
b822c0
     g.verbosity = 1;                // normal message level
b822c0
@@ -4480,7 +4482,9 @@ local int option(char *arg) {
b822c0
         if (get == 1) {
b822c0
             n = num(arg);
b822c0
             g.block = n << 10;                  // chunk size
b822c0
+#ifndef NOTHREAD
b822c0
             g.shift = x2nmodp(g.block, 3);
b822c0
+#endif
b822c0
             if (g.block < DICT)
b822c0
                 throw(EINVAL, "block size too small (must be >= 32K)");
b822c0
             if (n != g.block >> 10 ||