From 73548b00d77a23ab70460d9f5599fb15b43a11f6 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Fri, 28 Jul 2023 08:10:08 +0100 Subject: [PATCH] [*] Refactor: added missing opt reference in member --- .../Aurora/Compression/CompressionInfo.hpp | 6 +++--- Source/Compression/AuCompression.hpp | 20 +++++++++---------- .../Compressors/BrotliCompressor.hpp | 16 +++++++-------- .../Compressors/ZSTDCompressor.hpp | 4 ++-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Include/Aurora/Compression/CompressionInfo.hpp b/Include/Aurora/Compression/CompressionInfo.hpp index 1a6fe8f1..c957f129 100644 --- a/Include/Aurora/Compression/CompressionInfo.hpp +++ b/Include/Aurora/Compression/CompressionInfo.hpp @@ -66,13 +66,13 @@ namespace Aurora::Compression * Brotli: 16 <= x <= 24 * recommended: */ - AuOptionalEx uWindowBits { }; + AuOptionalEx uOptWindowBits { }; /** * brotli: 0 <= x <= 11, * zstd: 0 <= x <= 9, */ - AuOptionalEx uQuality { 7 }; + AuOptionalEx uOptQuality { 7 }; /** * @brief Internal output buffer size. @@ -115,7 +115,7 @@ namespace Aurora::Compression /** * @brief Flag for headerless decompression streams */ - AuOptionalEx uWindowBits { }; + AuOptionalEx uOptWindowBits { }; AuUInt8 uThreads { 1 }; diff --git a/Source/Compression/AuCompression.hpp b/Source/Compression/AuCompression.hpp index 37166a49..ff08fdf3 100644 --- a/Source/Compression/AuCompression.hpp +++ b/Source/Compression/AuCompression.hpp @@ -16,7 +16,7 @@ namespace Aurora::Compression { out = 0; - if (!info.uWindowBits) + if (!info.uOptWindowBits) { if (info.alg == ECompressionType::eGZip) { @@ -33,27 +33,27 @@ namespace Aurora::Compression } } - if (info.uWindowBits.value() < 0) + if (info.uOptWindowBits.value() < 0) { return {}; } - if (info.uWindowBits.value() > 15) + if (info.uOptWindowBits.value() > 15) { return {}; } if (info.alg == ECompressionType::eGZip) { - out = info.uWindowBits.value() | 16; + out = info.uOptWindowBits.value() | 16; } else if (info.alg == ECompressionType::eDeflate) { - out = 0 - info.uWindowBits.value(); + out = 0 - info.uOptWindowBits.value(); } else { - out = info.uWindowBits.value(); + out = info.uOptWindowBits.value(); } return true; @@ -64,7 +64,7 @@ namespace Aurora::Compression { out = 0; - if (!info.uWindowBits) + if (!info.uOptWindowBits) { if (info.type == ECompressionType::eGZip) { @@ -83,15 +83,15 @@ namespace Aurora::Compression if (info.type == ECompressionType::eGZip) { - out = info.uWindowBits.value() | 16; + out = info.uOptWindowBits.value() | 16; } else if (info.type == ECompressionType::eDeflate) { - out = 0 - info.uWindowBits.value(); + out = 0 - info.uOptWindowBits.value(); } else { - out = info.uWindowBits.value(); + out = info.uOptWindowBits.value(); } return true; diff --git a/Source/Compression/Compressors/BrotliCompressor.hpp b/Source/Compression/Compressors/BrotliCompressor.hpp index 5f96e14b..d082afdf 100644 --- a/Source/Compression/Compressors/BrotliCompressor.hpp +++ b/Source/Compression/Compressors/BrotliCompressor.hpp @@ -58,12 +58,12 @@ namespace Aurora::Compression } } - if (meta.uQuality) + if (meta.uOptQuality) { - if (meta.uQuality.value() <= BROTLI_MAX_QUALITY && - meta.uQuality.value() >= BROTLI_MIN_QUALITY) + if (meta.uOptQuality.value() <= BROTLI_MAX_QUALITY && + meta.uOptQuality.value() >= BROTLI_MIN_QUALITY) { - if (!BrotliEncoderSetParameter(this->pState, BrotliEncoderParameter::BROTLI_PARAM_QUALITY, meta.uQuality.value())) + if (!BrotliEncoderSetParameter(this->pState, BrotliEncoderParameter::BROTLI_PARAM_QUALITY, meta.uOptQuality.value())) { SysPushErrorArg("Compressor couldn't set quality"); return false; @@ -75,12 +75,12 @@ namespace Aurora::Compression } } - if (meta.uWindowBits) + if (meta.uOptWindowBits) { - if (meta.uWindowBits.value() <= BROTLI_MAX_INPUT_BLOCK_BITS && - meta.uWindowBits.value() >= BROTLI_MIN_INPUT_BLOCK_BITS) + if (meta.uOptWindowBits.value() <= BROTLI_MAX_INPUT_BLOCK_BITS && + meta.uOptWindowBits.value() >= BROTLI_MIN_INPUT_BLOCK_BITS) { - if (!BrotliEncoderSetParameter(this->pState, BrotliEncoderParameter::BROTLI_PARAM_LGWIN, meta.uWindowBits)) + if (!BrotliEncoderSetParameter(this->pState, BrotliEncoderParameter::BROTLI_PARAM_LGWIN, meta.uOptWindowBits)) { SysPushErrorArg("Compressor couldn't set window bits"); return false; diff --git a/Source/Compression/Compressors/ZSTDCompressor.hpp b/Source/Compression/Compressors/ZSTDCompressor.hpp index edd282ed..97a66089 100644 --- a/Source/Compression/Compressors/ZSTDCompressor.hpp +++ b/Source/Compression/Compressors/ZSTDCompressor.hpp @@ -58,9 +58,9 @@ namespace Aurora::Compression return false; } - if (meta.uQuality) + if (meta.uOptQuality) { - uRet = ZSTD_CCtx_setParameter(this->cctx_, ZSTD_c_strategy, meta.uQuality.value()); + uRet = ZSTD_CCtx_setParameter(this->cctx_, ZSTD_c_strategy, meta.uOptQuality.value()); if (ZSTD_isError(uRet)) { SysPushErrorArg("ZSTD_c_strategy");