Fixed Blendish warnings.

This commit is contained in:
Branimir Karadžić 2014-09-21 19:34:28 -07:00
parent c40cf1f4f5
commit 892262f419
1 changed files with 16 additions and 6 deletions

View File

@ -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 <float.h>
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