pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/x11/blt



Module Name:    pkgsrc
Committed By:   dholland
Date:           Mon Jun  6 04:27:14 UTC 2022

Modified Files:
        pkgsrc/x11/blt: Makefile distinfo
        pkgsrc/x11/blt/patches: patch-ae patch-src_bltNsUtil.h
Added Files:
        pkgsrc/x11/blt/patches: patch-src_bltArrayObj.c patch-src_bltBgexec.c
            patch-src_bltConfig.c patch-src_bltInit.c patch-src_bltList.c
            patch-src_bltList.h patch-src_bltObjConfig.c
            patch-src_bltScrollbar.c patch-src_bltSwitch.c patch-src_bltTable.c
            patch-src_bltTree.c patch-src_bltTreeCmd.c patch-src_bltUnixPipe.c
            patch-src_bltVecObjCmd.c

Log Message:
Patch up x11/blt some.

Most importantly, fix up what it passes to the TCL package handling
functions, since as it was the library won't initialize. I can't
remember when this changed in TCL but I've seen the same issue
before... years ago. This library has likely been inoperable all that
time.

Patch up a whole bunch of build warnings, some significant.

However, it probably still doesn't work and in addition to a lot more
routine build issues it needs attention from someone who knows more
tcl than me.

Bump PKGREVISION (to 13). I'm not going to bump the handful of
dependent packages since I don't think I've done anything to change
the interface, plus they're all likely inoperable anyway given how
broken this thing looks.

Prerequisite for checking PR 32807 for currency, since it depends on
blt and blt won't load. But I rather imagine the problem seen at the
time was blt dumping core.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 pkgsrc/x11/blt/Makefile
cvs rdiff -u -r1.18 -r1.19 pkgsrc/x11/blt/distinfo
cvs rdiff -u -r1.8 -r1.9 pkgsrc/x11/blt/patches/patch-ae
cvs rdiff -u -r0 -r1.1 pkgsrc/x11/blt/patches/patch-src_bltArrayObj.c \
    pkgsrc/x11/blt/patches/patch-src_bltBgexec.c \
    pkgsrc/x11/blt/patches/patch-src_bltConfig.c \
    pkgsrc/x11/blt/patches/patch-src_bltInit.c \
    pkgsrc/x11/blt/patches/patch-src_bltList.c \
    pkgsrc/x11/blt/patches/patch-src_bltList.h \
    pkgsrc/x11/blt/patches/patch-src_bltObjConfig.c \
    pkgsrc/x11/blt/patches/patch-src_bltScrollbar.c \
    pkgsrc/x11/blt/patches/patch-src_bltSwitch.c \
    pkgsrc/x11/blt/patches/patch-src_bltTable.c \
    pkgsrc/x11/blt/patches/patch-src_bltTree.c \
    pkgsrc/x11/blt/patches/patch-src_bltTreeCmd.c \
    pkgsrc/x11/blt/patches/patch-src_bltUnixPipe.c \
    pkgsrc/x11/blt/patches/patch-src_bltVecObjCmd.c
cvs rdiff -u -r1.1 -r1.2 pkgsrc/x11/blt/patches/patch-src_bltNsUtil.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/x11/blt/Makefile
diff -u pkgsrc/x11/blt/Makefile:1.37 pkgsrc/x11/blt/Makefile:1.38
--- pkgsrc/x11/blt/Makefile:1.37        Sat Jan  1 15:21:14 2022
+++ pkgsrc/x11/blt/Makefile     Mon Jun  6 04:27:14 2022
@@ -1,13 +1,13 @@
-# $NetBSD: Makefile,v 1.37 2022/01/01 15:21:14 wiz Exp $
+# $NetBSD: Makefile,v 1.38 2022/06/06 04:27:14 dholland Exp $
 
 DISTNAME=      BLT2.4z
 PKGNAME=       blt-2.4z
-PKGREVISION=   12
+PKGREVISION=   13
 CATEGORIES=    x11
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=blt/}
 
-PATCHFILES=            blt2.4z-patch-2
 PATCH_SITES=           ${MASTER_SITES}
+PATCHFILES=            blt2.4z-patch-2
 PATCH_DIST_STRIP=      -p1
 
 MAINTAINER=    brook%nmsu.edu@localhost

Index: pkgsrc/x11/blt/distinfo
diff -u pkgsrc/x11/blt/distinfo:1.18 pkgsrc/x11/blt/distinfo:1.19
--- pkgsrc/x11/blt/distinfo:1.18        Sat Jan  1 15:21:14 2022
+++ pkgsrc/x11/blt/distinfo     Mon Jun  6 04:27:14 2022
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.18 2022/01/01 15:21:14 wiz Exp $
+$NetBSD: distinfo,v 1.19 2022/06/06 04:27:14 dholland Exp $
 
 BLAKE2s (BLT2.4z.tar.gz) = 21ffc805b1d2d90331a5a6ca37ae63bb09b7a79104fb579196e8f000646756c4
 SHA512 (BLT2.4z.tar.gz) = 6e59cc03c92b452ec3114675124c2095ed4206e7b9750452764f2b21b8c82dfc376a376f0fbc721c5d0e4b56734866cdc653f3d9888a5b36b0a7500da5f8942a
