]> git.zerfleddert.de Git - micropolis/blobdiff - src/sim/w_sim.c
Enable warnings and fix them, all of them
[micropolis] / src / sim / w_sim.c
index 71f2f1a68741aff273aee5397971fff5b9af2819..fcfa60fc1cbf54ba3646390147a439cfe27619eb 100644 (file)
@@ -145,6 +145,7 @@ SIMCMD_CALL(StartBulldozer)
 SIMCMD_CALL(StopBulldozer)
 SIMCMD_CALL(MakeFire)
 SIMCMD_CALL(MakeFlood)
+SIMCMD_CALL(MakeAirCrash)
 SIMCMD_CALL(MakeTornado)
 SIMCMD_CALL(MakeEarthquake)
 SIMCMD_CALL(MakeMonster)
@@ -324,8 +325,6 @@ int SimCmdDelay(ARGS)
 
 int SimCmdWorldX(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -337,8 +336,6 @@ int SimCmdWorldX(ARGS)
 
 int SimCmdWorldY(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -501,7 +498,7 @@ int SimCmdFunds(ARGS)
     Kick();
   }
 
-  sprintf(interp->result, "%d", TotalFunds);
+  sprintf(interp->result, "%ld", TotalFunds);
   return (TCL_OK);
 }
 
@@ -730,8 +727,6 @@ int SimCmdSound(ARGS)
 
 int SimCmdFlush(ARGS)
 {
-  int style;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -777,7 +772,7 @@ int SimCmdDonDither(ARGS)
     DonDither = dd;
   }
 
-  sprintf(interp->result, "%d", DonDither);
+  sprintf(interp->result, "%ld", DonDither);
   return (TCL_OK);
 }
 
@@ -934,7 +929,7 @@ int SimCmdFill(ARGS)
 
 int SimCmdDynamicData(ARGS)
 {
-  int index, val;
+  int index;
 
   if ((argc != 3) && (argc != 4)) {
     return (TCL_ERROR);
@@ -1018,8 +1013,6 @@ int SimCmdUpdate(ARGS)
 
 int SimCmdLandValue(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1031,8 +1024,6 @@ int SimCmdLandValue(ARGS)
 
 int SimCmdTraffic(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1044,8 +1035,6 @@ int SimCmdTraffic(ARGS)
 
 int SimCmdCrime(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1057,8 +1046,6 @@ int SimCmdCrime(ARGS)
 
 int SimCmdUnemployment(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1070,8 +1057,6 @@ int SimCmdUnemployment(ARGS)
 
 int SimCmdFires(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1083,8 +1068,6 @@ int SimCmdFires(ARGS)
 
 int SimCmdPollution(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1096,8 +1079,6 @@ int SimCmdPollution(ARGS)
 
 int SimCmdPolMaxX(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1109,8 +1090,6 @@ int SimCmdPolMaxX(ARGS)
 
 int SimCmdPolMaxY(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1122,8 +1101,6 @@ int SimCmdPolMaxY(ARGS)
 
 int SimCmdTrafMaxX(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1135,8 +1112,6 @@ int SimCmdTrafMaxX(ARGS)
 
 int SimCmdTrafMaxY(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1148,8 +1123,6 @@ int SimCmdTrafMaxY(ARGS)
 
 int SimCmdMeltX(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1161,8 +1134,6 @@ int SimCmdMeltX(ARGS)
 
 int SimCmdMeltY(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1174,8 +1145,6 @@ int SimCmdMeltY(ARGS)
 
 int SimCmdCrimeMaxX(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1187,8 +1156,6 @@ int SimCmdCrimeMaxX(ARGS)
 
 int SimCmdCrimeMaxY(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1200,8 +1167,6 @@ int SimCmdCrimeMaxY(ARGS)
 
 int SimCmdCenterX(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1213,8 +1178,6 @@ int SimCmdCenterX(ARGS)
 
 int SimCmdCenterY(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1226,8 +1189,6 @@ int SimCmdCenterY(ARGS)
 
 int SimCmdFloodX(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1239,8 +1200,6 @@ int SimCmdFloodX(ARGS)
 
 int SimCmdFloodY(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1252,8 +1211,6 @@ int SimCmdFloodY(ARGS)
 
 int SimCmdCrashX(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1265,8 +1222,6 @@ int SimCmdCrashX(ARGS)
 
 int SimCmdCrashY(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1278,8 +1233,6 @@ int SimCmdCrashY(ARGS)
 
 int SimCmdDollars(ARGS)
 {
-  int val;
-
   if (argc != 2) {
     return (TCL_ERROR);
   }
@@ -1389,7 +1342,7 @@ int SimCmdPlatform(ARGS)
 
 int SimCmdVersion(ARGS)
 {
-  sprintf(interp->result, MicropolisVersion);
+  strcpy(interp->result, MicropolisVersion);
 
   return (TCL_OK);
 }
@@ -1419,7 +1372,6 @@ int SimCmdOpenWebBrowser(ARGS)
 
 int SimCmdQuoteURL(ARGS)
 {
-  int result = 1;
   char buf[2048];
   char *from, *to;
   int ch;
@@ -1511,6 +1463,22 @@ int SimCmdSugarMode(ARGS)
   return (TCL_OK);
 }
 
+int SimCmdHasAirCrash(ARGS)
+{
+  int aircrash = 0;
+
+  if (argc != 2) {
+    return (TCL_ERROR);
+  }
+
+#ifndef NO_AIRCRASH
+  aircrash = 1;
+#endif
+
+  sprintf(interp->result, "%d", aircrash);
+  return (TCL_OK);
+}
+
 
 /************************************************************************/
 
@@ -1525,7 +1493,7 @@ SimCmd(CLIENT_ARGS)
     return TCL_ERROR;
   }
 
-  if (ent = Tcl_FindHashEntry(&SimCmds, argv[1])) {
+  if ((ent = Tcl_FindHashEntry(&SimCmds, argv[1]))) {
     cmd = (int (*)())ent->clientData;
     result = cmd(interp, argc, argv);
   } else {
@@ -1535,10 +1503,9 @@ SimCmd(CLIENT_ARGS)
 }
 
 
-sim_command_init()
+void
+sim_command_init(void)
 {
-  int new;
-
   Tcl_CreateCommand(tk_mainInterp, "sim", SimCmd,
                    (ClientData)MainWindow, (void (*)()) NULL);
 
@@ -1567,6 +1534,7 @@ sim_command_init()
   SIM_CMD(StopBulldozer);
   SIM_CMD(MakeFire);
   SIM_CMD(MakeFlood);
+  SIM_CMD(MakeAirCrash);
   SIM_CMD(MakeTornado);
   SIM_CMD(MakeEarthquake);
   SIM_CMD(MakeMonster);
@@ -1674,4 +1642,5 @@ sim_command_init()
   SIM_CMD(NeedRest);
   SIM_CMD(MultiPlayerMode);
   SIM_CMD(SugarMode);
+  SIM_CMD(HasAirCrash);
 }
Impressum, Datenschutz