From 5a88b0c2b95033f7eee826b27c48d399d544d814 Mon Sep 17 00:00:00 2001 From: Chlumsky Date: Sat, 28 Sep 2024 13:12:20 +0200 Subject: [PATCH] Minor warning fixes --- core/rasterization.cpp | 2 +- core/save-bmp.cpp | 2 ++ core/save-tiff.cpp | 2 ++ core/shape-description.cpp | 3 +++ ext/import-svg.cpp | 5 +++++ ext/save-png.cpp | 3 +++ main.cpp | 5 +++++ 7 files changed, 21 insertions(+), 1 deletion(-) diff --git a/core/rasterization.cpp b/core/rasterization.cpp index 9aa695a..8ceec77 100644 --- a/core/rasterization.cpp +++ b/core/rasterization.cpp @@ -33,7 +33,7 @@ void distanceSignCorrection(const BitmapRef &sdf, const Shape &shape, template static void multiDistanceSignCorrection(const BitmapRef &sdf, const Shape &shape, const Projection &projection, FillRule fillRule) { int w = sdf.width, h = sdf.height; - if (!(w*h)) + if (!(w && h)) return; Scanline scanline; bool ambiguous = false; diff --git a/core/save-bmp.cpp b/core/save-bmp.cpp index bf8e8e4..d71a2a6 100644 --- a/core/save-bmp.cpp +++ b/core/save-bmp.cpp @@ -1,5 +1,7 @@ +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif #include "save-bmp.h" diff --git a/core/save-tiff.cpp b/core/save-tiff.cpp index 62c379c..2c400d5 100644 --- a/core/save-tiff.cpp +++ b/core/save-tiff.cpp @@ -1,5 +1,7 @@ +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif #include "save-tiff.h" diff --git a/core/shape-description.cpp b/core/shape-description.cpp index c2664d5..639ffa1 100644 --- a/core/shape-description.cpp +++ b/core/shape-description.cpp @@ -1,5 +1,8 @@ +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif + #include "shape-description.h" #include diff --git a/ext/import-svg.cpp b/ext/import-svg.cpp index 6a696ff..85a7350 100644 --- a/ext/import-svg.cpp +++ b/ext/import-svg.cpp @@ -1,6 +1,11 @@ +#ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES +#endif +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif + #include "import-svg.h" #ifndef MSDFGEN_DISABLE_SVG diff --git a/ext/save-png.cpp b/ext/save-png.cpp index cfbb1b7..976cb96 100644 --- a/ext/save-png.cpp +++ b/ext/save-png.cpp @@ -1,5 +1,8 @@ +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif + #include "save-png.h" #include diff --git a/main.cpp b/main.cpp index 6dc20d0..360a246 100644 --- a/main.cpp +++ b/main.cpp @@ -8,8 +8,13 @@ #ifdef MSDFGEN_STANDALONE +#ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES +#endif +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif + #include #include #include