Răsfoiți Sursa

Fixed VS2015 warnings.

Branimir Karadžić 10 ani în urmă
părinte
comite
ec9ba5d15b

+ 9 - 4
3rdparty/stb/stb_image.c

@@ -187,10 +187,15 @@
 
 #ifndef STBI_NO_STDIO
 
-#if defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(_CRT_SECURE_NO_WARNINGS)
-#define _CRT_SECURE_NO_WARNINGS // suppress warnings about fopen()
-#pragma warning(push)
-#pragma warning(disable:4996)   // suppress even more warnings about fopen()
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+#	if !defined(_CRT_SECURE_NO_WARNINGS)
+#		define _CRT_SECURE_NO_WARNINGS // suppress warnings about fopen()
+#	endif
+#	pragma warning(push)
+#	pragma warning(disable:4996)   // suppress even more warnings about fopen()
+#	pragma warning(disable:4312)   // warning C4312: 'type cast': conversion from 'int' to 'unsigned char *' of greater size
+#	pragma warning(disable:4456)   // warning C4456: declaration of 'k' hides previous local declaration
+#	pragma warning(disable:4457)   // warning C4457: declaration of 'y' hides function parameter
 #endif
 #include <stdio.h>
 #endif // STBI_NO_STDIO

+ 1 - 0
examples/20-nanovg/blendish.h

@@ -1109,6 +1109,7 @@ BND_EXPORT NVGcolor bndNodeWireColor(const BNDnodeTheme *theme, BNDwidgetState s
     #pragma warning (disable: 4100) // Switch off unreferenced formal parameter warnings
     #pragma warning (disable: 4244)
     #pragma warning (disable: 4305)
+    #pragma warning (disable: 4838) // warning C4838: conversion from 'double' to 'float' requires a narrowing conversion
     #ifdef __cplusplus
     #define BND_INLINE inline
     #else

+ 3 - 3
examples/20-nanovg/nanovg.cpp

@@ -1042,10 +1042,10 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h
 				for (j = 0; j < nglyphs; j++) {
 					float x0 = glyphs[j].x;
 					float x1 = (j+1 < nglyphs) ? glyphs[j+1].x : x+row->width;
-					float gx = x0 * 0.3f + x1 * 0.7f;
-					if (mx >= px && mx < gx)
+					float tgx = x0 * 0.3f + x1 * 0.7f;
+					if (mx >= px && mx < tgx)
 						caretx = glyphs[j].x;
-					px = gx;
+					px = tgx;
 				}
 				nvgBeginPath(vg);
 				nvgFillColor(vg, nvgRGBA(255,192,0,255));