@@ -10,7 +10,21 @@ SHA1 (patch-aa) = 6a28cc2405adcc6037865f
 SHA1 (patch-ab) = da9479d5de1053c45753eef611eae2764909f0ec
 SHA1 (patch-ac) = 696f90010831522f46d67052abc0c6068197cfd9
 SHA1 (patch-ad) = cc2579223a5a8a764d797fa16a146999cd4a796d
-SHA1 (patch-ae) = 279b10615ec55c4e403b9d998b4b3904c01173c0
+SHA1 (patch-ae) = c1c2dc9f319f9e0da7af42f2b5d24639b1b5afdf
 SHA1 (patch-af) = b82641d4aad426fbe9a6781fa828d8aa81f71253
-SHA1 (patch-src_bltNsUtil.h) = 949647e6ca4a4890a51917c268289384da98b7ca
+SHA1 (patch-src_bltArrayObj.c) = 1f6d86f7be49f72b06bf053d5321608c9efa3410
+SHA1 (patch-src_bltBgexec.c) = ba01243277c4272d6a86ca2b85e167f40beb93e8
+SHA1 (patch-src_bltConfig.c) = 573942b97bbb8b607651c80e46c04314ba57c9f7
+SHA1 (patch-src_bltInit.c) = a85c7bcdb6a6eb7b5844f1770eefd10aea2d60ca
+SHA1 (patch-src_bltList.c) = e5280bdcc7b90d55923467c828d1ff3bd8669460
+SHA1 (patch-src_bltList.h) = fe0f21675b9504b16958526bb3f78d2d930501d9
+SHA1 (patch-src_bltNsUtil.h) = 31b62c5e12486195cfb2eea74bd1304acedaa342
+SHA1 (patch-src_bltObjConfig.c) = b4fabf9e9439a9f2ee24623f07e2ac72f0d0d4b2
+SHA1 (patch-src_bltScrollbar.c) = 66e2736a5dd7fc4bd7be4176f35a6a2208ace53e
+SHA1 (patch-src_bltSwitch.c) = 18962bb1dc3aa14d7c5fa773eb05908ec1638332
+SHA1 (patch-src_bltTable.c) = 7a2561eaf23378ea3aee6c6b81a1d5786f0b8659
+SHA1 (patch-src_bltTree.c) = 1402687b1496d82a6b9b6602926cb023285b9a96
+SHA1 (patch-src_bltTreeCmd.c) = 6ae6ad1f239c632d42607e7a23fb31d15281ff9a
+SHA1 (patch-src_bltUnixPipe.c) = 6311e9c17e6327b96fd3dd507f47aebe9b26dcef
+SHA1 (patch-src_bltVecObjCmd.c) = d7c63f88cba0d7dbd5691d9df5a6e2e84692f300
 SHA1 (patch-src_tkButton.c) = 39132933914ee8d52389f5be72cbc02b21e7216e

Index: pkgsrc/x11/blt/patches/patch-ae
diff -u pkgsrc/x11/blt/patches/patch-ae:1.8 pkgsrc/x11/blt/patches/patch-ae:1.9
--- pkgsrc/x11/blt/patches/patch-ae:1.8 Sat Jan  1 15:21:14 2022
+++ pkgsrc/x11/blt/patches/patch-ae     Mon Jun  6 04:27:14 2022
@@ -1,4 +1,4 @@
-$NetBSD: patch-ae,v 1.8 2022/01/01 15:21:14 wiz Exp $
+$NetBSD: patch-ae,v 1.9 2022/06/06 04:27:14 dholland Exp $
 
 --- configure.orig     2002-10-04 05:33:59.000000000 +0000
 +++ configure
@@ -13,7 +13,7 @@ $NetBSD: patch-ae,v 1.8 2022/01/01 15:21
      ;;
  esac
  
-@@ -4072,7 +4071,8 @@ fi
+@@ -4072,7 +4072,8 @@ fi
      EXTRA_LIB_SPECS="-ldl"
      ;;
  
@@ -23,7 +23,7 @@ $NetBSD: patch-ae,v 1.8 2022/01/01 15:21
      # Not available on all versions:  check for include file.
      ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
-@@ -4109,9 +4109,10 @@ test_ok=no
+@@ -4109,9 +4110,10 @@ test_ok=no
  fi
  
      if test "$test_ok" = yes; then
@@ -35,7 +35,7 @@ $NetBSD: patch-ae,v 1.8 2022/01/01 15:21
      fi
      ;;
  
-@@ -4181,9 +4182,9 @@ fi
+@@ -4181,9 +4183,9 @@ fi
    *-solaris2*)
  
      SHLIB_CFLAGS="-KPIC"

