]> cvs.zerfleddert.de Git - micropolis/blobdiff - src/sim/w_date.c
Fixes for compilation with gcc 15
[micropolis] / src / sim / w_date.c
index 049227bdf798473445e80921c62c56e65168496b..cdc398be3e78265b1c34f3c0c7ea87dbca306d89 100644 (file)
@@ -66,6 +66,14 @@ short NewDate = 0;
 Tcl_HashTable DateCmds;
 int DateUpdateTime = 200;
 
+void DoUpdateDate(SimDate *date);
+void DoNewDate(SimDate *date);
+void DoResizeDate(SimDate *date, int w, int h);
+void DestroyDate(SimDate *date);
+void InitNewDate(SimDate *date);
+int ConfigureSimDate(Tcl_Interp *interp, SimDate *date,
+                 int argc, char **argv, int flags);
+
 
 #define DEF_DATE_FONT  "-Adobe-Helvetica-Bold-R-Normal-*-140-*"
 #define DEF_DATE_BG_COLOR      "#b0b0b0"
@@ -103,7 +111,7 @@ Tk_ConfigSpec DateConfigSpecs[] = {
   };
 
 
-XDisplay *FindXDisplay();
+extern XDisplay *FindXDisplay(Tk_Window tkwin);
 
 
 static void
@@ -111,8 +119,6 @@ DisplaySimDate(ClientData clientData)
 {
   SimDate *date = (SimDate *) clientData;
   Tk_Window tkwin = date->tkwin;
-  Pixmap pm = None;
-  Drawable d;
 
   date->flags &= ~VIEW_REDRAW_PENDING;
 //fprintf(stderr, "DisplaySimDate cleared VIEW_REDRAW_PENDING\n");
@@ -138,6 +144,7 @@ DestroySimDate(ClientData clientData)
 }
 
 
+void
 EventuallyRedrawDate(SimDate *date)
 {
   if (!(date->flags & VIEW_REDRAW_PENDING)) {
@@ -255,8 +262,6 @@ int DateCmdconfigure(DATE_ARGS)
 
 int DateCmdposition(DATE_ARGS)
 {
-  int result = TCL_OK;
-
     if ((argc != 2) && (argc != 4)) {
       return TCL_ERROR;
     }
@@ -320,8 +325,6 @@ int DateCmdVisible(DATE_ARGS)
 
 int DateCmdReset(DATE_ARGS)
 {
-  int range;
-
   if (argc != 2) {
     Tcl_AppendResult(interp, "wrong # args", (char *) NULL);
     return TCL_ERROR;
@@ -339,8 +342,6 @@ int DateCmdReset(DATE_ARGS)
 
 int DateCmdSet(DATE_ARGS)
 {
-  int range;
-
   if (argc != 4) {
     Tcl_AppendResult(interp, "wrong # args", (char *) NULL);
     return TCL_ERROR;
@@ -373,14 +374,14 @@ DoDateCmd(CLIENT_ARGS)
   SimDate *date = (SimDate *) clientData;
   Tcl_HashEntry *ent;
   int result = TCL_OK;
-  int (*cmd)();
+  int (*cmd)(SimDate*, Tcl_Interp*, int, char**);
 
   if (argc < 2) {
     return TCL_ERROR;
   }
 
-  if (ent = Tcl_FindHashEntry(&DateCmds, argv[1])) {
-    cmd = (int (*)())ent->clientData;
+  if ((ent = Tcl_FindHashEntry(&DateCmds, argv[1]))) {
+    cmd = (int (*)(SimDate*, Tcl_Interp*, int, char**))ent->clientData;
     Tk_Preserve((ClientData) date);
     result = cmd(date, interp, argc, argv);
     Tk_Release((ClientData) date);
@@ -429,7 +430,7 @@ DateViewCmd(CLIENT_ARGS)
                        StructureNotifyMask,
                        SimDateEventProc, (ClientData) date);
   Tcl_CreateCommand(interp, Tk_PathName(date->tkwin),
-                   DoDateCmd, (ClientData) date, (void (*)()) NULL);
+                   DoDateCmd, (ClientData) date, (void (*)(int *)) NULL);
 
 /*
   Tk_MakeWindowExist(date->tkwin);
@@ -472,12 +473,11 @@ ConfigureSimDate(Tcl_Interp *interp, SimDate *date,
 }
 
 
-date_command_init()
+void
+date_command_init(void)
 {
-  int new;
-
   Tcl_CreateCommand(tk_mainInterp, "dateview", DateViewCmd,
-                   (ClientData)MainWindow, (void (*)()) NULL);
+                   (ClientData)MainWindow, (void (*)(int *)) NULL);
 
   Tcl_InitHashTable(&DateCmds, TCL_STRING_KEYS);
 
@@ -492,11 +492,9 @@ date_command_init()
 }
 
 
+void
 InitNewDate(SimDate *date)
 {
-  int d = 8;
-  struct XDisplay *xd;
-
   date->next = NULL;
 
 /* This stuff was initialized in our caller (DateCmd) */
@@ -537,6 +535,7 @@ InitNewDate(SimDate *date)
 }
 
 
+void
 DestroyDate(SimDate *date)
 {
   SimDate **gp;
@@ -562,10 +561,9 @@ DestroyDate(SimDate *date)
 }
 
 
+void
 DoResizeDate(SimDate *date, int w, int h)
 {
-  int resize = 0;
-
   date->w_width = w; date->w_height = h;
 
   if (date->pixmap != None) {
@@ -584,6 +582,7 @@ DoResizeDate(SimDate *date, int w, int h)
 }
 
 
+void
 DoNewDate(SimDate *date)
 {
   sim->dates++; date->next = sim->date; sim->date = date;
@@ -594,15 +593,15 @@ DoNewDate(SimDate *date)
 
 #define BORDER 1
 
+void
 DoUpdateDate(SimDate *date)
 {
   Display *dpy;
   GC gc;
   Pixmap pm;
   int *pix;
-  int w, h, i, j, x, y;
+  int w, h, x, y;
   int tx, ty;
-  float sx, sy;
 
   if (!date->visible) {
     return;
Impressum, Datenschutz