mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 12:09:19 +02:00
refactor(sonar): use std::array for local fixed-size arrays (cpp:S5945)
Arrays that are class members or part of headers are left unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -29,9 +29,9 @@ void screenshot_manager::screenshot_save_thread( char *img, int w, int h )
|
||||
stride = -w * 3;
|
||||
}
|
||||
|
||||
char datetime[64];
|
||||
std::array<char, 64> datetime{};
|
||||
std::tm const tm_info = local_tm(std::time(nullptr));
|
||||
strftime(datetime, 64, "%Y-%m-%d_%H-%M-%S", &tm_info);
|
||||
strftime(datetime.data(), datetime.size(), "%Y-%m-%d_%H-%M-%S", &tm_info);
|
||||
|
||||
uint64_t perf;
|
||||
#ifdef _WIN32
|
||||
@@ -42,7 +42,7 @@ void screenshot_manager::screenshot_save_thread( char *img, int w, int h )
|
||||
perf = ts.tv_nsec;
|
||||
#endif
|
||||
|
||||
std::string filename = Global.screenshot_dir + "/" + std::string(datetime) +
|
||||
std::string filename = Global.screenshot_dir + "/" + std::string(datetime.data()) +
|
||||
"_" + std::to_string(perf) + ".png";
|
||||
|
||||
if (png_image_write_to_file(&png, filename.c_str(), 0, img, stride, nullptr) == 1)
|
||||
|
||||
Reference in New Issue
Block a user