diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 4ff2808b..0db1a3bf 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -304,7 +304,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install libcli11-dev libfmt-dev meson + sudo apt-get install libcli11-dev meson meson -v - name: Setup just uses: extractions/setup-just@v2 diff --git a/crates/capi/examples/.clang-tidy b/crates/capi/examples/.clang-tidy index 649035ef..07cc6e5e 100644 --- a/crates/capi/examples/.clang-tidy +++ b/crates/capi/examples/.clang-tidy @@ -6,7 +6,6 @@ Checks: "clang-diagnostic-*,clang-analyzer-*" WarningsAsErrors: "" HeaderFilterRegex: "" -AnalyzeTemporaryDtors: false FormatStyle: none User: user CheckOptions: diff --git a/crates/capi/examples/decrypt.cpp b/crates/capi/examples/decrypt.cpp index 4d14574a..d7c47afa 100644 --- a/crates/capi/examples/decrypt.cpp +++ b/crates/capi/examples/decrypt.cpp @@ -4,7 +4,6 @@ // An example of decrypting a file from the abcrypt encrypted data format. -#include #include #include @@ -13,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) { std::ifstream input_file(input_filename); if (!input_file) { - std::clog << fmt::format("Error: could not open {}: {}", input_filename, + std::clog << std::format("Error: could not open {}: {}", input_filename, std::strerror(errno)) << std::endl; return EXIT_FAILURE; @@ -68,18 +68,18 @@ int main(int argc, char *argv[]) { std::string error_message(buf.cbegin(), buf.cend()); switch (error_code) { case ABCRYPT_ERROR_CODE_INVALID_HEADER_MAC: - std::clog << fmt::format("Error: passphrase is incorrect: {}", + std::clog << std::format("Error: passphrase is incorrect: {}", error_message) << std::endl; break; case ABCRYPT_ERROR_CODE_INVALID_MAC: - std::clog << fmt::format("Error: the encrypted data is corrupted: {}", + std::clog << std::format("Error: the encrypted data is corrupted: {}", error_message) << std::endl; break; default: std::clog - << fmt::format( + << std::format( "Error: the header in the encrypted data is invalid: {}", error_message) << std::endl; @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { auto ofn = output_filename.value(); std::ofstream output_file(ofn); if (!output_file) { - std::clog << fmt::format("Error: could not open {}: {}", ofn, + std::clog << std::format("Error: could not open {}: {}", ofn, std::strerror(errno)) << std::endl; return EXIT_FAILURE; diff --git a/crates/capi/examples/encrypt.cpp b/crates/capi/examples/encrypt.cpp index 049dafdb..35e7be4e 100644 --- a/crates/capi/examples/encrypt.cpp +++ b/crates/capi/examples/encrypt.cpp @@ -4,7 +4,6 @@ // An example of encrypting a file to the abcrypt encrypted data format. -#include #include #include @@ -13,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) { std::ifstream input_file(input_filename); if (!input_file) { - std::clog << fmt::format("Error: could not open {}: {}", input_filename, + std::clog << std::format("Error: could not open {}: {}", input_filename, std::strerror(errno)) << std::endl; return EXIT_FAILURE; @@ -84,13 +84,13 @@ int main(int argc, char *argv[]) { std::vector buf(abcrypt_error_message_out_len(error_code)); abcrypt_error_message(error_code, buf.data(), buf.size()); std::string error_message(buf.cbegin(), buf.cend()); - std::clog << fmt::format("Error: {}", error_message) << std::endl; + std::clog << std::format("Error: {}", error_message) << std::endl; return EXIT_FAILURE; } std::ofstream output_file(output_filename); if (!output_file) { - std::clog << fmt::format("Error: could not open {}: {}", output_filename, + std::clog << std::format("Error: could not open {}: {}", output_filename, std::strerror(errno)) << std::endl; return EXIT_FAILURE; diff --git a/crates/capi/examples/info.cpp b/crates/capi/examples/info.cpp index 40cec857..5a3a7aef 100644 --- a/crates/capi/examples/info.cpp +++ b/crates/capi/examples/info.cpp @@ -4,13 +4,12 @@ // An example of reading the Argon2 parameters from a file. -#include - #include #include #include #include #include +#include #include #include #include @@ -33,7 +32,7 @@ int main(int argc, char *argv[]) { auto ifn = input_filename.value(); std::ifstream input_file(ifn); if (!input_file) { - std::clog << fmt::format("Error: could not open {}: {}", ifn, + std::clog << std::format("Error: could not open {}: {}", ifn, std::strerror(errno)) << std::endl; return EXIT_FAILURE; @@ -52,7 +51,7 @@ int main(int argc, char *argv[]) { std::vector buf(abcrypt_error_message_out_len(error_code)); abcrypt_error_message(error_code, buf.data(), buf.size()); std::string error_message(buf.cbegin(), buf.cend()); - std::clog << fmt::format( + std::clog << std::format( "Error: data is not a valid abcrypt encrypted file: {}", error_message) << std::endl; @@ -64,7 +63,7 @@ int main(int argc, char *argv[]) { auto parallelism = abcrypt_params_parallelism(params); abcrypt_params_free(params); - std::cout << fmt::format( + std::cout << std::format( "Parameters used: memoryCost = {}; timeCost = {}; " "parallelism = {};", memory_cost, time_cost, parallelism) diff --git a/crates/capi/examples/meson.build b/crates/capi/examples/meson.build index 9a86ee96..0bb99bdf 100644 --- a/crates/capi/examples/meson.build +++ b/crates/capi/examples/meson.build @@ -4,7 +4,7 @@ project('abcrypt_capi_examples', 'cpp', - default_options: ['warning_level=3', 'cpp_std=c++17'], + default_options: ['warning_level=3', 'cpp_std=c++20'], license: 'Apache-2.0 OR MIT', meson_version: '>=0.53.0', version: '0.3.2', @@ -16,7 +16,7 @@ cpp = meson.get_compiler('cpp') cpp.check_header('termios.h', required: true) cpp.check_header('unistd.h', required: true) -deps = [dependency('CLI11'), dependency('fmt')] +deps = dependency('CLI11') libdir = meson.current_source_dir() / '../../../target' if fs.exists(libdir / 'release')