Index: pkgsrc/x11/blt/patches/patch-src_bltNsUtil.h
diff -u pkgsrc/x11/blt/patches/patch-src_bltNsUtil.h:1.1 pkgsrc/x11/blt/patches/patch-src_bltNsUtil.h:1.2
--- pkgsrc/x11/blt/patches/patch-src_bltNsUtil.h:1.1    Tue Aug 21 22:00:24 2012
+++ pkgsrc/x11/blt/patches/patch-src_bltNsUtil.h        Mon Jun  6 04:27:14 2022
@@ -1,4 +1,8 @@
-$NetBSD: patch-src_bltNsUtil.h,v 1.1 2012/08/21 22:00:24 marino Exp $
+$NetBSD: patch-src_bltNsUtil.h,v 1.2 2022/06/06 04:27:14 dholland Exp $
+
+- update version constraints on private decls of tcl functions
+  (probably none of these should be here at all as at least some
+  of them are unexposed tcl internals)
 
 --- src/bltNsUtil.h.orig       2002-07-18 06:35:32.000000000 +0000
 +++ src/bltNsUtil.h
@@ -22,3 +26,23 @@ $NetBSD: patch-src_bltNsUtil.h,v 1.1 201
  EXTERN Tcl_Namespace *Tcl_CreateNamespace _ANSI_ARGS_((Tcl_Interp *interp,
        char *name, ClientData clientData, Tcl_NamespaceDeleteProc *nsDelProc));
  
