diff --git a/core/zip/inc/Compression.h b/core/zip/inc/Compression.h index 2467357f3e1ed..1f4c26b9c00fd 100644 --- a/core/zip/inc/Compression.h +++ b/core/zip/inc/Compression.h @@ -110,7 +110,7 @@ struct RCompressionSetting { }; // clang-format off -enum R__DEPRECATED(6, 34, "Use RCompressionSetting instead") ECompressionAlgorithm { +enum R__DEPRECATED(6, 34, "Use RCompressionSetting::EAlgorithm instead") ECompressionAlgorithm { kUseGlobalCompressionSetting = static_cast(RCompressionSetting::EAlgorithm::kUseGlobal), kUseGlobalSetting = static_cast(RCompressionSetting::EAlgorithm::kUseGlobal), kZLIB = static_cast(RCompressionSetting::EAlgorithm::kZLIB), diff --git a/core/zip/src/Compression.cxx b/core/zip/src/Compression.cxx index 1ec32f85bc424..ac7482b226f6f 100644 --- a/core/zip/src/Compression.cxx +++ b/core/zip/src/Compression.cxx @@ -15,8 +15,7 @@ namespace ROOT { //////////////////////////////////////////////////////////////////////////////// - int CompressionSettings(RCompressionSetting::EAlgorithm::EValues algorithm, - int compressionLevel) + int CompressionSettings(RCompressionSetting::EAlgorithm::EValues algorithm, int compressionLevel) { if (compressionLevel < 0) compressionLevel = 0; if (compressionLevel > 99) compressionLevel = 99; @@ -25,24 +24,27 @@ namespace ROOT { return algo * 100 + compressionLevel; } - int CompressionSettings(ROOT::ECompressionAlgorithm algorithm, - int compressionLevel) +// Avoid spitting warnings for the use of ECompressionAlgorithm, as this function is itself deprecated +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + int CompressionSettings(ROOT::ECompressionAlgorithm algorithm, int compressionLevel) { if (compressionLevel < 0) compressionLevel = 0; if (compressionLevel > 99) compressionLevel = 99; int algo = algorithm; - if (algorithm >= ROOT::ECompressionAlgorithm::kUndefinedCompressionAlgorithm) algo = 0; + if (algo >= ROOT::RCompressionSetting::EAlgorithm::kUndefined) algo = 0; return algo * 100 + compressionLevel; } +#pragma GCC diagnostic pop std::string RCompressionSetting::AlgorithmToString(RCompressionSetting::EAlgorithm::EValues algorithm) { switch (algorithm) { - case EAlgorithm::EValues::kZLIB: return "zlib"; break; - case EAlgorithm::EValues::kLZMA: return "LZMA"; break; - case EAlgorithm::EValues::kOldCompressionAlgo: return "Old compression algorithm"; break; - case EAlgorithm::EValues::kLZ4: return "lz4"; break; - case EAlgorithm::EValues::kZSTD: return "zstd"; break; + case EAlgorithm::EValues::kZLIB: return "zlib"; + case EAlgorithm::EValues::kLZMA: return "LZMA"; + case EAlgorithm::EValues::kOldCompressionAlgo: return "Old compression algorithm"; + case EAlgorithm::EValues::kLZ4: return "lz4"; + case EAlgorithm::EValues::kZSTD: return "zstd"; default: return "Undefined compression algorithm"; } }