Reinhard Max 2024-07-01 16:55:38 +00:00 committed by Git OBS Bridge
parent cb3e58c205
commit dd55bd823d
5 changed files with 316 additions and 4 deletions

228
tix-c89.patch Normal file
View File

@ -0,0 +1,228 @@
Fix various incompatible pointers by switching to correct
const-qualified types.
Several problematic casts can be removed, except for the one in the
masterPtr->data in ImgXpmGetData.
diff --git generic/tixDItem.c generic/tixDItem.c
index 602c506d158d8a98..d23a4eb036aa8997 100644
--- generic/tixDItem.c
+++ generic/tixDItem.c
@@ -30,7 +30,7 @@ static int DItemParseProc _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin, CONST84 char *value,
char *widRec, int offset));
-static char *DItemPrintProc _ANSI_ARGS_((
+static const char *DItemPrintProc _ANSI_ARGS_((
ClientData clientData, Tk_Window tkwin, char *widRec,
int offset, Tcl_FreeProc **freeProcPtr));
@@ -548,7 +548,7 @@ static int DItemParseProc(clientData, interp, tkwin, value, widRec,offset)
return TCL_OK;
}
-static char *DItemPrintProc(clientData, tkwin, widRec,offset, freeProcPtr)
+static const char *DItemPrintProc(clientData, tkwin, widRec,offset, freeProcPtr)
ClientData clientData;
Tk_Window tkwin;
char *widRec;
diff --git generic/tixDiStyle.c generic/tixDiStyle.c
index 3c450cf001d075ba..fba76706afcd16f0 100644
--- generic/tixDiStyle.c
+++ generic/tixDiStyle.c
@@ -31,7 +31,7 @@ typedef struct StyleInfo {
static int DItemStyleParseProc _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
CONST84 char *value,char *widRec, int offset));
-static char * DItemStylePrintProc _ANSI_ARGS_((
+static const char * DItemStylePrintProc _ANSI_ARGS_((
ClientData clientData, Tk_Window tkwin,
char *widRec, int offset,
Tcl_FreeProc **freeProcPtr));
@@ -998,7 +998,7 @@ not_found:
return TCL_ERROR;
}
-static char *DItemStylePrintProc(clientData, tkwin, widRec,offset, freeProcPtr)
+static const char *DItemStylePrintProc(clientData, tkwin, widRec,offset, freeProcPtr)
ClientData clientData;
Tk_Window tkwin;
char *widRec;
diff --git generic/tixImgCmp.c generic/tixImgCmp.c
index 4ba60ca06541156e..5df05c4eb32a4611 100644
--- generic/tixImgCmp.c
+++ generic/tixImgCmp.c
@@ -142,8 +142,8 @@ typedef union CmpItemPtr {
* The type record for bitmap images:
*/
static int ImgCmpCreate _ANSI_ARGS_((Tcl_Interp *interp,
- char *name, int argc, Tcl_Obj *CONST objv[],
- Tk_ImageType *typePtr, Tk_ImageMaster master,
+ const char *name, int argc, Tcl_Obj *CONST objv[],
+ const Tk_ImageType *typePtr, Tk_ImageMaster master,
ClientData *clientDataPtr));
static ClientData ImgCmpGet _ANSI_ARGS_((Tk_Window tkwin,
ClientData clientData));
@@ -378,11 +378,11 @@ static int
ImgCmpCreate(interp, name, argc, objv, typePtr, master, clientDataPtr)
Tcl_Interp *interp; /* Interpreter for application containing
* image. */
- char *name; /* Name to use for image. */
+ const char *name; /* Name to use for image. */
int argc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument strings for options (doesn't
* include image name or type). */
- Tk_ImageType *typePtr; /* Pointer to our type record (not used). */
+ const Tk_ImageType *typePtr;/* Pointer to our type record (not used). */
Tk_ImageMaster master; /* Token for image, to be used by us in
* later callbacks. */
ClientData *clientDataPtr; /* Store manager's token for image here;
diff --git generic/tixImgXpm.c generic/tixImgXpm.c
index 23c3981c6ea29fe8..16afe3b2318cf6e2 100644
--- generic/tixImgXpm.c
+++ generic/tixImgXpm.c
@@ -22,8 +22,8 @@
*/
static int ImgXpmCreate _ANSI_ARGS_((Tcl_Interp *interp,
- char *name, int argc, Tcl_Obj *CONST objv[],
- Tk_ImageType *typePtr, Tk_ImageMaster master,
+ const char *name, int argc, Tcl_Obj *CONST objv[],
+ const Tk_ImageType *typePtr, Tk_ImageMaster master,
ClientData *clientDataPtr));
static ClientData ImgXpmGet _ANSI_ARGS_((Tk_Window tkwin,
ClientData clientData));
@@ -45,11 +45,11 @@ static int ImgXpmConfigureMaster _ANSI_ARGS_((
int flags));
static int ImgXpmGetData _ANSI_ARGS_((Tcl_Interp *interp,
PixmapMaster *masterPtr));
-static char ** ImgXpmGetDataFromFile _ANSI_ARGS_((Tcl_Interp * interp,
+static const char ** ImgXpmGetDataFromFile _ANSI_ARGS_((Tcl_Interp * interp,
char * string, int * numLines_return));
-static char ** ImgXpmGetDataFromId _ANSI_ARGS_((Tcl_Interp * interp,
+static const char ** ImgXpmGetDataFromId _ANSI_ARGS_((Tcl_Interp * interp,
CONST84 char * id));
-static char ** ImgXpmGetDataFromString _ANSI_ARGS_((Tcl_Interp*interp,
+static const char ** ImgXpmGetDataFromString _ANSI_ARGS_((Tcl_Interp*interp,
char * string, int * numLines_return));
static void ImgXpmGetPixmapFromData _ANSI_ARGS_((
Tcl_Interp * interp,
@@ -115,11 +115,11 @@ static int
ImgXpmCreate(interp, name, argc, objv, typePtr, master, clientDataPtr)
Tcl_Interp *interp; /* Interpreter for application containing
* image. */
- char *name; /* Name to use for image. */
+ const char *name; /* Name to use for image. */
int argc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument strings for options (doesn't
* include image name or type). */
- Tk_ImageType *typePtr; /* Pointer to our type record (not used). */
+ const Tk_ImageType *typePtr;/* Pointer to our type record (not used). */
Tk_ImageMaster master; /* Token for image, to be used by us in
* later callbacks. */
ClientData *clientDataPtr; /* Store manager's token for image here;
@@ -286,7 +286,7 @@ ImgXpmGetData(interp, masterPtr)
Tcl_Interp *interp; /* For reporting errors. */
PixmapMaster *masterPtr;
{
- char ** data = NULL;
+ const char ** data = NULL;
int isAllocated = 0; /* do we need to free "data"? */
int listArgc;
CONST84 char ** listArgv = NULL;
@@ -342,7 +342,7 @@ ImgXpmGetData(interp, masterPtr)
ckfree((char*)masterPtr->data);
}
masterPtr->isDataAlloced = isAllocated;
- masterPtr->data = data;
+ masterPtr->data = (char **)data;
masterPtr->size[0] = size[0];
masterPtr->size[1] = size[1];
masterPtr->cpp = cpp;
@@ -363,7 +363,7 @@ ImgXpmGetData(interp, masterPtr)
return code;
}
-static char ** ImgXpmGetDataFromId(interp, id)
+static const char ** ImgXpmGetDataFromId(interp, id)
Tcl_Interp * interp;
CONST84 char * id;
{
@@ -378,13 +378,13 @@ static char ** ImgXpmGetDataFromId(interp, id)
if (hashPtr == NULL) {
Tcl_AppendResult(interp, "unknown pixmap ID \"", id,
"\"", NULL);
- return (char**)NULL;
+ return NULL;
} else {
- return (char**)Tcl_GetHashValue(hashPtr);
+ return Tcl_GetHashValue(hashPtr);
}
}
-static char ** ImgXpmGetDataFromString(interp, string, numLines_return)
+static const char ** ImgXpmGetDataFromString(interp, string, numLines_return)
Tcl_Interp * interp;
char * string;
int * numLines_return;
@@ -392,7 +392,7 @@ static char ** ImgXpmGetDataFromString(interp, string, numLines_return)
int quoted;
char * p, * list;
int numLines;
- char ** data;
+ const char ** data;
/* skip the leading blanks (leading blanks are not defined in the
* the XPM definition, but skipping them shouldn't hurt. Also, the ability
@@ -510,17 +510,17 @@ static char ** ImgXpmGetDataFromString(interp, string, numLines_return)
error:
Tcl_AppendResult(interp, "File format error", NULL);
- return (char**) NULL;
+ return NULL;
}
-static char ** ImgXpmGetDataFromFile(interp, fileName, numLines_return)
+static const char ** ImgXpmGetDataFromFile(interp, fileName, numLines_return)
Tcl_Interp * interp;
char * fileName;
int * numLines_return;
{
FILE * fd = NULL;
int size, n;
- char ** data;
+ const char ** data;
char *cmdBuffer = NULL;
Tcl_DString buffer; /* initialized by Tcl_TildeSubst */
@@ -588,7 +588,7 @@ static char ** ImgXpmGetDataFromFile(interp, fileName, numLines_return)
ckfree(cmdBuffer);
}
Tcl_DStringFree(&buffer);
- return (char**)NULL;
+ return NULL;
}
diff --git generic/tixUtils.c generic/tixUtils.c
index 998acb84e3f8c79c..e7967b51ecd3a1e4 100644
--- generic/tixUtils.c
+++ generic/tixUtils.c
@@ -24,7 +24,7 @@
static int ReliefParseProc(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin, CONST84 char *value,
char *widRec, int offset);
-static char * ReliefPrintProc(ClientData clientData,
+static const char * ReliefPrintProc(ClientData clientData,
Tk_Window tkwin, char *widRec, int offset,
Tix_FreeProc **freeProcPtr);
@@ -637,7 +637,7 @@ ReliefParseProc(clientData, interp, tkwin, value, widRec,offset)
return TCL_ERROR;
}
-static char *
+static const char *
ReliefPrintProc(clientData, tkwin, widRec,offset, freeProcPtr)
ClientData clientData;
Tk_Window tkwin;

54
tix-implicit-int.patch Normal file
View File

@ -0,0 +1,54 @@
Avoid implicit int declarations, a feature removed from C language with C99.
diff --git generic/tixDiImg.c generic/tixDiImg.c
index da20d53c16cca3c7..3fb9f800fcd9e52a 100644
--- generic/tixDiImg.c
+++ generic/tixDiImg.c
@@ -352,6 +352,8 @@ Tix_ImageItemDisplay(drawable, iPtr, x, y, width, height, xOffset, yOffset,
int y;
int width;
int height;
+ int xOffset;
+ int yOffset;
int flags;
{
TixImageItem *itPtr = (TixImageItem *)iPtr;
diff --git generic/tixDiWin.c generic/tixDiWin.c
index e62529ecd19a9790..a96cd287e11c34e3 100644
--- generic/tixDiWin.c
+++ generic/tixDiWin.c
@@ -458,6 +458,8 @@ Tix_WindowItemDisplay(drawable, iPtr, x, y, width, height, xOffset, yOffset,
int y;
int width;
int height;
+ int xOffset;
+ int yOffset;
int flags;
{
TixWindowItem *itPtr = (TixWindowItem *)iPtr;
diff --git generic/tixForm.c generic/tixForm.c
index 5ab21f15a99bfde9..ba56617e436f748b 100644
--- generic/tixForm.c
+++ generic/tixForm.c
@@ -150,7 +150,7 @@ static Tcl_HashTable masterInfoHashTable;
/*
* Have static variables in this module been initialized?
*/
-static initialized = 0;
+static int initialized = 0;
static int ReqSize(tkwin, axis)
Tk_Window tkwin;
diff --git unix/tixUnixMwm.c unix/tixUnixMwm.c
index 3c4ac4d83bc51c80..02b58c16311b2c54 100644
--- unix/tixUnixMwm.c
+++ unix/tixUnixMwm.c
@@ -768,7 +768,7 @@ GetMwmInfo(interp, tkwin)
Tcl_Interp * interp;
Tk_Window tkwin;
{
- static inited = 0;
+ static int inited = 0;
Tcl_HashEntry *hashPtr;
int isNew;

20
tix-includes.patch Normal file
View File

@ -0,0 +1,20 @@
--- generic/tixGrUtl.c.orig
+++ generic/tixGrUtl.c
@@ -17,6 +17,7 @@
#include <tixInt.h>
#include <tixDef.h>
#include <tixGrid.h>
+#include <ctype.h>
#ifndef UCHAR
#define UCHAR(c) ((unsigned char) (c))
--- generic/tixImgXpm.c.orig
+++ generic/tixImgXpm.c
@@ -16,6 +16,7 @@
#include <tixPort.h>
#include <tixInt.h>
#include <tixImgXpm.h>
+#include <ctype.h>
/*
* Prototypes for procedures used only locally in this file:

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Jul 1 16:51:07 UTC 2024 - Reinhard Max <max@suse.com>
- boo#1225944: Add patches to build with gcc14:
* tix-c89.patch
* tix-implicit-int.patch
* tix-includes.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Feb 26 15:01:21 UTC 2024 - pgajdos@suse.com Mon Feb 26 15:01:21 UTC 2024 - pgajdos@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package tix # spec file for package tix
# #
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2024 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9) # license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative. # published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via https://bugs.opensuse.org/
# #
@ -30,7 +30,11 @@ License: BSD-3-Clause
Group: Development/Libraries/Tcl Group: Development/Libraries/Tcl
Source: Tix%version-src.tar.bz2 Source: Tix%version-src.tar.bz2
Patch0: %name.patch Patch0: %name.patch
Patch1: %name-c89.patch
Patch2: %name-implicit-int.patch
Patch3: %name-includes.patch
%requires_ge tk tcl %requires_ge tk tcl
%description %description
The Tix library has, by far, the greatest collection of widgets for The Tix library has, by far, the greatest collection of widgets for
programming with Tcl/Tk. Highlights include: hierarchical list box, programming with Tcl/Tk. Highlights include: hierarchical list box,
@ -40,8 +44,6 @@ window, note book, spin control widget and many more. With these new
widgets, your applications will look great and interact with your users widgets, your applications will look great and interact with your users
in intuitive ways. in intuitive ways.
%prep %prep
%autosetup -p0 -n Tix%version %autosetup -p0 -n Tix%version
find docs -type f | xargs chmod a-x find docs -type f | xargs chmod a-x