From 8f524279b3651eb2a9ccf4aa2aaa78af150027ee Mon Sep 17 00:00:00 2001 From: fgenesis Date: Mon, 26 Sep 2016 01:54:30 +0200 Subject: [PATCH] warning fix + cleanup, no functional changes --- ExternalLibs/glpng.h | 42 +++++++++++--------------------------- ExternalLibs/glpng/glpng.c | 24 +++++++++++----------- 2 files changed, 24 insertions(+), 42 deletions(-) diff --git a/ExternalLibs/glpng.h b/ExternalLibs/glpng.h index 6ce2434..93d0ac2 100644 --- a/ExternalLibs/glpng.h +++ b/ExternalLibs/glpng.h @@ -31,24 +31,6 @@ extern "C" { #endif -/* -#ifdef _MSC_VER - #ifdef _DEBUG - #pragma comment (lib, "glpngd.lib") - #else - #pragma comment (lib, "glpng.lib") - #endif -#endif -*/ - -/* XXX This is from Win32's */ -#ifndef APIENTRY - #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) - #define APIENTRY __stdcall - #else - #define APIENTRY - #endif -#endif /* Mipmapping parameters */ #define PNG_NOMIPMAPS 0 /* No mipmapping */ @@ -93,21 +75,21 @@ typedef struct { unsigned char *Palette; } pngRawInfo; -extern int APIENTRY pngLoadRaw(const char *filename, pngRawInfo *rawinfo); -extern int APIENTRY pngLoadRawF(FILE *file, pngRawInfo *rawinfo); +int pngLoadRaw(const char *filename, pngRawInfo *rawinfo); +int pngLoadRawF(FILE *file, pngRawInfo *rawinfo); -extern int APIENTRY pngLoad(const char *filename, int mipmap, int trans, pngInfo *info); -extern int APIENTRY pngLoadF(FILE *file, int mipmap, int trans, pngInfo *info); -extern int APIENTRY pngLoadMem(const char *mem, int size, int mipmap, int trans, pngInfo *info); +int pngLoad(const char *filename, int mipmap, int trans, pngInfo *info); +int pngLoadF(FILE *file, int mipmap, int trans, pngInfo *info); +int pngLoadMem(const char *mem, int size, int mipmap, int trans, pngInfo *info); -extern unsigned int APIENTRY pngBind(const char *filename, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter); -extern unsigned int APIENTRY pngBindF(FILE *file, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter); -extern unsigned int APIENTRY pngBindMem(const char *mem, int size, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter); +unsigned int pngBind(const char *filename, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter); +unsigned int pngBindF(FILE *file, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter); +unsigned int pngBindMem(const char *mem, int size, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter); -extern void APIENTRY pngSetStencil(unsigned char red, unsigned char green, unsigned char blue); -extern void APIENTRY pngSetAlphaCallback(unsigned char (*callback)(unsigned char red, unsigned char green, unsigned char blue)); -extern void APIENTRY pngSetViewingGamma(double viewingGamma); -extern void APIENTRY pngSetStandardOrientation(int standardorientation); +void pngSetStencil(unsigned char red, unsigned char green, unsigned char blue); +void pngSetAlphaCallback(unsigned char (*callback)(unsigned char red, unsigned char green, unsigned char blue)); +void pngSetViewingGamma(double viewingGamma); +void pngSetStandardOrientation(int standardorientation); #ifdef __cplusplus } diff --git a/ExternalLibs/glpng/glpng.c b/ExternalLibs/glpng/glpng.c index 6bcb90b..8707ab4 100644 --- a/ExternalLibs/glpng/glpng.c +++ b/ExternalLibs/glpng/glpng.c @@ -277,7 +277,7 @@ genmip: free(d); } -int APIENTRY pngLoadRaw(const char *filename, pngRawInfo *pinfo) { +int pngLoadRaw(const char *filename, pngRawInfo *pinfo) { int result; FILE *fp = fopen(filename, "rb"); if (fp == NULL) return 0; @@ -295,7 +295,7 @@ int APIENTRY pngLoadRaw(const char *filename, pngRawInfo *pinfo) { return result; } -int APIENTRY pngLoadRawF(FILE *fp, pngRawInfo *pinfo) { +int pngLoadRawF(FILE *fp, pngRawInfo *pinfo) { unsigned char header[8]; png_structp png; png_infop info; @@ -694,7 +694,7 @@ finish: return ret; } -int APIENTRY pngLoad(const char *filename, int mipmap, int trans, pngInfo *pinfo) { +int pngLoad(const char *filename, int mipmap, int trans, pngInfo *pinfo) { int result; FILE *fp = fopen(filename, "rb"); if (fp == NULL) return 0; @@ -706,7 +706,7 @@ int APIENTRY pngLoad(const char *filename, int mipmap, int trans, pngInfo *pinfo return result; } -int APIENTRY pngLoadF(FILE *fp, int mipmap, int trans, pngInfo *pinfo) { +int pngLoadF(FILE *fp, int mipmap, int trans, pngInfo *pinfo) { unsigned char header[8]; png_structp png; png_infop info; @@ -744,7 +744,7 @@ static void glpng_read_mem(png_structp png, png_bytep dst, png_size_t size) { mr->rpos += size; } -int APIENTRY pngLoadMem(const char *mem, int size, int mipmap, int trans, pngInfo *pinfo) { +int pngLoadMem(const char *mem, int size, int mipmap, int trans, pngInfo *pinfo) { unsigned char header[8]; png_structp png; png_infop info; @@ -792,7 +792,7 @@ static unsigned int SetParams(int wrapst, int magfilter, int minfilter) { return id; } -unsigned int APIENTRY pngBind(const char *filename, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter) { +unsigned int pngBind(const char *filename, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter) { unsigned int id = SetParams(wrapst, magfilter, minfilter); if (id != 0 && pngLoad(filename, mipmap, trans, info)) @@ -800,7 +800,7 @@ unsigned int APIENTRY pngBind(const char *filename, int mipmap, int trans, pngIn return 0; } -unsigned int APIENTRY pngBindF(FILE *file, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter) { +unsigned int pngBindF(FILE *file, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter) { unsigned int id = SetParams(wrapst, magfilter, minfilter); if (id != 0 && pngLoadF(file, mipmap, trans, info)) @@ -808,7 +808,7 @@ unsigned int APIENTRY pngBindF(FILE *file, int mipmap, int trans, pngInfo *info, return 0; } -unsigned int APIENTRY pngBindMem(const char *mem, int size, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter) { +unsigned int pngBindMem(const char *mem, int size, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter) { unsigned int id = SetParams(wrapst, magfilter, minfilter); if (id != 0 && pngLoadMem(mem, size, mipmap, trans, info)) @@ -816,18 +816,18 @@ unsigned int APIENTRY pngBindMem(const char *mem, int size, int mipmap, int tran return 0; } -void APIENTRY pngSetStencil(unsigned char red, unsigned char green, unsigned char blue) { +void pngSetStencil(unsigned char red, unsigned char green, unsigned char blue) { StencilRed = red, StencilGreen = green, StencilBlue = blue; } -void APIENTRY pngSetAlphaCallback(unsigned char (*callback)(unsigned char red, unsigned char green, unsigned char blue)) { +void pngSetAlphaCallback(unsigned char (*callback)(unsigned char red, unsigned char green, unsigned char blue)) { if (callback == NULL) AlphaCallback = DefaultAlphaCallback; else AlphaCallback = callback; } -void APIENTRY pngSetViewingGamma(double viewingGamma) { +void pngSetViewingGamma(double viewingGamma) { if(viewingGamma > 0) { gammaExplicit = 1; screenGamma = 2.2/viewingGamma; @@ -838,6 +838,6 @@ void APIENTRY pngSetViewingGamma(double viewingGamma) { } } -void APIENTRY pngSetStandardOrientation(int standardorientation) { +void pngSetStandardOrientation(int standardorientation) { StandardOrientation = standardorientation; }