Bläddra i källkod

fix intel compiler warnings

cxgeorge 25 år sedan
förälder
incheckning
6e56f912d1

+ 1 - 0
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
 

+ 3 - 3
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__*/

+ 2 - 10
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;

+ 7 - 14
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;

+ 2 - 0
panda/src/pnm/libppm4.c

@@ -10,6 +10,8 @@
 ** implied warranty.
 */
 
+#include <stdlib.h>
+#include <math.h>
 #include "ppm.h"
 
 static void canonstr ARGS((char* str));

+ 6 - 5
panda/src/pnm/libppm5.c

@@ -12,6 +12,8 @@
 ** implied warranty.
 */
 
+#include <stdlib.h>
+#include <math.h>
 #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 )