Fix compiler warnings MaxQi
authorH.G. Muller <h.g.muller@hccnet.nl>
Fri, 26 Apr 2013 09:01:44 +0000 (11:01 +0200)
committerH.G. Muller <h.g.muller@hccnet.nl>
Fri, 26 Apr 2013 09:01:44 +0000 (11:01 +0200)
LoadGame was declared as int rather than void and did not return anything.
The return statements in int main did not return a value.

maxqi.c

diff --git a/maxqi.c b/maxqi.c
index cb7bc7e..1ee059f 100644 (file)
--- a/maxqi.c
+++ b/maxqi.c
@@ -52,7 +52,7 @@
 /*    add array for specifying board zones                                 */\r
 /*    add zone limiter for each piece                                      */\r
 /*    change promotion code to act when crossing river                     */\r
-/*    remove stalemate code                                                */
+/*    remove stalemate code                                                */\r
 /* G) o[] and oo[] made int, to work on big-endian machines                */\r
 /***************************************************************************/\r
 \r
@@ -88,9 +88,9 @@ int GetTickCount() // with thanks to Tord
        gettimeofday(&t, NULL);\r
        return t.tv_sec*1000 + t.tv_usec/1000;\r
 }\r
-#ifndef INI_FILE 
-#define INI_FILE "qmax.ini"
-#endif
+#ifndef INI_FILE \r
+#define INI_FILE "qmax.ini"\r
+#endif\r
 \r
 #else\r
 \r
@@ -399,8 +399,8 @@ void PrintVariants()
 \r
         fclose(f);\r
 }\r
-                                         \r
-int LoadGame(char *name)\r
+\r
+void LoadGame(char *name)\r
 {\r
         int i, j, count=0; char c, buf[80];\r
         static int currentVariant;\r
@@ -531,7 +531,7 @@ int main(int argc, char **argv)
                         continue;\r
                }\r
                if (!fgets(line, 256, stdin))\r
-                       return;\r
+                       return 1;\r
                if (line[0] == '\n')\r
                        continue;\r
                sscanf(line, "%s", command);\r
@@ -583,7 +583,7 @@ int main(int argc, char **argv)
                }\r
                if (!strcmp(command, "quit"))\r
                         /* exit engine */\r
-                       return;\r
+                       return 0;\r
                if (!strcmp(command, "force")) {\r
                         /* computer plays neither */\r
                         Computer = EMPTY;\r