diff --git a/C/zstdmt/lz4mt_compress.c b/C/zstdmt/lz4mt_compress.c index dcd3e6ed..cbd98b1e 100644 --- a/C/zstdmt/lz4mt_compress.c +++ b/C/zstdmt/lz4mt_compress.c @@ -313,6 +313,7 @@ static void *pt_compress(void *arg) size_t LZ4MT_compressCCtx(LZ4MT_CCtx * ctx, LZ4MT_RdWr_t * rdwr) { int t; + void *retval_of_thread = 0; if (!ctx) return ERROR(compressionParameter_unsupported); @@ -335,7 +336,7 @@ size_t LZ4MT_compressCCtx(LZ4MT_CCtx * ctx, LZ4MT_RdWr_t * rdwr) void *p; pthread_join(w->pthread, &p); if (p) - return (size_t) p; + retval_of_thread = p; } /* clean up lists */ @@ -349,7 +350,7 @@ size_t LZ4MT_compressCCtx(LZ4MT_CCtx * ctx, LZ4MT_RdWr_t * rdwr) free(wl); } - return 0; + return (size_t)retval_of_thread; } /* returns current uncompressed data size */ diff --git a/C/zstdmt/lz4mt_decompress.c b/C/zstdmt/lz4mt_decompress.c index 65c26df1..bd8997c5 100644 --- a/C/zstdmt/lz4mt_decompress.c +++ b/C/zstdmt/lz4mt_decompress.c @@ -485,6 +485,7 @@ size_t LZ4MT_decompressDCtx(LZ4MT_DCtx * ctx, LZ4MT_RdWr_t * rdwr) int t, rv; cwork_t *w = &ctx->cwork[0]; LZ4MT_Buffer *in = &w->in; + void *retval_of_thread = 0; if (!ctx) return ERROR(compressionParameter_unsupported); @@ -544,7 +545,7 @@ size_t LZ4MT_decompressDCtx(LZ4MT_DCtx * ctx, LZ4MT_RdWr_t * rdwr) void *p; pthread_join(w->pthread, &p); if (p) - return (size_t) p; + retval_of_thread = p; } okay: @@ -559,7 +560,7 @@ size_t LZ4MT_decompressDCtx(LZ4MT_DCtx * ctx, LZ4MT_RdWr_t * rdwr) free(wl); } - return 0; + return (size_t)retval_of_thread; } /* returns current uncompressed data size */ diff --git a/C/zstdmt/lz5mt_compress.c b/C/zstdmt/lz5mt_compress.c index 6238802d..9f96e1a9 100644 --- a/C/zstdmt/lz5mt_compress.c +++ b/C/zstdmt/lz5mt_compress.c @@ -313,6 +313,7 @@ static void *pt_compress(void *arg) size_t LZ5MT_compressCCtx(LZ5MT_CCtx * ctx, LZ5MT_RdWr_t * rdwr) { int t; + void *retval_of_thread = 0; if (!ctx) return ERROR(compressionParameter_unsupported); @@ -335,7 +336,7 @@ size_t LZ5MT_compressCCtx(LZ5MT_CCtx * ctx, LZ5MT_RdWr_t * rdwr) void *p; pthread_join(w->pthread, &p); if (p) - return (size_t) p; + retval_of_thread = p; } /* clean up lists */ @@ -349,7 +350,7 @@ size_t LZ5MT_compressCCtx(LZ5MT_CCtx * ctx, LZ5MT_RdWr_t * rdwr) free(wl); } - return 0; + return (size_t)retval_of_thread; } /* returns current uncompressed data size */ diff --git a/C/zstdmt/lz5mt_decompress.c b/C/zstdmt/lz5mt_decompress.c index e2e8383f..e02c076f 100644 --- a/C/zstdmt/lz5mt_decompress.c +++ b/C/zstdmt/lz5mt_decompress.c @@ -485,6 +485,7 @@ size_t LZ5MT_decompressDCtx(LZ5MT_DCtx * ctx, LZ5MT_RdWr_t * rdwr) int t, rv; cwork_t *w = &ctx->cwork[0]; LZ5MT_Buffer *in = &w->in; + void *retval_of_thread = 0; if (!ctx) return ERROR(compressionParameter_unsupported); @@ -544,7 +545,7 @@ size_t LZ5MT_decompressDCtx(LZ5MT_DCtx * ctx, LZ5MT_RdWr_t * rdwr) void *p; pthread_join(w->pthread, &p); if (p) - return (size_t) p; + retval_of_thread = p; } okay: @@ -559,7 +560,7 @@ size_t LZ5MT_decompressDCtx(LZ5MT_DCtx * ctx, LZ5MT_RdWr_t * rdwr) free(wl); } - return 0; + return (size_t)retval_of_thread; } /* returns current uncompressed data size */ diff --git a/C/zstdmt/zstdmt_compress.c b/C/zstdmt/zstdmt_compress.c index 9294ab56..eaaf89af 100644 --- a/C/zstdmt/zstdmt_compress.c +++ b/C/zstdmt/zstdmt_compress.c @@ -328,7 +328,7 @@ static void *pt_compress(void *arg) size_t ZSTDMT_compressCCtx(ZSTDMT_CCtx * ctx, ZSTDMT_RdWr_t * rdwr) { int t; - void *rv = 0; + void *retval_of_thread = 0; if (!ctx) return ZSTDMT_ERROR(init_missing); @@ -358,7 +358,7 @@ size_t ZSTDMT_compressCCtx(ZSTDMT_CCtx * ctx, ZSTDMT_RdWr_t * rdwr) void *p; pthread_join(w->pthread, &p); if (p) - rv = p; + retval_of_thread = p; } /* clean up the free list */ @@ -373,7 +373,7 @@ size_t ZSTDMT_compressCCtx(ZSTDMT_CCtx * ctx, ZSTDMT_RdWr_t * rdwr) } /* on error, these two lists may have some entries */ - if (rv) { + if (retval_of_thread) { struct writelist *wl; struct list_head *entry; @@ -394,7 +394,7 @@ size_t ZSTDMT_compressCCtx(ZSTDMT_CCtx * ctx, ZSTDMT_RdWr_t * rdwr) } } - return (size_t) rv; + return (size_t)retval_of_thread; } /* returns current uncompressed data size */ diff --git a/C/zstdmt/zstdmt_decompress.c b/C/zstdmt/zstdmt_decompress.c index 4ce0be34..1c7af2ec 100644 --- a/C/zstdmt/zstdmt_decompress.c +++ b/C/zstdmt/zstdmt_decompress.c @@ -697,6 +697,7 @@ size_t ZSTDMT_decompressDCtx(ZSTDMT_DCtx * ctx, ZSTDMT_RdWr_t * rdwr) ZSTDMT_Buffer *in = &In; cwork_t *w; int t, rv, type = TYPE_UNKNOWN; + void *retval_of_thread = 0; if (!ctx) return ZSTDMT_ERROR(compressionParameter_unsupported); @@ -819,7 +820,7 @@ size_t ZSTDMT_decompressDCtx(ZSTDMT_DCtx * ctx, ZSTDMT_RdWr_t * rdwr) void *p; pthread_join(w->pthread, &p); if (p) - return (size_t) p; + retval_of_thread = p; } /* clean up pthread stuff */ @@ -838,7 +839,7 @@ size_t ZSTDMT_decompressDCtx(ZSTDMT_DCtx * ctx, ZSTDMT_RdWr_t * rdwr) free(wl); } - return 0; + return (size_t)retval_of_thread; } /* returns current uncompressed data size */