git » fp-git.git » commit f00cef9

Compiled in ANSI C pedantic using Warning-all and we got not even one error! Commented deprecated inline flag and fixed exit on errors (used exit(); or return instead of exit;)

author ecalot
2005-07-05 20:23:24 UTC
committer ecalot
2005-07-05 20:23:24 UTC
parent 9742bccaee87dd257513f2dc64b05e1732ebe82b

Compiled in ANSI C pedantic using Warning-all and we got not even one error! Commented deprecated inline flag and fixed exit on errors (used exit(); or return instead of exit;)

poprecog/Makefile +3 -3
poprecog/poprecog.c +6 -6

diff --git a/poprecog/Makefile b/poprecog/Makefile
index af9f138..b246c91 100644
--- a/poprecog/Makefile
+++ b/poprecog/Makefile
@@ -2,8 +2,8 @@
 # Programs #
 ############
 
-CC         = gcc
-LINKER     = ld
+CC         = @gcc
+LINKER     = @ld
 INFO       = @echo
 MAKEDIR    = @mkdir -p
 REMOVER    = @rm -f
@@ -18,7 +18,7 @@ COPY       = @ln -f
 INCLUDE       =
 LIBS          = `allegro-config --libs --cflags` 
 
-RELEASE       = -g -Wall -pedantic 
+RELEASE       = -g -Wall -pedantic -save-temps -ansi 
 LINKERRELEASE =
 
 MAIN     = .poprecog.o
diff --git a/poprecog/poprecog.c b/poprecog/poprecog.c
index d2a6a91..8746c03 100644
--- a/poprecog/poprecog.c
+++ b/poprecog/poprecog.c
@@ -86,7 +86,7 @@ poprecog.c: Prince of Persia Screenshots Recognizer
 #define POPRECOG_SUMMARY "%d recognized images in about %d seconds\n"
 #define POPRECOG_ERROR_CANNOT_OPEN "Cannot open %s for append\n"
 #define POPRECOG_LOADING "Loading bitmaps from dir %s\n"
-#define POPRECOG_END_SUMMARY "\nRecognized %d frames in about %d seconds\n"	
+#define POPRECOG_END_SUMMARY "\nRecognized %d frames in about %ld seconds\n"	
 #define POPRECOG_RELEASING_MEMORY "Releasing memory\n"
 #define POPRECOG_TYPE_STH "Type something and press ENTER key...\n"
 #define POPRECOG_DEBUG_HEADER "%s (%d/%d)"
@@ -198,7 +198,7 @@ int cmptImage(const void *a, const void *b) {
 	return 0;
 }
 
-inline int findImageOnScreenShotInPosition(int imageID, int posX, int posY) {
+/*inline*/ int findImageOnScreenShotInPosition(int imageID, int posX, int posY) {
 	register int i, x, y;
 	register short transparentPixel = makecol16(0, 0, 0);
 	register short screenShotTransparentPixel = makecol16(255, 0, 255);  
@@ -260,7 +260,7 @@ inline int findImageOnScreenShotInPosition(int imageID, int posX, int posY) {
 	return goodPixels;
 }
 
-inline int putImageOnRecognizeMap(BITMAP *bitmap, int posX, int posY, int recognizedID) {
+/*inline*/ int putImageOnRecognizeMap(BITMAP *bitmap, int posX, int posY, int recognizedID) {
 	register int x, y, value;
 	register short transparentPixel = makecol16(0, 0, 0);
 	
@@ -741,13 +741,13 @@ int main(int argc, char* argv[]) {
 	outputFile = fopen(buf, "a");
  	if (!outputFile) {
 			printf(POPRECOG_ERROR_CANNOT_OPEN,buf);
-			exit;
+			return -1;
 	}
 	sprintf(buf, "%s/%s", optResultsDir, "small_results.txt");  
 	outputSmallFile = fopen(buf, "a");
  	if (!outputFile) {
 			printf(POPRECOG_ERROR_CANNOT_OPEN,buf);
-			exit;
+			return -1;
 	}
 	fprintf(outputFile, output);
 
@@ -781,4 +781,4 @@ int main(int argc, char* argv[]) {
 	
 	return 0;
 }
-END_OF_MAIN();
+END_OF_MAIN()