chore: suppress warnings on Windows #2089
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
This pull request includes various changes across multiple files to improve code consistency, fix bugs, and enhance compatibility with different platforms. The most important changes include adding support for wide character conversion on Windows, ensuring compatibility with different compilers, and improving type safety.
Platform Compatibility Improvements:
engine/cli/main.cc
: Added#include "utils/widechar_conv.h"
and updated directory path handling to useUtf8ToWstring
on Windows. [1] [2]engine/services/hardware_service.cc
: Added conditional compilation for environment variable handling to support_MSC_VER
(Microsoft Compiler). [1] [2] [3]engine/utils/cortex_utils.h
: UpdatedGetDateRFC1123
function to usegmtime_s
on Windows.engine/utils/engine_matcher_utils.h
: Updatedsscanf
tosscanf_s
on Windows for secure parsing. (F0b0cb26L37R37)Type Safety Enhancements:
engine/common/message.h
: Changed division result to be cast touint32_t
forcreated_at
.engine/utils/hardware/gguf/gguf_file_estimate.h
: Updated various calculations to usestatic_cast
for type safety. [1] [2] [3] [4] [5]Code Consistency:
engine/config/model_config.h
: Removed unnecessary line breaks.engine/utils/hardware/gguf/ggml.h
: Added 'f' suffix to floating-point literals for consistency. [1] [2]Bug Fixes:
engine/services/model_service.cc
: Removed unused exception variable in catch blocks. [1] [2]engine/utils/command_executor.h
: Ensured buffer size is cast toint
forfgets
.Other Changes:
engine/utils/hardware/cpu_info.h
: Cast CPU usage tofloat
.engine/utils/format_utils.h
: Removed unused exception variable in catch block.Fixes Issues
Self Checklist