From a5a6908b9f3ea8c62da9ad658f6ffecca3bdb5af Mon Sep 17 00:00:00 2001 From: jammyjellyfish Date: Wed, 24 May 2023 20:31:15 +0800 Subject: [PATCH] fix c++11 space between literal and identifier error --- ...space-between-literal-and-identifier.patch | 194 ++++++++++++++++++ pbzip2.spec | 8 +- 2 files changed, 200 insertions(+), 2 deletions(-) create mode 100644 fix-c++11-space-between-literal-and-identifier.patch diff --git a/fix-c++11-space-between-literal-and-identifier.patch b/fix-c++11-space-between-literal-and-identifier.patch new file mode 100644 index 0000000..f306ec4 --- /dev/null +++ b/fix-c++11-space-between-literal-and-identifier.patch @@ -0,0 +1,194 @@ +diff -up a/pbzip2.cpp b/pbzip2.cpp +--- a/pbzip2.cpp 2023-05-24 20:19:21.095897285 +0800 ++++ b/pbzip2.cpp 2023-05-24 20:21:38.356034312 +0800 +@@ -254,7 +254,7 @@ int safe_cond_timed_wait(pthread_cond_t + waitTimer.tv_sec += seconds; + #endif + #ifdef PBZIP_DEBUG +- fprintf(stderr, "%s: waitTimer.tv_sec: %"PRIiMAX" waitTimer.tv_nsec: %"PRIiMAX"\n", caller, ++ fprintf(stderr, "%s: waitTimer.tv_sec: %" PRIiMAX" waitTimer.tv_nsec: %" PRIiMAX"\n", caller, + (intmax_t)waitTimer.tv_sec, (intmax_t)waitTimer.tv_nsec); + #endif + int pret = pthread_cond_timedwait(cond, mutex, &waitTimer); +@@ -556,7 +556,7 @@ inline void syncSetLastGoodBlock(int new + safe_mutex_lock(OutMutex); + #ifdef PBZIP_DEBUG + uintmax_t thid = (uintmax_t) pthread_self(); +- fprintf(stderr, "(%"PRIuMAX") syncSetLastGoodBlock: %d -> %d; MinErrorBlock: %d -> %d\n", ++ fprintf(stderr, "(%" PRIuMAX") syncSetLastGoodBlock: %d -> %d; MinErrorBlock: %d -> %d\n", + thid, LastGoodBlock, newValue, MinErrorBlock, errBlock); + #endif + +@@ -663,7 +663,7 @@ int waitForPreviousBlock(int blockNumToW + #ifdef PBZIP_DEBUG + uintmax_t thid = (uintmax_t) pthread_self(); + safe_mutex_lock(OutMutex); +- fprintf( stderr, "(%"PRIuMAX") waitForPreviousBlock enter: LastGoodBlock=%d" ++ fprintf( stderr, "(%" PRIuMAX") waitForPreviousBlock enter: LastGoodBlock=%d" + "; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d; errBlockNumber=%d\n", + thid, + LastGoodBlock, blockNumToWait, NextBlockToWrite, +@@ -676,7 +676,7 @@ int waitForPreviousBlock(int blockNumToW + if (syncGetTerminateFlag() != 0) + { + #ifdef PBZIP_DEBUG +- fprintf(stderr, "(%"PRIuMAX") waitForPreviousBlock terminated [%d]: blockNumToWait=%d\n", ++ fprintf(stderr, "(%" PRIuMAX") waitForPreviousBlock terminated [%d]: blockNumToWait=%d\n", + thid, -1, blockNumToWait ); + #endif + return -1; +@@ -685,7 +685,7 @@ int waitForPreviousBlock(int blockNumToW + safe_mutex_lock(OutMutex); + + #ifdef PBZIP_DEBUG +- fprintf( stderr, "(%"PRIuMAX") waitForPreviousBlock before check: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n", ++ fprintf( stderr, "(%" PRIuMAX") waitForPreviousBlock before check: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n", + thid, LastGoodBlock, blockNumToWait, NextBlockToWrite, MinErrorBlock ); + #endif + +@@ -693,7 +693,7 @@ int waitForPreviousBlock(int blockNumToW + if ( (MinErrorBlock != -1) && (MinErrorBlock < errBlockNumber) ) + { + #ifdef PBZIP_DEBUG +- fprintf( stderr, "(%"PRIuMAX") waitForPreviousBlock exit [%d]: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n", ++ fprintf( stderr, "(%" PRIuMAX") waitForPreviousBlock exit [%d]: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n", + thid, 2, LastGoodBlock, blockNumToWait, NextBlockToWrite, MinErrorBlock ); + #endif + safe_mutex_unlock(OutMutex); +@@ -703,7 +703,7 @@ int waitForPreviousBlock(int blockNumToW + if (errBlockNumber <= NextBlockToWrite) + { + #ifdef PBZIP_DEBUG +- fprintf( stderr, "(%"PRIuMAX") waitForPreviousBlock exit [%d]: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n", ++ fprintf( stderr, "(%" PRIuMAX") waitForPreviousBlock exit [%d]: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n", + thid, 0, LastGoodBlock, blockNumToWait, NextBlockToWrite, MinErrorBlock ); + #endif + safe_mutex_unlock(OutMutex); +@@ -711,7 +711,7 @@ int waitForPreviousBlock(int blockNumToW + } + + #ifdef PBZIP_DEBUG +- fprintf( stderr, "(%"PRIuMAX") waitForPreviousBlock to sleep: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n", ++ fprintf( stderr, "(%" PRIuMAX") waitForPreviousBlock to sleep: LastGoodBlock=%d; blockNumToWait=%d; NextBlockToWrite=%d; MinErrorBlock=%d\n", + thid, LastGoodBlock, blockNumToWait, NextBlockToWrite, MinErrorBlock ); + #endif + +@@ -760,7 +760,7 @@ inline int issueDecompressError(int bzre + { + #ifdef PBZIP_DEBUG + uintmax_t thid = (uintmax_t) pthread_self(); +- fprintf(stderr, "(%"PRIuMAX") enter issueDecompressError: msg=%s; ret=%d; block=%d; seq=%d; isLastInSeq=%d; avail_in=%d\n", ++ fprintf(stderr, "(%" PRIuMAX") enter issueDecompressError: msg=%s; ret=%d; block=%d; seq=%d; isLastInSeq=%d; avail_in=%d\n", + thid, + errmsg, bzret, fileData->blockNumber, + outSequenceNumber, (int)fileData->isLastInSequence, strm.avail_in); +@@ -796,7 +796,7 @@ int decompressErrCheckSingle(int bzret, + + #ifdef PBZIP_DEBUG + uintmax_t thid = (uintmax_t) pthread_self(); +- fprintf(stderr, "(%"PRIuMAX") enter decompressErrCheckSingle: msg=%s; ret=%d; block=%d; seq=%d; isLastInSeq=%d; avail_in=%d; lastGoodBlock=%d\n", ++ fprintf(stderr, "(%" PRIuMAX") enter decompressErrCheckSingle: msg=%s; ret=%d; block=%d; seq=%d; isLastInSeq=%d; avail_in=%d; lastGoodBlock=%d\n", + thid, + errmsg, bzret, fileData->blockNumber, + outSequenceNumber, (int)fileData->isLastInSequence, strm.avail_in, lastGoodBlock); +@@ -1244,7 +1244,7 @@ int producer_decompress(int hInfile, OFF + } + } + #ifdef PBZIP_DEBUG +- fprintf(stderr, "producer: Buffer: %p Size: %"PRIuMAX" Block: %d\n", fileData->buf, ++ fprintf(stderr, "producer: Buffer: %p Size: %" PRIuMAX" Block: %d\n", fileData->buf, + (uintmax_t)fileData->bufSize, NumBlocks); + #endif + +@@ -1308,7 +1308,7 @@ int consumerDecompressCheckInterrupt(con + isInterrupted = true; + + #ifdef PBZIP_DEBUG +- fprintf (stderr, "(%"PRIuMAX") consumer_decompress: interrupt1 - TerminateFlag set.\n", thid); ++ fprintf (stderr, "(%" PRIuMAX") consumer_decompress: interrupt1 - TerminateFlag set.\n", thid); + #endif + } + int minErrBlock = syncGetMinErrorBlock(); +@@ -1320,7 +1320,7 @@ int consumerDecompressCheckInterrupt(con + isInterrupted = true; + + #ifdef PBZIP_DEBUG +- fprintf (stderr, "(%"PRIuMAX") consumer_decompress: terminating1 - LastGoodBlock set [%d].\n", thid, syncGetLastGoodBlock()); ++ fprintf (stderr, "(%" PRIuMAX") consumer_decompress: terminating1 - LastGoodBlock set [%d].\n", thid, syncGetLastGoodBlock()); + #endif + } + +@@ -1664,8 +1664,8 @@ void *fileWriter(void *outname) + safe_mutex_lock(OutMutex); + #ifdef PBZIP_DEBUG + outBuff * lastnext = (prevBlockInSequence != NULL) ? prevBlockInSequence->next : NULL; +- fprintf(stderr, "fileWriter: Block: %d Size: %"PRIuMAX" Next File Block: %d" +- ", outBufferPos: %"PRIuMAX", NumBlocks: %d, producerDone: %d, lastseq=%d" ++ fprintf(stderr, "fileWriter: Block: %d Size: %" PRIuMAX" Next File Block: %d" ++ ", outBufferPos: %" PRIuMAX", NumBlocks: %d, producerDone: %d, lastseq=%d" + ", prev=%p, next=%p\n", + currBlock, (uintmax_t)NumBufferedBlocksMax, NextBlockToWrite, + (uintmax_t)outBufferPos, NumBlocks, syncGetProducerDone(), lastseq, +@@ -1791,7 +1791,7 @@ void *fileWriter(void *outname) + } + + #ifdef PBZIP_DEBUG +- fprintf(stderr, "Completed: %d%% NextBlockToWrite: %d/%"PRIuMAX" \r", percentComplete, NextBlockToWrite, (uintmax_t)NumBufferedBlocksMax); ++ fprintf(stderr, "Completed: %d%% NextBlockToWrite: %d/%" PRIuMAX" \r", percentComplete, NextBlockToWrite, (uintmax_t)NumBufferedBlocksMax); + fflush(stderr); + #else + if (percentComplete != percentCompleteOld) +@@ -1855,7 +1855,7 @@ void *fileWriter(void *outname) + percentComplete = 100; + + #ifdef PBZIP_DEBUG +- fprintf(stderr, "Completed: %d%% NextBlockToWrite: %d/%"PRIuMAX" \r", percentComplete, NextBlockToWrite, (uintmax_t)NumBufferedBlocksMax); ++ fprintf(stderr, "Completed: %d%% NextBlockToWrite: %d/%" PRIuMAX" \r", percentComplete, NextBlockToWrite, (uintmax_t)NumBufferedBlocksMax); + fflush(stderr); + #else + +@@ -1929,7 +1929,7 @@ int directcompress(int hInfile, OFF_T fi + inSize = bytesLeft; + + #ifdef PBZIP_DEBUG +- fprintf(stderr, " -> Bytes To Read: %"PRIuMAX" bytes...\n", (uintmax_t)inSize); ++ fprintf(stderr, " -> Bytes To Read: %" PRIuMAX" bytes...\n", (uintmax_t)inSize); + #endif + + // allocate memory to read in file +@@ -2006,7 +2006,7 @@ int directcompress(int hInfile, OFF_T fi + } + + #ifdef PBZIP_DEBUG +- fprintf(stderr, "\n Original Block Size: %"PRIuMAX"\n", (uintmax_t)inSize); ++ fprintf(stderr, "\n Original Block Size: %" PRIuMAX"\n", (uintmax_t)inSize); + fprintf(stderr, " Compressed Block Size: %u\n", outSize); + #endif + +@@ -2417,7 +2417,7 @@ int producer(int hInfile, int blockSize, + inSize = blockSize; + + #ifdef PBZIP_DEBUG +- fprintf(stderr, " -> Bytes To Read: %"PRIuMAX" bytes...\n", (uintmax_t)inSize); ++ fprintf(stderr, " -> Bytes To Read: %" PRIuMAX" bytes...\n", (uintmax_t)inSize); + #endif + + // allocate memory to read in file +@@ -2478,7 +2478,7 @@ int producer(int hInfile, int blockSize, + } + } + #ifdef PBZIP_DEBUG +- fprintf(stderr, "producer: Buffer: %p Size: %"PRIuMAX" Block: %d\n", FileData, (uintmax_t)inSize, NumBlocks); ++ fprintf(stderr, "producer: Buffer: %p Size: %" PRIuMAX" Block: %d\n", FileData, (uintmax_t)inSize, NumBlocks); + #endif + + outBuff * queueElement = new(std::nothrow) outBuff(FileData, inSize, NumBlocks, 0); +@@ -4214,7 +4214,7 @@ int main(int argc, char* argv[]) + NumBufferedBlocksMax = NumBufferedBlocksMax - (numCPU * 2); + #ifdef PBZIP_DEBUG + fprintf(stderr, "pbzip2: maxMemory: %d blockSize: %d\n", maxMemory, blockSize); +- fprintf(stderr, "pbzip2: NumBufferedBlocksMax: %"PRIuMAX"\n", (uintmax_t)NumBufferedBlocksMax); ++ fprintf(stderr, "pbzip2: NumBufferedBlocksMax: %" PRIuMAX"\n", (uintmax_t)NumBufferedBlocksMax); + #endif + // check to see if our max buffered blocks is less than numCPU, if yes increase maxMemory + // to support numCPU requested unless -m switch given by user diff --git a/pbzip2.spec b/pbzip2.spec index 5969a0b..1cb6186 100644 --- a/pbzip2.spec +++ b/pbzip2.spec @@ -1,13 +1,14 @@ %global debug_package %{nil} Name: pbzip2 Version: 1.1.13 -Release: 1 +Release: 2 Summary: Parallel implementation of the bzip2 block-sorting file compressor License: BSD URL: http://www.compression.ca/pbzip2/ Source0: https://launchpad.net/pbzip2/1.1/1.1.13/+download/pbzip2-1.1.13.tar.gz -Patch0: 001-Fix-Invalid-Suffix_pbzip2.patch +Patch0: 001-Fix-Invalid-Suffix_pbzip2.patch +Patch1: fix-c++11-space-between-literal-and-identifier.patch BuildRequires: gcc-c++ bzip2-devel @@ -47,6 +48,9 @@ popd %{_mandir}/man1/* %changelog +* Wed May 24 2023 jammyjellyfish - 1.1.13-2 +- fix c++11 space between literal and identifier error + * Fri Feb 03 2023 wenchaofan <349464272@qq.com> - 1.1.13-1 - Update to 1.1.13 -- Gitee