[nfde] Fix compiler warnings on Gtk build
All checks were successful
Build / build (push) Successful in 2m32s
All checks were successful
Build / build (push) Successful in 2m32s
This commit is contained in:
parent
9244b735e8
commit
eb46aeebf4
4
deps/nfde/CMakeLists.txt
vendored
4
deps/nfde/CMakeLists.txt
vendored
@ -12,10 +12,6 @@ endif()
|
|||||||
option(NFD_BUILD_TESTS "Build tests for nfd" ${nfd_ROOT_PROJECT})
|
option(NFD_BUILD_TESTS "Build tests for nfd" ${nfd_ROOT_PROJECT})
|
||||||
option(NFD_INSTALL "Generate install target for nfd" ${nfd_ROOT_PROJECT})
|
option(NFD_INSTALL "Generate install target for nfd" ${nfd_ROOT_PROJECT})
|
||||||
|
|
||||||
if(NOT MSVC)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(nfd_PLATFORM Undefined)
|
set(nfd_PLATFORM Undefined)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(nfd_PLATFORM PLATFORM_WIN32)
|
set(nfd_PLATFORM PLATFORM_WIN32)
|
||||||
|
18
deps/nfde/src/nfd_gtk.cpp
vendored
18
deps/nfde/src/nfd_gtk.cpp
vendored
@ -124,14 +124,14 @@ void AddFiltersToDialog(GtkFileChooser* chooser,
|
|||||||
|
|
||||||
// +1 for the trailing '\0'
|
// +1 for the trailing '\0'
|
||||||
nfdnchar_t* extnBuf = NFDi_Malloc<nfdnchar_t>(sizeof(nfdnchar_t) *
|
nfdnchar_t* extnBuf = NFDi_Malloc<nfdnchar_t>(sizeof(nfdnchar_t) *
|
||||||
(p_spec - p_extensionStart + 3));
|
static_cast<size_t>(p_spec - p_extensionStart + 3));
|
||||||
nfdnchar_t* p_extnBufEnd = extnBuf;
|
nfdnchar_t* p_extnBufEnd = extnBuf;
|
||||||
*p_extnBufEnd++ = '*';
|
*p_extnBufEnd++ = '*';
|
||||||
*p_extnBufEnd++ = '.';
|
*p_extnBufEnd++ = '.';
|
||||||
p_extnBufEnd = copy(p_extensionStart, p_spec, p_extnBufEnd);
|
p_extnBufEnd = copy(p_extensionStart, p_spec, p_extnBufEnd);
|
||||||
*p_extnBufEnd++ = '\0';
|
*p_extnBufEnd++ = '\0';
|
||||||
assert((size_t)(p_extnBufEnd - extnBuf) ==
|
assert(static_cast<size_t>(p_extnBufEnd - extnBuf) ==
|
||||||
sizeof(nfdnchar_t) * (p_spec - p_extensionStart + 3));
|
sizeof(nfdnchar_t) * static_cast<size_t>(p_spec - p_extensionStart + 3));
|
||||||
gtk_file_filter_add_pattern(filter, extnBuf);
|
gtk_file_filter_add_pattern(filter, extnBuf);
|
||||||
NFDi_Free(extnBuf);
|
NFDi_Free(extnBuf);
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ void AddFiltersToDialog(GtkFileChooser* chooser,
|
|||||||
}
|
}
|
||||||
*p_nameBuf++ = ')';
|
*p_nameBuf++ = ')';
|
||||||
*p_nameBuf++ = '\0';
|
*p_nameBuf++ = '\0';
|
||||||
assert((size_t)(p_nameBuf - nameBuf) == sizeof(nfdnchar_t) * nameSize);
|
assert(static_cast<size_t>(p_nameBuf - nameBuf) == sizeof(nfdnchar_t) * nameSize);
|
||||||
|
|
||||||
// add to the filter
|
// add to the filter
|
||||||
gtk_file_filter_set_name(filter, nameBuf);
|
gtk_file_filter_set_name(filter, nameBuf);
|
||||||
@ -224,14 +224,14 @@ Pair_GtkFileFilter_FileExtension* AddFiltersToDialogWithMap(GtkFileChooser* choo
|
|||||||
|
|
||||||
// +1 for the trailing '\0'
|
// +1 for the trailing '\0'
|
||||||
nfdnchar_t* extnBuf = NFDi_Malloc<nfdnchar_t>(sizeof(nfdnchar_t) *
|
nfdnchar_t* extnBuf = NFDi_Malloc<nfdnchar_t>(sizeof(nfdnchar_t) *
|
||||||
(p_spec - p_extensionStart + 3));
|
static_cast<size_t>(p_spec - p_extensionStart + 3));
|
||||||
nfdnchar_t* p_extnBufEnd = extnBuf;
|
nfdnchar_t* p_extnBufEnd = extnBuf;
|
||||||
*p_extnBufEnd++ = '*';
|
*p_extnBufEnd++ = '*';
|
||||||
*p_extnBufEnd++ = '.';
|
*p_extnBufEnd++ = '.';
|
||||||
p_extnBufEnd = copy(p_extensionStart, p_spec, p_extnBufEnd);
|
p_extnBufEnd = copy(p_extensionStart, p_spec, p_extnBufEnd);
|
||||||
*p_extnBufEnd++ = '\0';
|
*p_extnBufEnd++ = '\0';
|
||||||
assert((size_t)(p_extnBufEnd - extnBuf) ==
|
assert(static_cast<size_t>(p_extnBufEnd - extnBuf) ==
|
||||||
sizeof(nfdnchar_t) * (p_spec - p_extensionStart + 3));
|
sizeof(nfdnchar_t) * static_cast<size_t>(p_spec - p_extensionStart + 3));
|
||||||
gtk_file_filter_add_pattern(filter, extnBuf);
|
gtk_file_filter_add_pattern(filter, extnBuf);
|
||||||
NFDi_Free(extnBuf);
|
NFDi_Free(extnBuf);
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ Pair_GtkFileFilter_FileExtension* AddFiltersToDialogWithMap(GtkFileChooser* choo
|
|||||||
}
|
}
|
||||||
*p_nameBuf++ = ')';
|
*p_nameBuf++ = ')';
|
||||||
*p_nameBuf++ = '\0';
|
*p_nameBuf++ = '\0';
|
||||||
assert((size_t)(p_nameBuf - nameBuf) == sizeof(nfdnchar_t) * nameSize);
|
assert(static_cast<size_t>(p_nameBuf - nameBuf) == sizeof(nfdnchar_t) * nameSize);
|
||||||
|
|
||||||
// add to the filter
|
// add to the filter
|
||||||
gtk_file_filter_set_name(filter, nameBuf);
|
gtk_file_filter_set_name(filter, nameBuf);
|
||||||
@ -338,7 +338,7 @@ void FileActivatedSignalHandler(GtkButton* saveButton, void* userdata) {
|
|||||||
// memory for appended string (including '.' and
|
// memory for appended string (including '.' and
|
||||||
// trailing '\0')
|
// trailing '\0')
|
||||||
char* appendedFileName = NFDi_Malloc<char>(
|
char* appendedFileName = NFDi_Malloc<char>(
|
||||||
sizeof(char) * ((p_period - currentFileName) +
|
sizeof(char) * static_cast<size_t>((p_period - currentFileName) +
|
||||||
(filterMap->extensionEnd - filterMap->extensionBegin) + 2));
|
(filterMap->extensionEnd - filterMap->extensionBegin) + 2));
|
||||||
char* p_fileName = copy(currentFileName, p_period, appendedFileName);
|
char* p_fileName = copy(currentFileName, p_period, appendedFileName);
|
||||||
*p_fileName++ = '.';
|
*p_fileName++ = '.';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user