Browse Source

Minor warning fixes

Chlumsky 10 months ago
parent
commit
5a88b0c2b9
7 changed files with 21 additions and 1 deletions
  1. 1 1
      core/rasterization.cpp
  2. 2 0
      core/save-bmp.cpp
  3. 2 0
      core/save-tiff.cpp
  4. 3 0
      core/shape-description.cpp
  5. 5 0
      ext/import-svg.cpp
  6. 3 0
      ext/save-png.cpp
  7. 5 0
      main.cpp

+ 1 - 1
core/rasterization.cpp

@@ -33,7 +33,7 @@ void distanceSignCorrection(const BitmapRef<float, 1> &sdf, const Shape &shape,
 template <int N>
 template <int N>
 static void multiDistanceSignCorrection(const BitmapRef<float, N> &sdf, const Shape &shape, const Projection &projection, FillRule fillRule) {
 static void multiDistanceSignCorrection(const BitmapRef<float, N> &sdf, const Shape &shape, const Projection &projection, FillRule fillRule) {
     int w = sdf.width, h = sdf.height;
     int w = sdf.width, h = sdf.height;
-    if (!(w*h))
+    if (!(w && h))
         return;
         return;
     Scanline scanline;
     Scanline scanline;
     bool ambiguous = false;
     bool ambiguous = false;

+ 2 - 0
core/save-bmp.cpp

@@ -1,5 +1,7 @@
 
 
+#ifndef _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
+#endif
 
 
 #include "save-bmp.h"
 #include "save-bmp.h"
 
 

+ 2 - 0
core/save-tiff.cpp

@@ -1,5 +1,7 @@
 
 
+#ifndef _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
+#endif
 
 
 #include "save-tiff.h"
 #include "save-tiff.h"
 
 

+ 3 - 0
core/shape-description.cpp

@@ -1,5 +1,8 @@
 
 
+#ifndef _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
+#endif
+
 #include "shape-description.h"
 #include "shape-description.h"
 
 
 #include <cstdlib>
 #include <cstdlib>

+ 5 - 0
ext/import-svg.cpp

@@ -1,6 +1,11 @@
 
 
+#ifndef _USE_MATH_DEFINES
 #define _USE_MATH_DEFINES
 #define _USE_MATH_DEFINES
+#endif
+#ifndef _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
+#endif
+
 #include "import-svg.h"
 #include "import-svg.h"
 
 
 #ifndef MSDFGEN_DISABLE_SVG
 #ifndef MSDFGEN_DISABLE_SVG

+ 3 - 0
ext/save-png.cpp

@@ -1,5 +1,8 @@
 
 
+#ifndef _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
+#endif
+
 #include "save-png.h"
 #include "save-png.h"
 
 
 #include <cstdio>
 #include <cstdio>

+ 5 - 0
main.cpp

@@ -8,8 +8,13 @@
 
 
 #ifdef MSDFGEN_STANDALONE
 #ifdef MSDFGEN_STANDALONE
 
 
+#ifndef _USE_MATH_DEFINES
 #define _USE_MATH_DEFINES
 #define _USE_MATH_DEFINES
+#endif
+#ifndef _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
+#endif
+
 #include <cstdlib>
 #include <cstdlib>
 #include <cstdio>
 #include <cstdio>
 #include <cmath>
 #include <cmath>