Skip to content
Permalink
Browse files
Fixed some MSVC compiler warnings
  • Loading branch information
slouken committed Oct 9, 2019
1 parent d94e8de commit 4943e48e735993cd02c42cc5477fe79c3862a509
Showing with 64 additions and 11 deletions.
  1. +3 −0 IMG_bmp.c
  2. +5 −2 IMG_gif.c
  3. +3 −0 IMG_jpg.c
  4. +3 −0 IMG_lbm.c
  5. +3 −0 IMG_pcx.c
  6. +3 −0 IMG_png.c
  7. +3 −0 IMG_pnm.c
  8. +3 −0 IMG_svg.c
  9. +3 −0 IMG_tga.c
  10. +3 −0 IMG_tif.c
  11. +3 −0 IMG_webp.c
  12. +3 −0 IMG_xcf.c
  13. +3 −0 IMG_xpm.c
  14. +3 −0 IMG_xv.c
  15. +3 −0 IMG_xxx.c
  16. +9 −0 miniz.h
  17. +8 −9 nanosvg.h
@@ -425,6 +425,9 @@ SDL_Surface *IMG_LoadCUR_RW(SDL_RWops *src)
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

/* See if an image is contained in a data source */
int IMG_isBMP(SDL_RWops *src)
@@ -615,7 +615,7 @@ LWZReadByte(SDL_RWops *src, int flag, int input_code_size, State_t * state)
static Image *
ReadImage(SDL_RWops * src, int len, int height, int cmapSize,
unsigned char cmap[3][MAXCOLORMAPSIZE],
int gray, int interlace, int ignore, State_t * state)
int /*gray*/, int interlace, int ignore, State_t * state)
{
Image *image;
unsigned char c;
@@ -648,7 +648,7 @@ ReadImage(SDL_RWops * src, int len, int height, int cmapSize,
cmap[CM_GREEN][i], cmap[CM_BLUE][i]);

while ((v = LWZReadByte(src, FALSE, c, state)) >= 0) {
((Uint8 *)image->pixels)[xpos + ypos * image->pitch] = v;
((Uint8 *)image->pixels)[xpos + ypos * image->pitch] = (Uint8)v;
++xpos;
if (xpos == len) {
xpos = 0;
@@ -781,6 +781,9 @@ SDL_Surface *IMG_LoadGIF_RW(SDL_RWops *src)
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

/* See if an image is contained in a data source */
int IMG_isGIF(SDL_RWops *src)
@@ -535,6 +535,9 @@ static int IMG_SaveJPG_RW_jpeglib(SDL_Surface *surface, SDL_RWops *dst, int free
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

int IMG_InitJPG()
{
@@ -484,6 +484,9 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )
}

#else /* LOAD_LBM */
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

/* See if an image is contained in a data source */
int IMG_isLBM(SDL_RWops *src)
@@ -283,6 +283,9 @@ SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src)
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

/* See if an image is contained in a data source */
int IMG_isPCX(SDL_RWops *src)
@@ -474,6 +474,9 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

int IMG_InitPNG()
{
@@ -244,6 +244,9 @@ SDL_Surface *IMG_LoadPNM_RW(SDL_RWops *src)
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

/* See if an image is contained in a data source */
int IMG_isPNM(SDL_RWops *src)
@@ -145,6 +145,9 @@ SDL_Surface *IMG_LoadSVG_RW(SDL_RWops *src)
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

/* See if an image is contained in a data source */
int IMG_isSVG(SDL_RWops *src)
@@ -323,6 +323,9 @@ SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src)
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

/* dummy TGA load routine */
SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src)
@@ -213,6 +213,9 @@ SDL_Surface* IMG_LoadTIF_RW(SDL_RWops* src)
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

int IMG_InitTIF()
{
@@ -265,6 +265,9 @@ SDL_Surface *IMG_LoadWEBP_RW(SDL_RWops *src)
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

int IMG_InitWEBP()
{
@@ -932,6 +932,9 @@ SDL_Surface *IMG_LoadXCF_RW(SDL_RWops *src)
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

/* See if an image is contained in a data source */
int IMG_isXCF(SDL_RWops *src)
@@ -1189,6 +1189,9 @@ SDL_Surface *IMG_ReadXPMFromArray(char **xpm)
}

#else /* not LOAD_XPM */
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

/* See if an image is contained in a data source */
int IMG_isXPM(SDL_RWops *src)
@@ -146,6 +146,9 @@ SDL_Surface *IMG_LoadXV_RW(SDL_RWops *src)
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

/* See if an image is contained in a data source */
int IMG_isXV(SDL_RWops *src)
@@ -69,6 +69,9 @@ SDL_Surface *IMG_LoadXXX_RW(SDL_RWops *src)
}

#else
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif

/* See if an image is contained in a data source */
int IMG_isXXX(SDL_RWops *src)
@@ -940,6 +940,11 @@ MINIZ_STATIC mz_uint tdefl_create_comp_flags_from_zip_params(int level, int wind

#ifndef MINIZ_HEADER_FILE_ONLY

#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable:4505) // unreferenced local function has been removed
#endif

typedef unsigned char mz_validate_uint16[sizeof(mz_uint16)==2 ? 1 : -1];
typedef unsigned char mz_validate_uint32[sizeof(mz_uint32)==4 ? 1 : -1];
typedef unsigned char mz_validate_uint64[sizeof(mz_uint64)==8 ? 1 : -1];
@@ -4912,6 +4917,10 @@ void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char
}
#endif

#ifdef _MSC_VER
#pragma warning (pop)
#endif

#endif // MINIZ_HEADER_FILE_ONLY

/*
@@ -285,8 +285,8 @@ static void nsvg__parseElement(char* s,

// Get attribs
while (!end && *s && nattr < NSVG_XML_MAX_ATTRIBS-3) {
char* name = NULL;
char* value = NULL;
char* attr_name = NULL;
char* attr_value = NULL;

// Skip white space before the attrib name
while (*s && nsvg__isspace(*s)) s++;
@@ -295,7 +295,7 @@ static void nsvg__parseElement(char* s,
end = 1;
break;
}
name = s;
attr_name = s;
// Find end of the attrib name.
while (*s && !nsvg__isspace(*s) && *s != '=') s++;
if (*s) { *s++ = '\0'; }
@@ -305,14 +305,14 @@ static void nsvg__parseElement(char* s,
quote = *s;
s++;
// Store value and find the end of it.
value = s;
attr_value = s;
while (*s && *s != quote) s++;
if (*s) { *s++ = '\0'; }

// Store only well formed attributes
if (name && value) {
attr[nattr++] = name;
attr[nattr++] = value;
if (attr_name && attr_value) {
attr[nattr++] = attr_name;
attr[nattr++] = attr_value;
}
}

@@ -822,7 +822,6 @@ static float nsvg__convertToPixels(NSVGparser* p, NSVGcoordinate c, float orig,
case NSVG_UNITS_PERCENT: return orig + c.value / 100.0f * length;
default: return c.value;
}
return c.value;
}

static NSVGgradientData* nsvg__findGradientData(NSVGparser* p, const char* id)
@@ -2782,7 +2781,7 @@ static void nsvg__content(void* ud, const char* s)
if (p->styleFlag) {

int state = 0;
const char* start;
const char* start = s;
while (*s) {
char c = *s;
if (nsvg__isspace(c) || c == '{') {

0 comments on commit 4943e48

Please sign in to comment.