diff options
author | daan <daanl@outlook.com> | 2020-09-05 12:04:25 -0700 |
---|---|---|
committer | daan <daanl@outlook.com> | 2020-09-05 12:04:25 -0700 |
commit | 9d82b15d8759b9a6d97db2e9d3251489adae26ce (patch) | |
tree | 1b627ed63f7f671d4b6843c57ebd48263a91d269 | |
parent | 44ba0d254b21c59df724a73a3db098082319e60f (diff) |
fix warnings on vs2017
-rw-r--r-- | ide/vs2017/mimalloc.vcxproj | 8 | ||||
-rw-r--r-- | ide/vs2019/mimalloc-test-stress.vcxproj | 4 | ||||
-rw-r--r-- | src/heap.c | 8 | ||||
-rw-r--r-- | src/stats.c | 3 |
4 files changed, 13 insertions, 10 deletions
diff --git a/ide/vs2017/mimalloc.vcxproj b/ide/vs2017/mimalloc.vcxproj index 1e39f91..1ff1af9 100644 --- a/ide/vs2017/mimalloc.vcxproj +++ b/ide/vs2017/mimalloc.vcxproj @@ -110,7 +110,7 @@ <ConformanceMode>true</ConformanceMode> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MI_DEBUG=3;%(PreprocessorDefinitions);</PreprocessorDefinitions> - <CompileAs>CompileAsCpp</CompileAs> + <CompileAs>CompileAsC</CompileAs> <SupportJustMyCode>false</SupportJustMyCode> <LanguageStandard>stdcpp17</LanguageStandard> </ClCompile> @@ -129,7 +129,7 @@ <ConformanceMode>true</ConformanceMode> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;MI_DEBUG=3;%(PreprocessorDefinitions);</PreprocessorDefinitions> - <CompileAs>CompileAsCpp</CompileAs> + <CompileAs>CompileAsC</CompileAs> <SupportJustMyCode>false</SupportJustMyCode> <LanguageStandard>stdcpp17</LanguageStandard> </ClCompile> @@ -161,7 +161,7 @@ <WholeProgramOptimization>false</WholeProgramOptimization> <BufferSecurityCheck>false</BufferSecurityCheck> <InlineFunctionExpansion>Default</InlineFunctionExpansion> - <CompileAs>CompileAsCpp</CompileAs> + <CompileAs>CompileAsC</CompileAs> <IntrinsicFunctions>true</IntrinsicFunctions> </ClCompile> <Link> @@ -188,7 +188,7 @@ <WholeProgramOptimization>false</WholeProgramOptimization> <BufferSecurityCheck>false</BufferSecurityCheck> <InlineFunctionExpansion>Default</InlineFunctionExpansion> - <CompileAs>CompileAsCpp</CompileAs> + <CompileAs>CompileAsC</CompileAs> <IntrinsicFunctions>true</IntrinsicFunctions> </ClCompile> <Link> diff --git a/ide/vs2019/mimalloc-test-stress.vcxproj b/ide/vs2019/mimalloc-test-stress.vcxproj index ef7ab35..afbb666 100644 --- a/ide/vs2019/mimalloc-test-stress.vcxproj +++ b/ide/vs2019/mimalloc-test-stress.vcxproj @@ -149,8 +149,8 @@ </ClCompile> </ItemGroup> <ItemGroup> - <ProjectReference Include="mimalloc.vcxproj"> - <Project>{abb5eae7-b3e6-432e-b636-333449892ea6}</Project> + <ProjectReference Include="mimalloc-override.vcxproj"> + <Project>{abb5eae7-b3e6-432e-b636-333449892ea7}</Project> </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> @@ -11,6 +11,9 @@ terms of the MIT license. A copy of the license can be found in the file #include <string.h> // memset, memcpy +#if defined(_MSC_VER) && (_MSC_VER < 1920) +#pragma warning(disable:4204) // non-constant aggregate initializer +#endif /* ----------------------------------------------------------- Helpers @@ -550,9 +553,6 @@ static bool mi_heap_area_visitor(const mi_heap_t* heap, const mi_heap_area_ex_t* // Visit all blocks in a heap bool mi_heap_visit_blocks(const mi_heap_t* heap, bool visit_blocks, mi_block_visit_fun* visitor, void* arg) { - mi_visit_blocks_args_t args = { 0 }; - args.visit_blocks = visit_blocks; - args.visitor = visitor; - args.arg = arg; + mi_visit_blocks_args_t args = { visit_blocks, visitor, arg }; return mi_heap_visit_areas(heap, &mi_heap_area_visitor, &args); } diff --git a/src/stats.c b/src/stats.c index b484efb..2fe914c 100644 --- a/src/stats.c +++ b/src/stats.c @@ -11,6 +11,9 @@ terms of the MIT license. A copy of the license can be found in the file #include <stdio.h> // fputs, stderr #include <string.h> // memset +#if defined(_MSC_VER) && (_MSC_VER < 1920) +#pragma warning(disable:4204) // non-constant aggregate initializer +#endif /* ----------------------------------------------------------- Statistics operations |