Merge pull request #120 from sgraham/warnings-attempt-2

second attempt at avoiding warnings at /W4 on vs2013
This commit is contained in:
Mikko Mononen 2014-06-20 20:13:20 +03:00
commit 05c8fa29d1
2 changed files with 16 additions and 1 deletions

View file

@ -24,6 +24,12 @@
#define STBI_HEADER_FILE_ONLY
#include "stb_image.c"
#ifdef _MSC_VER
#pragma warning(disable: 4100) // unreferenced formal parameter
#pragma warning(disable: 4127) // conditional expression is constant
#pragma warning(disable: 4204) // nonstandard extension used : non-constant aggregate initializer
#pragma warning(disable: 4706) // assignment within conditional expression
#endif
#define NVG_INIT_COMMANDS_SIZE 256
#define NVG_INIT_POINTS_SIZE 128
@ -980,7 +986,7 @@ static void nvg__addPoint(struct NVGcontext* ctx, float x, float y, int flags)
memset(pt, 0, sizeof(*pt));
pt->x = x;
pt->y = y;
pt->flags = flags;
pt->flags = (unsigned char)flags;
ctx->cache->npoints++;
path->count++;

View file

@ -25,6 +25,11 @@ extern "C" {
#define NVG_PI 3.14159265358979323846264338327f
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
#endif
struct NVGcontext;
struct NVGcolor {
@ -584,6 +589,10 @@ struct NVGparams* nvgInternalParams(struct NVGcontext* ctx);
// Debug function to dump cached path data.
void nvgDebugDumpPathCache(struct NVGcontext* ctx);
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#define NVG_NOTUSED(v) for (;;) { (void)(1 ? (void)0 : ( (void)(v) ) ); break; }
#ifdef __cplusplus