From 892262f419f78c77d2ac8c6680149bb682d48d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 21 Sep 2014 19:34:28 -0700 Subject: [PATCH] Fixed Blendish warnings. --- examples/20-nanovg/blendish.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/examples/20-nanovg/blendish.h b/examples/20-nanovg/blendish.h index 55b537c02..4cc707ff6 100644 --- a/examples/20-nanovg/blendish.h +++ b/examples/20-nanovg/blendish.h @@ -25,6 +25,12 @@ THE SOFTWARE. #ifndef BLENDISH_H #define BLENDISH_H +#if BX_COMPILER_MSVC +# pragma warning(push) +# pragma warning(disable: 4305) // warning C4305: 'initializing' : truncation from 'double' to 'float' +# pragma warning(disable: 4244) // warning C4244: 'return' : conversion from 'int' to 'float', possible loss of data +#endif // BX_COMPILER_MSVC + #ifndef NANOVG_H #error "nanovg.h must be included first." #endif @@ -1097,22 +1103,22 @@ BND_EXPORT NVGcolor bndNodeWireColor(const BNDnodeTheme *theme, BNDwidgetState s #include -static float bnd_fminf ( float a, float b ) +inline float bnd_fminf ( float a, float b ) { return _isnan(a) ? b : ( _isnan(b) ? a : ((a < b) ? a : b)); } -static float bnd_fmaxf ( float a, float b ) +inline float bnd_fmaxf ( float a, float b ) { return _isnan(a) ? b : ( _isnan(b) ? a : ((a > b) ? a : b)); } -static double bnd_fmin ( double a, double b ) +inline double bnd_fmin ( double a, double b ) { return _isnan(a) ? b : ( _isnan(b) ? a : ((a < b) ? a : b)); } -static double bnd_fmax ( double a, double b ) +inline double bnd_fmax ( double a, double b ) { return _isnan(a) ? b : ( _isnan(b) ? a : ((a > b) ? a : b)); } @@ -2132,7 +2138,7 @@ void bndIconLabelValue(NVGcontext *ctx, float x, float y, float w, float h, void bndNodeIconLabel(NVGcontext *ctx, float x, float y, float w, float h, int iconid, NVGcolor color, NVGcolor shadowColor, - int align, float fontsize, const char *label) { + int /*align*/, float fontsize, const char *label) { if (label && (bnd_font >= 0)) { nvgFontFaceId(ctx, bnd_font); nvgFontSize(ctx, fontsize); @@ -2152,7 +2158,7 @@ void bndNodeIconLabel(NVGcontext *ctx, float x, float y, float w, float h, } } -void bndIconLabelCaret(NVGcontext *ctx, float x, float y, float w, float h, +void bndIconLabelCaret(NVGcontext *ctx, float x, float y, float w, float /*h*/, int iconid, NVGcolor color, float fontsize, const char *label, NVGcolor caretcolor, int cbegin, int cend) { float bounds[4]; @@ -2327,4 +2333,8 @@ NVGcolor bndNodeWireColor(const BNDnodeTheme *theme, BNDwidgetState state) { #undef BND_INLINE #endif +#if BX_COMPILER_MSVC +# pragma warning(pop) +#endif // BX_COMPILER_MSVC + #endif // BLENDISH_IMPLEMENTATION