diff --git a/src/nanovg.c b/src/nanovg.c index 76a7e81..c12b888 100644 --- a/src/nanovg.c +++ b/src/nanovg.c @@ -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++; diff --git a/src/nanovg.h b/src/nanovg.h index 6d9dcf2..51537d3 100644 --- a/src/nanovg.h +++ b/src/nanovg.h @@ -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