src: rework mem_clear()

This commit is contained in:
Markus F.X.J. Oberhumer
2023-06-09 18:20:06 +02:00
parent 19e84fea62
commit 75e87a58da
15 changed files with 54 additions and 56 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ int upx_compress(const upx_bytep src, unsigned src_len, upx_bytep dst, unsigned
if (!cresult)
cresult = &cresult_buffer;
memset(cresult, 0, sizeof(*cresult));
cresult->reset();
#if 1
// debugging aid
cresult->debug.method = method;
+1 -1
View File
@@ -433,7 +433,7 @@ int upx_lzma_decompress(const upx_bytep src, unsigned src_len, upx_bytep dst, un
COMPILE_TIME_ASSERT(LZMA_LIT_SIZE == 768)
CLzmaDecoderState s;
memset(&s, 0, sizeof(s));
mem_clear(&s);
SizeT src_out = 0, dst_out = 0;
int r = UPX_E_ERROR;
int rh;
+1 -2
View File
@@ -31,8 +31,7 @@
#include <zlib/deflate.h>
void zlib_compress_config_t::reset() noexcept {
mem_clear(this, sizeof(*this));
mem_clear(this);
mem_level.reset();
window_bits.reset();
strategy.reset();
+1 -1
View File
@@ -26,7 +26,7 @@
#include "../conf.h"
void zstd_compress_config_t::reset() noexcept { mem_clear(this, sizeof(*this)); }
void zstd_compress_config_t::reset() noexcept { mem_clear(this); }
#if WITH_ZSTD
#include "compress.h"