Browse Source

second attempt at avoiding warnings at /W4 on vs2013

shared-context
Scott Graham 11 years ago
parent
commit
c20125c941
2 changed files with 16 additions and 1 deletions
  1. +7
    -1
      src/nanovg.c
  2. +9
    -0
      src/nanovg.h

+ 7
- 1
src/nanovg.c 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
@@ -977,7 +983,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++;


+ 9
- 0
src/nanovg.h 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


Loading…
Cancel
Save