From ef5835687e72f4a7f9fcfea26a3ca0106e755dea Mon Sep 17 00:00:00 2001 From: TaurusXin Date: Tue, 13 Feb 2024 20:58:35 +0800 Subject: [PATCH] chore: optimized code (#11) * chore: use cout for printing * chore: removed CMake optimize flags --- CMakeLists.txt | 2 +- ncmcrypt.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a22d862..066b033 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ target_include_directories(ncmdump PRIVATE taglib/taglib/mpeg/id3v2) if(WIN32) if(CMAKE_COMPILER_IS_GNUCXX) - target_link_options(ncmdump PRIVATE -O2 -municode) + target_link_options(ncmdump PRIVATE -municode) endif() endif() diff --git a/ncmcrypt.cpp b/ncmcrypt.cpp index 0f629c0..0381c43 100644 --- a/ncmcrypt.cpp +++ b/ncmcrypt.cpp @@ -302,7 +302,7 @@ NeteaseCrypt::NeteaseCrypt(std::filesystem::path const& path) { read(reinterpret_cast(&n), sizeof(n)); if (n <= 0) { - printf("[Warn] `%s` missing metadata infomation can't fix some infomation!\n", path.c_str()); + std::cout << "[Warn] " << path.string() << " missing metadata infomation can't fix some infomation!" << std::endl; mMetaData = NULL; } else { @@ -345,6 +345,6 @@ NeteaseCrypt::NeteaseCrypt(std::filesystem::path const& path) { mImageData = std::string(imageData, n); } else { - printf("[Warn] `%s` missing album can't fix album image!\n", path.c_str()); + std::cout << "[Warn] " << path.string() << " missing album can't fix album image!" << std::endl; } }