Skip to content

Commit f5c5e25

Browse files
committed
update ovbase/ovutil
1 parent 143179e commit f5c5e25

File tree

6 files changed

+16
-17
lines changed

6 files changed

+16
-17
lines changed

build.bash

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ CUR_DIR="${PWD}"
55
cd "$(dirname "${BASH_SOURCE:-$0}")"
66

77
mkdir -p build/tools
8-
cd build/tools
8+
. src/c/3rd/ovbase/setup-llvm-mingw.bash --dir $PWD/build/tools
99

10-
. ../../src/c/3rd/ovbase/setup-llvm-mingw.bash --dir $PWD
11-
12-
cd ..
10+
cd build
1311

1412
REBUILD=0
1513
SKIP_TESTS=0

src/c/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ add_custom_target(copy_related_files
9393

9494
set(is_clang "$<C_COMPILER_ID:Clang>")
9595
set(v16_or_later "$<VERSION_GREATER_EQUAL:$<C_COMPILER_VERSION>,16>")
96-
96+
set(v18_or_later "$<VERSION_GREATER_EQUAL:$<C_COMPILER_VERSION>,18>")
9797
add_library(gcmzdrops_intf INTERFACE)
9898
target_include_directories(gcmzdrops_intf INTERFACE
9999
"${CMAKE_CURRENT_BINARY_DIR}" # for version.h
@@ -118,6 +118,7 @@ target_compile_options(gcmzdrops_intf INTERFACE
118118
-Wno-declaration-after-statement
119119
-Wno-padded
120120
$<$<AND:${is_clang},${v16_or_later}>:-Wno-unsafe-buffer-usage>
121+
$<$<AND:${is_clang},${v18_or_later}>:-Wno-switch-default>
121122
-ffunction-sections
122123
-fdata-sections
123124
$<$<CONFIG:Debug>:-O0>

src/c/gcmzfuncs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ error gcmz_confirm(struct wstr const *const caption, bool *const result) {
10041004
buf_size = 1024,
10051005
};
10061006
wchar_t buf[buf_size];
1007-
mo_sprintf_wchar(buf, buf_size, NULL, "%1$s %2 $s", "GCMZDrops", VERSION);
1007+
mo_snprintf_wchar(buf, buf_size, NULL, "%1$s %2 $s", "GCMZDrops", VERSION);
10081008
int r = MessageBoxW(h, caption->ptr, buf, MB_ICONQUESTION | MB_OKCANCEL);
10091009
if (!r) {
10101010
return errhr(HRESULT_FROM_WIN32(GetLastError()));

src/c/gui.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ error gui_init(HWND const window) {
132132

133133
int save_mode_height = padding;
134134
{
135-
mo_sprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Processing mode:"));
135+
mo_snprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Processing mode:"));
136136
HWND h = CreateWindowExW(0,
137137
L"STATIC",
138138
buf,
@@ -161,11 +161,11 @@ error gui_init(HWND const window) {
161161
(HMENU)1,
162162
hinst,
163163
NULL);
164-
mo_sprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Auto detect"));
164+
mo_snprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Auto detect"));
165165
SendMessageW(h, CB_ADDSTRING, 0, (LPARAM)buf);
166-
mo_sprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Copy"));
166+
mo_snprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Copy"));
167167
SendMessageW(h, CB_ADDSTRING, 0, (LPARAM)buf);
168-
mo_sprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Direct read"));
168+
mo_snprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Direct read"));
169169
SendMessageW(h, CB_ADDSTRING, 0, (LPARAM)buf);
170170
SendMessageW(h, WM_SETFONT, (WPARAM)font, 0);
171171
save_mode_height += control_height;
@@ -175,7 +175,7 @@ error gui_init(HWND const window) {
175175
int save_dir_height = padding;
176176
{
177177
int const button_width = font_height * 2;
178-
mo_sprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Save to:"));
178+
mo_snprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Save to:"));
179179
HWND h = CreateWindowExW(0,
180180
L"STATIC",
181181
buf,
@@ -228,7 +228,7 @@ error gui_init(HWND const window) {
228228
enum {
229229
button_width = 128,
230230
};
231-
mo_sprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Revert to initial"));
231+
mo_snprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Revert to initial"));
232232
HWND h = CreateWindowExW(0,
233233
L"BUTTON",
234234
buf,
@@ -243,7 +243,7 @@ error gui_init(HWND const window) {
243243
NULL);
244244
SendMessageW(h, WM_SETFONT, (WPARAM)font, 0);
245245
g_restore_initial = h;
246-
mo_sprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Revert to default"));
246+
mo_snprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Revert to default"));
247247
h = CreateWindowExW(0,
248248
L"BUTTON",
249249
buf,
@@ -258,7 +258,7 @@ error gui_init(HWND const window) {
258258
NULL);
259259
SendMessageW(h, WM_SETFONT, (WPARAM)font, 0);
260260
g_restore_default = h;
261-
mo_sprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Save as default"));
261+
mo_snprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Save as default"));
262262
h = CreateWindowExW(0,
263263
L"BUTTON",
264264
buf,
@@ -393,7 +393,7 @@ NODISCARD static error click_select_folder_button(HWND const window) {
393393
buf_size = 1024,
394394
};
395395
wchar_t buf[buf_size];
396-
mo_sprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Choose Save Directory"));
396+
mo_snprintf_wchar(buf, buf_size, NULL, "%1$s", gettext("Choose Save Directory"));
397397
err = select_directory(window, &wstr_unmanaged(buf), &dir, &ret);
398398
if (efailed(err)) {
399399
err = ethru(err);

0 commit comments

Comments
 (0)