From 6e56f912d1fdfbdc55339b8005aabd25564eabc1 Mon Sep 17 00:00:00 2001 From: cxgeorge <> Date: Thu, 26 Apr 2001 22:32:10 +0000 Subject: [PATCH] fix intel compiler warnings --- panda/src/pnm/Sources.pp | 1 + panda/src/pnm/libpbm1.c | 6 +++--- panda/src/pnm/libpgm2.c | 12 ++---------- panda/src/pnm/libppm2.c | 21 +++++++-------------- panda/src/pnm/libppm4.c | 2 ++ panda/src/pnm/libppm5.c | 11 ++++++----- 6 files changed, 21 insertions(+), 32 deletions(-) diff --git a/panda/src/pnm/Sources.pp b/panda/src/pnm/Sources.pp index c310c50f82..a0041386ea 100644 --- a/panda/src/pnm/Sources.pp +++ b/panda/src/pnm/Sources.pp @@ -2,6 +2,7 @@ dtoolutil:c dtoolbase:c dtool:m #define LOCAL_LIBS pandabase +#define CFLAGS /D__STDC__ #begin lib_target #define TARGET pnm diff --git a/panda/src/pnm/libpbm1.c b/panda/src/pnm/libpbm1.c index e49d2e2913..6839580fa1 100644 --- a/panda/src/pnm/libpbm1.c +++ b/panda/src/pnm/libpbm1.c @@ -355,7 +355,7 @@ pm_perror( reason ) pm_error( "%s", e ); } -#if __STDC__ +#if defined(__STDC__) || defined(WIN32_VC) void pm_message( char* format, ... ) { @@ -384,7 +384,7 @@ pm_message( va_alist ) va_end( args ); } -#if __STDC__ +#if defined(__STDC__) || defined(WIN32_VC) void pm_error( char* format, ... ) { @@ -725,7 +725,7 @@ pm_readlittleshort( in, sP ) return 0; } -#if __STDC__ +#if defined(__STDC__) || defined(WIN32_VC) int pm_writelittleshort( FILE* out, short s ) #else /*__STDC__*/ diff --git a/panda/src/pnm/libpgm2.c b/panda/src/pnm/libpgm2.c index 3b60578698..cffa4d2aa4 100644 --- a/panda/src/pnm/libpgm2.c +++ b/panda/src/pnm/libpgm2.c @@ -62,11 +62,7 @@ putus( n, file ) #ifdef PBMPLUS_RAWBITS static void -pgm_writepgmrowraw( file, grayrow, cols, maxval ) - FILE* file; - gray* grayrow; - int cols; - gray maxval; +pgm_writepgmrowraw(FILE* file,gray* grayrow,int cols,gray maxval) { register int col; register gray* gP; @@ -83,11 +79,7 @@ pgm_writepgmrowraw( file, grayrow, cols, maxval ) #endif /*PBMPLUS_RAWBITS*/ static void -pgm_writepgmrowplain( file, grayrow, cols, maxval ) - FILE* file; - gray* grayrow; - int cols; - gray maxval; +pgm_writepgmrowplain(FILE* file,gray* grayrow,int cols,gray maxval) { register int col, charcount; register gray* gP; diff --git a/panda/src/pnm/libppm2.c b/panda/src/pnm/libppm2.c index d08602c251..39951978e8 100644 --- a/panda/src/pnm/libppm2.c +++ b/panda/src/pnm/libppm2.c @@ -14,10 +14,13 @@ #include "libppm.h" static void putus ARGS((unsigned short n, FILE* file)); + static void ppm_writeppmrowplain ARGS((FILE* file, pixel* pixelrow, int cols, pixval maxval)); + #ifdef PBMPLUS_RAWBITS -static void ppm_writeppmrowraw ARGS((FILE* file, pixel* pixelrow, int cols, pixval maxval)); +static void ppm_writeppmrowraw(FILE* file, pixel* pixelrow, int cols, pixval maxval); #endif /* PBMPLUS_RAWBITS */ + #if __STDC__ void ppm_writeppminit( FILE* file, int cols, int rows, pixval maxval, int forceplain ) @@ -51,9 +54,7 @@ ppm_writeppminit( file, cols, rows, maxval, forceplain ) } static void -putus( n, file ) - unsigned short n; - FILE* file; +putus(unsigned short n, FILE* file) { if ( n >= 10 ) putus( n / 10, file ); @@ -62,11 +63,7 @@ putus( n, file ) #ifdef PBMPLUS_RAWBITS static void -ppm_writeppmrowraw( file, pixelrow, cols, maxval ) - FILE* file; - pixel* pixelrow; - int cols; - pixval maxval; +ppm_writeppmrowraw (FILE* file,pixel* pixelrow,int cols,pixval maxval) { register int col; register pixel* pP; @@ -97,11 +94,7 @@ ppm_writeppmrowraw( file, pixelrow, cols, maxval ) #endif /*PBMPLUS_RAWBITS*/ static void -ppm_writeppmrowplain( file, pixelrow, cols, maxval ) - FILE* file; - pixel* pixelrow; - int cols; - pixval maxval; +ppm_writeppmrowplain(FILE* file,pixel* pixelrow,int cols,pixval maxval) { register int col, charcount; register pixel* pP; diff --git a/panda/src/pnm/libppm4.c b/panda/src/pnm/libppm4.c index f596c51409..802680be1a 100644 --- a/panda/src/pnm/libppm4.c +++ b/panda/src/pnm/libppm4.c @@ -10,6 +10,8 @@ ** implied warranty. */ +#include +#include #include "ppm.h" static void canonstr ARGS((char* str)); diff --git a/panda/src/pnm/libppm5.c b/panda/src/pnm/libppm5.c index 35d49a19fc..6a9617a51f 100644 --- a/panda/src/pnm/libppm5.c +++ b/panda/src/pnm/libppm5.c @@ -12,6 +12,8 @@ ** implied warranty. */ +#include +#include #include "ppm.h" #include "ppmdraw.h" @@ -546,12 +548,11 @@ ppmd_fill_drawproc( pixels, cols, rows, maxval, x, y, clientdata ) ++(fh->n); } -static int yx_compare ARGS((coord* c1, coord* c2)); static int -yx_compare( c1, c2 ) - coord* c1; - coord* c2; - { +yx_compare(const void* v1,const void* v2) { + coord* c1 = (coord *)v1; + coord* c2 = (coord *)v2; + if ( c1->y > c2->y ) return 1; if ( c1->y < c2->y )