aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2021-04-03 10:46:57 -0400
committerJack Lloyd <[email protected]>2021-04-03 11:53:27 -0400
commit4864c427479f93d4716682d0fe8e38dca21431cf (patch)
tree040c73be57f461dcb350553ef691f5c79ebd0f43 /src/cli
parentaa7958880bee2091a8a71bf9e1f6e6efb34581e3 (diff)
Remove use of explicit new from compression APIs
Diffstat (limited to 'src/cli')
-rw-r--r--src/cli/compress.cpp9
-rw-r--r--src/cli/entropy.cpp2
-rw-r--r--src/cli/speed.cpp2
3 files changed, 4 insertions, 9 deletions
diff --git a/src/cli/compress.cpp b/src/cli/compress.cpp
index e62acd763..b52e15608 100644
--- a/src/cli/compress.cpp
+++ b/src/cli/compress.cpp
@@ -55,10 +55,7 @@ class Compress final : public Command
const size_t buf_size = get_arg_sz("buf-size");
const size_t comp_level = get_arg_sz("level");
- std::unique_ptr<Botan::Compression_Algorithm> compress;
-
- compress.reset(Botan::make_compressor(comp_type));
-
+ auto compress = Botan::Compression_Algorithm::create(comp_type);
if(!compress)
{
throw CLI_Error_Unsupported("Compression", comp_type);
@@ -146,9 +143,7 @@ class Decompress final : public Command
throw CLI_IO_Error("reading", in_file);
}
- std::unique_ptr<Botan::Decompression_Algorithm> decompress;
-
- decompress.reset(Botan::make_decompressor(suffix));
+ auto decompress = Botan::Decompression_Algorithm::create(suffix);
if(!decompress)
{
diff --git a/src/cli/entropy.cpp b/src/cli/entropy.cpp
index 0404afb99..472765704 100644
--- a/src/cli/entropy.cpp
+++ b/src/cli/entropy.cpp
@@ -63,7 +63,7 @@ class Entropy final : public Command
#if defined(BOTAN_HAS_COMPRESSION)
if(!sample.empty())
{
- std::unique_ptr<Botan::Compression_Algorithm> comp(Botan::make_compressor("zlib"));
+ auto comp = Botan::Compression_Algorithm::create("zlib");
if(comp)
{
try
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp
index 4a22fb57f..6bd0405ef 100644
--- a/src/cli/speed.cpp
+++ b/src/cli/speed.cpp
@@ -1085,7 +1085,7 @@ class Speed final : public Command
size_t compressed_size = 0;
#if defined(BOTAN_HAS_ZLIB)
- std::unique_ptr<Botan::Compression_Algorithm> comp(Botan::make_compressor("zlib"));
+ auto comp = Botan::Compression_Algorithm::create("zlib");
if(comp)
{