commit 38732fe79da42e605dcc3294b63d6ef6e57178f9
parent c5a6d6f7dc5119851cbc14dbfaa4d248985685d2
Author: falkTX <falktx@gmail.com>
Date: Mon, 27 Apr 2015 23:04:53 +0200
Fix some warnings in nanovg code
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dgl/src/nanovg/fontstash.h b/dgl/src/nanovg/fontstash.h
@@ -854,6 +854,7 @@ int fonsAddFont(FONScontext* stash, const char* name, const char* path)
FILE* fp = 0;
int dataSize = 0;
unsigned char* data = NULL;
+ size_t ignore;
// Read in the font data.
fp = fopen(path, "rb");
@@ -863,7 +864,7 @@ int fonsAddFont(FONScontext* stash, const char* name, const char* path)
fseek(fp,0,SEEK_SET);
data = (unsigned char*)malloc(dataSize);
if (data == NULL) goto error;
- fread(data, 1, dataSize, fp);
+ ignore = fread(data, 1, dataSize, fp);
fclose(fp);
fp = 0;
@@ -873,6 +874,8 @@ error:
if (data) free(data);
if (fp) fclose(fp);
return FONS_INVALID;
+
+ FONS_NOTUSED(ignore);
}
int fonsAddFontMem(FONScontext* stash, const char* name, unsigned char* data, int dataSize, int freeData)
diff --git a/dgl/src/nanovg/stb_image.h b/dgl/src/nanovg/stb_image.h
@@ -4127,7 +4127,8 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i
static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
stbi_uc *u = 0;
- stbi__gif g={0};
+ stbi__gif g;
+ memset(&g, 0, sizeof(stbi__gif));
u = stbi__gif_load_next(s, &g, comp, req_comp);
if (u == (void *) 1) u = 0; // end of animated gif marker