+@@ -75,7 +77,9 @@ EXTERN Tcl_Namespace *Tcl_FindNamespace 
+ EXTERN int Tcl_Export _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Namespace *nsPtr,
+       char *name, int resetFlag));
+ 
+-EXTERN Tcl_Var Tcl_FindNamespaceVar _ANSI_ARGS_((Tcl_Interp *interp, char *name,
++#endif /* TCL_MAJOR_VERSION >= 8 */
++
++EXTERN Tcl_Var Tcl_FindNamespaceVar _ANSI_ARGS_((Tcl_Interp *interp, const char *name,
+       Tcl_Namespace *contextNsPtr, int flags));
+ 
+ EXTERN void Tcl_PopCallFrame _ANSI_ARGS_((Tcl_Interp *interp));
+@@ -83,6 +87,8 @@ EXTERN void Tcl_PopCallFrame _ANSI_ARGS_
+ EXTERN int Tcl_PushCallFrame _ANSI_ARGS_((Tcl_Interp *interp,
+       Tcl_CallFrame * framePtr, Tcl_Namespace *nsPtr, int isProcCallFrame));
+ 
++#if (TCL_MAJOR_VERSION >= 8) && (TCL_MINOR_VERSION <= 4)
++
+ extern Tcl_HashTable *Blt_GetArrayVariableTable _ANSI_ARGS_((
+       Tcl_Interp *interp, CONST char *varName, int flags));
+ 

Added files:

Index: pkgsrc/x11/blt/patches/patch-src_bltArrayObj.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltArrayObj.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltArrayObj.c      Mon Jun  6 04:27:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_bltArrayObj.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Silence const warning.
+
+--- src/bltArrayObj.c~ 2002-07-12 18:38:47.000000000 +0000
++++ src/bltArrayObj.c
+@@ -54,7 +54,7 @@ SetArrayFromAny(interp, objPtr)
+     Blt_HashEntry *hPtr;
+     Blt_HashTable *tablePtr;
+     Tcl_Obj *elemObjPtr;
+-    Tcl_ObjType *oldTypePtr = objPtr->typePtr;
++    const Tcl_ObjType *oldTypePtr = objPtr->typePtr;
+     char **elemArr;
+     char *string;
+     int isNew;
Index: pkgsrc/x11/blt/patches/patch-src_bltBgexec.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltBgexec.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltBgexec.c        Mon Jun  6 04:27:14 2022
@@ -0,0 +1,94 @@
+$NetBSD: patch-src_bltBgexec.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+- For Tcl_File, which is unused in tcl 8.x, use a dummy type that
+doesn't cause warnings.
+
+- For Process on non-Windows, use the type that tcl itself expects,
+which is a pointer to an incomplete type. It is actually an int value
+in that pointer inside tcl, not a pointer, and casting pointers to int
+to pointers to pointers causes real problems on LP64 targets.
+
+- Relatedly, when calling Tcl_DetachPids, pass the right thing (a
+pointer to the Tcl_Pid) and not the Tcl_Pid's value itself.
+
+- Fix a null dereference calling NotifyOnUpdate, found by gcc10
+-Wuninitialized.
+
+- Don't use sprintf.
+
+--- src/bltBgexec.c.orig       2002-09-18 22:30:50.000000000 +0000
++++ src/bltBgexec.c
+@@ -44,7 +44,7 @@
+ #if (TCL_MAJOR_VERSION == 7)
+ #define FILEHANDLER_USES_TCLFILES 1
+ #else
+-typedef int Tcl_File;
++typedef void *Tcl_File;
+ #endif
+ 
+ static Tcl_CmdProc BgexecCmd;
+@@ -55,7 +55,7 @@ typedef struct {
+     HANDLE hProcess;
+ } Process;
+ #else
+-typedef int Process;
++typedef Tcl_Pid Process;
+ #endif
+ 
+ #if (TCL_VERSION_NUMBER <  _VERSION(8,1,0)) 
+@@ -1319,7 +1319,9 @@ CollectData(bgPtr, sinkPtr)
+           }
+       } else {
+           data = NextBlock(sinkPtr, &length);
+-          NotifyOnUpdate(bgPtr->interp, sinkPtr, data, length);
++          if (data != NULL) {
++              NotifyOnUpdate(bgPtr->interp, sinkPtr, data, length);
++          }
+       }
+     }
+     if (sinkPtr->status >= 0) {
+@@ -1463,7 +1465,7 @@ DestroyBackgroundInfo(bgPtr)
+ 
+       for (i = 0; i < bgPtr->nProcs; i++) {
+           if (bgPtr->signalNum > 0) {
+-              kill(bgPtr->procArr[i], bgPtr->signalNum);
++              kill((pid_t)(intptr_t)bgPtr->procArr[i], bgPtr->signalNum);
+           }
+ #ifdef WIN32
+           Tcl_DetachPids(1, (Tcl_Pid *)&bgPtr->procArr[i].pid);
+@@ -1471,7 +1473,7 @@ DestroyBackgroundInfo(bgPtr)
+ #if (TCL_MAJOR_VERSION == 7)
+           Tcl_DetachPids(1, &bgPtr->procArr[i]);
+ #else
+-          Tcl_DetachPids(1, (Tcl_Pid *)bgPtr->procArr[i]);
++          Tcl_DetachPids(1, &bgPtr->procArr[i]);
+ #endif /* TCL_MAJOR_VERSION == 7 */
+ #endif /* WIN32 */
+       }
+@@ -1516,7 +1518,7 @@ VariableProc(
+           register int i;
+ 
+           for (i = 0; i < bgPtr->nProcs; i++) {
+-              kill(bgPtr->procArr[i], bgPtr->signalNum);
++              kill((pid_t)(intptr_t)bgPtr->procArr[i], bgPtr->signalNum);
+           }
+       }
+     }
+@@ -1577,7 +1579,7 @@ TimerProc(clientData)
+ #ifdef WIN32
+       pid = WaitProcess(bgPtr->procArr[i], (int *)&waitStatus, WNOHANG);
+ #else
+-      pid = waitpid(bgPtr->procArr[i], (int *)&waitStatus, WNOHANG);
++      pid = waitpid((pid_t)(intptr_t)bgPtr->procArr[i], (int *)&waitStatus, WNOHANG);
+ #endif
+       if (pid == 0) {         /*  Process has not terminated yet */
+           if (nLeft < i) {
+@@ -1928,7 +1930,7 @@ BgexecCmd(clientData, interp, argc, argv
+ #ifdef WIN32
+           sprintf(string, "%u", (unsigned int)bgPtr->procArr[i].pid);
+ #else 
+-          sprintf(string, "%d", bgPtr->procArr[i]);
++          snprintf(string, sizeof(string), "%d", (int)(intptr_t)bgPtr->procArr[i]);
+ #endif
+           Tcl_AppendElement(interp, string);
+       }
Index: pkgsrc/x11/blt/patches/patch-src_bltConfig.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltConfig.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltConfig.c        Mon Jun  6 04:27:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_bltConfig.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Fix ctype abuse.
+
+--- src/bltConfig.c~   2002-09-18 22:30:51.000000000 +0000
++++ src/bltConfig.c
+@@ -1255,7 +1255,7 @@ Blt_ConfigureWidgetComponent(interp, par
+     tempName = Blt_Strdup(resName);
+ 
+     /* Window name can't start with an upper case letter */
+-    tempName[0] = tolower(resName[0]);
++    tempName[0] = tolower((unsigned char)resName[0]);
+ 
+     /*
+      * Create component if a child window by the component's name
Index: pkgsrc/x11/blt/patches/patch-src_bltInit.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltInit.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltInit.c  Mon Jun  6 04:27:14 2022
@@ -0,0 +1,53 @@
+$NetBSD: patch-src_bltInit.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Pass the right version string to the TCL package calls.
+Otherwise, the library fails to initialize.
+
+--- src/bltInit.c~     2022-06-06 01:11:32.563344735 +0000
++++ src/bltInit.c
+@@ -415,7 +415,7 @@ Blt_Init(interp)
+        * Check that the versions of Tcl that have been loaded are
+        * the same ones that BLT was compiled against.
+        */
+-      if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, EXACT) == NULL) {
++      if (Tcl_PkgRequire(interp, "Tcl", TCL_PATCH_LEVEL, EXACT) == NULL) {
+           return TCL_ERROR;
+       }
+       /* Set the "blt_version", "blt_patchLevel", and "blt_libPath" Tcl
+@@ -462,11 +462,11 @@ Blt_Init(interp)
+       Tcl_Namespace *nsPtr;
+ 
+ #if (TCL_VERSION_NUMBER >= _VERSION(8,1,0)) 
+-      if (Tcl_PkgPresent(interp, "Tk", TK_VERSION, EXACT) == NULL) {
++      if (Tcl_PkgPresent(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
+           return TCL_OK;
+       } 
+ #else
+-      if (Tcl_PkgRequire(interp, "Tk", TK_VERSION, EXACT) == NULL) {
++      if (Tcl_PkgRequire(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
+           Tcl_ResetResult(interp);
+           return TCL_OK;
+       } 
+@@ -514,7 +514,7 @@ Blt_Init(interp)
+        * Check that the versions of Tcl that have been loaded are
+        * the same ones that BLT was compiled against.
+        */
+-      if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, EXACT) == NULL) {
++      if (Tcl_PkgRequire(interp, "Tcl", TCL_PATCH_LEVEL, EXACT) == NULL) {
+           return TCL_ERROR;
+       }
+       /* Set the "blt_version", "blt_patchLevel", and "blt_libPath" Tcl
+@@ -552,11 +552,11 @@ Blt_Init(interp)
+       register Tcl_AppInitProc **p;
+ 
+ #if (TCL_VERSION_NUMBER >= _VERSION(8,1,0)) 
+-      if (Tcl_PkgPresent(interp, "Tk", TK_VERSION, EXACT) == NULL) {
++      if (Tcl_PkgPresent(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
+           return TCL_OK;
+       } 
+ #else
+-      if (Tcl_PkgRequire(interp, "Tk", TK_VERSION, EXACT) == NULL) {
++      if (Tcl_PkgRequire(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
+           Tcl_ResetResult(interp);
+           return TCL_OK;
+       } 
Index: pkgsrc/x11/blt/patches/patch-src_bltList.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltList.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltList.c  Mon Jun  6 04:27:14 2022
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_bltList.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Make the node type stuff consistent with bltHash to silence compiler warnings.
+
+--- src/bltList.c~     2002-09-18 22:30:51.000000000 +0000
++++ src/bltList.c
+@@ -114,7 +114,7 @@ FreeNode(nodePtr)
+ /*LINTLIBRARY*/
+ Blt_List 
+ Blt_ListCreate(type)
+-    int type;
++    size_t type;
+ {
+     struct Blt_ListStruct *listPtr;
+ 
+@@ -250,7 +250,7 @@ Blt_ListDestroy(listPtr)
+ void
+ Blt_ListInit(listPtr, type)
+     struct Blt_ListStruct *listPtr;
+-    int type;
++    size_t type;
+ {
+     listPtr->nNodes = 0;
+     listPtr->headPtr = listPtr->tailPtr = NULL;
Index: pkgsrc/x11/blt/patches/patch-src_bltList.h
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltList.h:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltList.h  Mon Jun  6 04:27:14 2022
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_bltList.h,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Make the node type stuff consistent with bltHash to silence compiler warnings.
+
+--- src/bltList.h~     2002-09-18 22:30:51.000000000 +0000
++++ src/bltList.h
+@@ -57,12 +57,12 @@ struct Blt_ListStruct {
+     struct Blt_ListNodeStruct *headPtr;       /* Pointer to first element in list */
+     struct Blt_ListNodeStruct *tailPtr;       /* Pointer to last element in list */
+     int nNodes;                       /* Number of node currently in the list. */
+-    int type;                 /* Type of keys in list. */
++    size_t type;              /* Type of keys in list. */
+ };
+ 
+-EXTERN void Blt_ListInit _ANSI_ARGS_((Blt_List list, int type));
++EXTERN void Blt_ListInit _ANSI_ARGS_((Blt_List list, size_t type));
+ EXTERN void Blt_ListReset _ANSI_ARGS_((Blt_List list));
+-EXTERN Blt_List Blt_ListCreate _ANSI_ARGS_((int type));
++EXTERN Blt_List Blt_ListCreate _ANSI_ARGS_((size_t type));
+ EXTERN void Blt_ListDestroy _ANSI_ARGS_((Blt_List list));
+ EXTERN Blt_ListNode Blt_ListCreateNode _ANSI_ARGS_((Blt_List list, 
+       CONST char *key));
Index: pkgsrc/x11/blt/patches/patch-src_bltObjConfig.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltObjConfig.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltObjConfig.c     Mon Jun  6 04:27:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_bltObjConfig.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Fix ctype abuse.
+
+--- src/bltObjConfig.c~        2002-09-18 22:30:51.000000000 +0000
++++ src/bltObjConfig.c
+@@ -2275,7 +2275,7 @@ Blt_ConfigureComponentFromObj(interp, pa
+     tmpName = Blt_Strdup(name);
+ 
+     /* Window name can't start with an upper case letter */
+-    tmpName[0] = tolower(name[0]);
++    tmpName[0] = tolower((unsigned char)name[0]);
+ 
+     /*
+      * Create component if a child window by the component's name
Index: pkgsrc/x11/blt/patches/patch-src_bltScrollbar.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltScrollbar.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltScrollbar.c     Mon Jun  6 04:27:14 2022
@@ -0,0 +1,35 @@
+$NetBSD: patch-src_bltScrollbar.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Update for tcl 8.6 (?) and don't use sprintf.
+
+--- src/bltScrollbar.c~        2002-07-17 22:38:54.000000000 +0000
++++ src/bltScrollbar.c
+@@ -534,7 +534,8 @@ ScrollbarWidgetCmd(clientData, interp, a
+       } else {
+           fraction = ((double)pixels / (double)barWidth);
+       }
+-      sprintf(interp->result, "%g", fraction);
++      snprintf(string, sizeof(string), "%g", fraction);
++      Tcl_SetResult(interp, string, TCL_VOLATILE);
+     } else if ((c == 'f') && (strncmp(argv[1], "fraction", length) == 0)) {
+       int x, y, pos, barWidth;
+       double fraction;
+@@ -567,7 +568,7 @@ ScrollbarWidgetCmd(clientData, interp, a
+       } else if (fraction > 1.0) {
+           fraction = 1.0;
+       }
+-      sprintf(string, "%g", fraction);
++      snprintf(string, sizeof(string), "%g", fraction);
+       Tcl_SetResult(interp, string, TCL_VOLATILE);
+     } else if ((c == 'g') && (strncmp(argv[1], "get", length) == 0)) {
+       if (argc != 2) {
+@@ -582,7 +583,8 @@ ScrollbarWidgetCmd(clientData, interp, a
+           Tcl_PrintDouble(interp, scrollPtr->lastFraction, last);
+           Tcl_AppendResult(interp, first, " ", last, (char *)NULL);
+       } else {
+-          sprintf(string, "%d %d %d %d", scrollPtr->totalUnits,
++          snprintf(string, sizeof(string),
++              "%d %d %d %d", scrollPtr->totalUnits,
+               scrollPtr->windowUnits, scrollPtr->firstUnit,
+               scrollPtr->lastUnit);
+           Tcl_SetResult(interp, string, TCL_VOLATILE);
Index: pkgsrc/x11/blt/patches/patch-src_bltSwitch.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltSwitch.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltSwitch.c        Mon Jun  6 04:27:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_bltSwitch.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Fix bug spotted by gcc10.
+
+--- src/bltSwitch.c~   2002-06-22 19:21:05.000000000 +0000
++++ src/bltSwitch.c
+@@ -285,7 +285,7 @@ Blt_ProcessSwitches(interp, specs, argc,
+     for (count = 0; count < argc; count++) {
+       arg = argv[count];
+       if (flags & BLT_SWITCH_OBJV_PARTIAL) {
+-          if ((arg[0] != '-') || ((arg[1] == '-') && (argv[2] == '\0'))) {
++          if ((arg[0] != '-') || ((arg[1] == '-') && (arg[2] == '\0'))) {
+               /* 
+                * If the argument doesn't start with a '-' (not a switch)
+                * or is '--', stop processing and return the number of
Index: pkgsrc/x11/blt/patches/patch-src_bltTable.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltTable.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltTable.c Mon Jun  6 04:27:14 2022
@@ -0,0 +1,51 @@
+$NetBSD: patch-src_bltTable.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Fix ctype abuse.
+
+--- src/bltTable.c~    2002-10-14 23:31:24.000000000 +0000
++++ src/bltTable.c
+@@ -1382,7 +1382,7 @@ ParseRowColumn2(tablePtr, string, number
+     int n;
+     PartitionInfo *infoPtr;
+ 
+-    c = tolower(string[0]);
++    c = tolower((unsigned char)string[0]);
+     if (c == 'c') {
+       infoPtr = &(tablePtr->columnInfo);
+     } else if (c == 'r') {
+@@ -2363,7 +2363,7 @@ ParseItem(tablePtr, string, rowPtr, colu
+     char c;
+     long partNum;
+ 
+-    c = tolower(string[0]);
++    c = tolower((unsigned char)string[0]);
+     *rowPtr = *columnPtr = -1;
+     if (c == 'r') {
+       if (Tcl_ExprLong(tablePtr->interp, string + 1, &partNum) != TCL_OK) {
+@@ -3827,7 +3827,7 @@ DeleteOp(dataPtr, interp, argc, argv)
+       return TCL_ERROR;
+     }
+     for (i = 3; i < argc; i++) {
+-      c = tolower(argv[i][0]);
++      c = tolower((unsigned char)argv[i][0]);
+       if ((c != 'r') && (c != 'c')) {
+           Tcl_AppendResult(interp, "bad index \"", argv[i],
+               "\": must start with \"r\" or \"c\"", (char *)NULL);
+@@ -3836,7 +3836,7 @@ DeleteOp(dataPtr, interp, argc, argv)
+     }
+     matches = 0;
+     for (i = 3; i < argc; i++) {
+-      c = tolower(argv[i][0]);
++      c = tolower((unsigned char)argv[i][0]);
+       infoPtr = (c == 'r') ? &(tablePtr->rowInfo) : &(tablePtr->columnInfo);
+       for (linkPtr = Blt_ChainFirstLink(infoPtr->chainPtr); linkPtr != NULL;
+           linkPtr = nextPtr) {
+@@ -4022,7 +4022,7 @@ ExtentsOp(dataPtr, interp, argc, argv)
+     if (Blt_GetTable(dataPtr, interp, argv[2], &tablePtr) != TCL_OK) {
+       return TCL_ERROR;
+     }
+-    c = tolower(argv[3][0]);
++    c = tolower((unsigned char)argv[3][0]);
+     if (c == 'r') {
+       infoPtr = &(tablePtr->rowInfo);
+     } else if (c == 'c') {
Index: pkgsrc/x11/blt/patches/patch-src_bltTree.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltTree.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltTree.c  Mon Jun  6 04:27:14 2022
@@ -0,0 +1,70 @@
+$NetBSD: patch-src_bltTree.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Silence gcc warnings in the interests of being able to see the
+real build problems.
+
+--- src/bltTree.c~     2022-06-06 02:53:11.389200304 +0000
++++ src/bltTree.c
+@@ -405,7 +405,7 @@ FreeNode(TreeObject *treeObjPtr, Node *n
+     TreeDestroyValues(nodePtr);
+     UnlinkNode(nodePtr);
+     treeObjPtr->nNodes--;
+-    hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)nodePtr->inode);
++    hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)(intptr_t)nodePtr->inode);
+     assert(hPtr);
+     Blt_DeleteHashEntry(&treeObjPtr->nodeTable, hPtr);
+     Blt_PoolFreeItem(treeObjPtr->nodePool, (char *)nodePtr);
+@@ -838,7 +838,7 @@ Blt_TreeCreateNode(
+     /* Generate an unique serial number for this node.  */
+     do {
+       inode = treeObjPtr->nextInode++;
+-      hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)inode, 
++      hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)(intptr_t)inode, 
+                  &isNew);
+     } while (!isNew);
+     nodePtr = NewNode(treeObjPtr, name, inode);
+@@ -893,7 +893,7 @@ Blt_TreeCreateNodeWithId(
+     int isNew;
+ 
+     treeObjPtr = parentPtr->treeObject;
+-    hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)inode, &isNew);
++    hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)(intptr_t)inode, &isNew);
+     if (!isNew) {
+       return NULL;
+     }
+@@ -999,7 +999,7 @@ Blt_TreeGetNode(TreeClient *clientPtr, u
+     TreeObject *treeObjPtr = clientPtr->treeObject;
+     Blt_HashEntry *hPtr;
+ 
+-    hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)inode);
++    hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)(uintptr_t)inode);
+     if (hPtr != NULL) {
+       return (Blt_TreeNode)Blt_GetHashValue(hPtr);
+     }
+@@ -2433,7 +2433,7 @@ Blt_TreeClearTags(TreeClient *clientPtr,
+       Blt_TreeTagEntry *tPtr;
+ 
+       tPtr = Blt_GetHashValue(hPtr);
+-      h2Ptr = Blt_FindHashEntry(&tPtr->nodeTable, (char *)node);
++      h2Ptr = Blt_FindHashEntry(&tPtr->nodeTable, node);
+       if (h2Ptr != NULL) {
+           Blt_DeleteHashEntry(&tPtr->nodeTable, h2Ptr);
+       }
+@@ -2461,7 +2461,7 @@ Blt_TreeHasTag(
+       return FALSE;
+     }
+     tPtr = Blt_GetHashValue(hPtr);
+-    hPtr = Blt_FindHashEntry(&tPtr->nodeTable, (char *)node);
++    hPtr = Blt_FindHashEntry(&tPtr->nodeTable, node);
+     if (hPtr == NULL) {
+       return FALSE;
+     }
+@@ -2495,7 +2495,7 @@ Blt_TreeAddTag(
+     } else {
+       tPtr = Blt_GetHashValue(hPtr);
+     }
+-    hPtr = Blt_CreateHashEntry(&tPtr->nodeTable, (char *)node, &isNew);
++    hPtr = Blt_CreateHashEntry(&tPtr->nodeTable, node, &isNew);
+     assert(hPtr);
+     if (isNew) {
+       Blt_SetHashValue(hPtr, node);
Index: pkgsrc/x11/blt/patches/patch-src_bltTreeCmd.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltTreeCmd.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltTreeCmd.c       Mon Jun  6 04:27:14 2022
@@ -0,0 +1,54 @@
+$NetBSD: patch-src_bltTreeCmd.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Silence gcc warnings in the interests of being able to see the
+real build problems.
+
+Fix ctype misuse.
+
+--- src/bltTreeCmd.c~  2002-09-27 22:23:01.000000000 +0000
++++ src/bltTreeCmd.c
+@@ -1283,7 +1283,7 @@ ParseNode5(TreeCmd *cmdPtr, char **argv,
+     if (parentId == -1) {     /* Dump marks root's parent as -1. */
+       node = dataPtr->root;
+       /* Create a mapping between the old id and the new node */
+-      hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)nodeId, 
++      hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)(intptr_t)nodeId,
+                  &isNew);
+       Blt_SetHashValue(hPtr, node);
+       Blt_TreeRelabelNode(cmdPtr->tree, node, names[0]);
+@@ -1293,7 +1293,7 @@ ParseNode5(TreeCmd *cmdPtr, char **argv,
+        * This can happen when there's a id collision with an
+        * existing node. 
+        */
+-      hPtr = Blt_FindHashEntry(&dataPtr->idTable, (char *)parentId);
++      hPtr = Blt_FindHashEntry(&dataPtr->idTable, (char *)(intptr_t)parentId);
+       if (hPtr != NULL) {
+           parent = Blt_GetHashValue(hPtr);
+       } else {
+@@ -1330,7 +1330,7 @@ ParseNode5(TreeCmd *cmdPtr, char **argv,
+       if (dataPtr->flags & RESTORE_OVERWRITE) {
+           node = Blt_TreeFindChild(parent, names[nNames - 1]);
+           /* Create a mapping between the old id and the new node */
+-          hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)nodeId, 
++          hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)(intptr_t)nodeId, 
+                                      &isNew);
+           Blt_SetHashValue(hPtr, node);
+       }
+@@ -1340,7 +1340,7 @@ ParseNode5(TreeCmd *cmdPtr, char **argv,
+               node = Blt_TreeCreateNode(cmdPtr->tree, parent, 
+                                         names[nNames - 1], -1);
+               /* Create a mapping between the old id and the new node */
+-              hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)nodeId,
++              hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)(intptr_t)nodeId,
+                                          &isNew);
+               Blt_SetHashValue(hPtr, node);
+           } else {
+@@ -1570,7 +1570,7 @@ GetTraceFlags(char *string)
+ 
+     flags = 0;
+     for (p = string; *p != '\0'; p++) {
+-      switch (toupper(*p)) {
++      switch (toupper((unsigned char)*p)) {
+       case 'R':
+           flags |= TREE_TRACE_READ;
+           break;
Index: pkgsrc/x11/blt/patches/patch-src_bltUnixPipe.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltUnixPipe.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltUnixPipe.c      Mon Jun  6 04:27:14 2022
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_bltUnixPipe.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Silence gcc warning in the interests of being able to see the
+real build problems.
+
+--- src/bltUnixPipe.c~ 2002-06-22 19:21:05.000000000 +0000
++++ src/bltUnixPipe.c
+@@ -477,7 +477,7 @@ CreateProcess(interp, argc, argv, inputF
+        * Reap the child process now if an error occurred during its
+        * startup.
+        */
+-      Tcl_WaitPid((Tcl_Pid)pid, &status, WNOHANG);
++      Tcl_WaitPid((Tcl_Pid)(intptr_t)pid, &status, WNOHANG);
+     }
+     if (errPipeIn >= 0) {
+       CloseFile(errPipeIn);
Index: pkgsrc/x11/blt/patches/patch-src_bltVecObjCmd.c
diff -u /dev/null pkgsrc/x11/blt/patches/patch-src_bltVecObjCmd.c:1.1
--- /dev/null   Mon Jun  6 04:27:14 2022
+++ pkgsrc/x11/blt/patches/patch-src_bltVecObjCmd.c     Mon Jun  6 04:27:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_bltVecObjCmd.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Fix ctype misuse.
+
+--- src/bltVecObjCmd.c~        2002-09-14 20:07:43.000000000 +0000
++++ src/bltVecObjCmd.c
+@@ -934,7 +934,7 @@ GetBinaryFormat(interp, string, sizePtr)
+ {
+     char c;
+ 
+-    c = tolower(string[0]);
++    c = tolower((unsigned char)string[0]);
+     if (Tcl_GetInt(interp, string + 1, sizePtr) != TCL_OK) {
+       Tcl_AppendResult(interp, "unknown binary format \"", string,
+           "\": incorrect byte size", (char *)NULL);



Home | Main Index | Thread Index | Old Index