From f46cb0fc60e8c021d4d89f980d248453760a6137 Mon Sep 17 00:00:00 2001
From: Michael Gernoth <michael@gernoth.net>
Date: Thu, 30 Jan 2025 11:39:44 +0100
Subject: [PATCH] tk/tclx: explicitly declare types

fixes build failures on newer gcc versions
---
 src/tclx/src/tclxgdat.y | 6 +++---
 src/tk/tkbitmap.c       | 2 +-
 src/tk/tkerror.c        | 2 +-
 src/tk/tkpack.c         | 2 +-
 src/tk/tkpixmap.c       | 2 +-
 src/tk/tkwindow.c       | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/tclx/src/tclxgdat.y b/src/tclx/src/tclxgdat.y
index aea9f3d..2439a2f 100644
--- a/src/tclx/src/tclxgdat.y
+++ b/src/tclx/src/tclxgdat.y
@@ -46,11 +46,11 @@
 #if 0
 	static time_t timeconv(int hh, int mm, int ss, int mer);
 	static time_t daylcorr(time_t future, time_t now);
-	static lookup(char *id);
+	static int lookup(char *id);
 #else
 	static time_t timeconv();
 	static time_t daylcorr();
-	static lookup();
+	static int lookup();
 #endif
 
 #define AM 1
@@ -463,7 +463,7 @@ struct table milzone[] = {
         {0, 0, 0}};
 
 static
-lookup(id) char *id;
+int lookup(id) char *id;
 {
 #define gotit (yylval=i->value,  i->type)
 #define getid for(j=idvar, k=id; *j++ = *k++; )
diff --git a/src/tk/tkbitmap.c b/src/tk/tkbitmap.c
index cc81cd0..c7693e8 100644
--- a/src/tk/tkbitmap.c
+++ b/src/tk/tkbitmap.c
@@ -434,7 +434,7 @@ Tk_GetBitmapFromData(interp, tkwin, source, width, height)
     Tk_Uid name = NULL;		/* Initialization need only to prevent
 				 * compiler warning. */
     int new;
-    static autoNumber = 0;
+    static int autoNumber = 0;
     char string[20];
 
     if (!initialized) {
diff --git a/src/tk/tkerror.c b/src/tk/tkerror.c
index a58814c..b6fdb17 100644
--- a/src/tk/tkerror.c
+++ b/src/tk/tkerror.c
@@ -23,7 +23,7 @@ static char rcsid[] = "$Header: /user6/ouster/wish/RCS/tkError.c,v 1.10 92/04/12
 #include "tkconfig.h"
 #include "tkint.h"
 
-static initialized = 0;
+static int initialized = 0;
 
 /*
  * Forward references to procedures declared later in this file:
diff --git a/src/tk/tkpack.c b/src/tk/tkpack.c
index f065bd5..a998017 100644
--- a/src/tk/tkpack.c
+++ b/src/tk/tkpack.c
@@ -95,7 +95,7 @@ static Tcl_HashTable packerHashTable;
  * Have statics in this module been initialized?
  */
 
-static initialized = 0;
+static int initialized = 0;
 
 /*
  * Forward declarations for procedures defined later in this file:
diff --git a/src/tk/tkpixmap.c b/src/tk/tkpixmap.c
index 753bbe1..8d23dad 100644
--- a/src/tk/tkpixmap.c
+++ b/src/tk/tkpixmap.c
@@ -516,7 +516,7 @@ Tk_GetPixmapFromData(interp, tkwin, source, width, height)
     Tk_Uid name = NULL;		/* Initialization need only to prevent
 				 * compiler warning. */
     int new;
-    static autoNumber = 0;
+    static int autoNumber = 0;
     char string[20];
 
     if (!initialized) {
diff --git a/src/tk/tkwindow.c b/src/tk/tkwindow.c
index 05029aa..eb6b7fe 100644
--- a/src/tk/tkwindow.c
+++ b/src/tk/tkwindow.c
@@ -55,7 +55,7 @@ TkDisplay *tkDisplayList = NULL;
  * Have statics in this module been initialized?
  */
 
-static initialized = 0;
+static int initialized = 0;
 
 /*
  * Context information used to map from X window id's to
-- 
2.39.5