From 1bc89f104a4e725896fac414314e02edf2d53543 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 26 Dec 2024 21:56:56 +0000 Subject: [PATCH] Fix compiler warning on 32-bit platforms (ITCL_Z_MODIFIER -> TCL_SIZE_MODIFIER everywhere) --- generic/itclClass.c | 2 +- generic/itclEnsemble.c | 4 ++-- generic/itclHelpers.c | 2 +- generic/itclInt.h | 6 ++---- generic/itclObject.c | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/generic/itclClass.c b/generic/itclClass.c index 62158b6f..659f43fb 100644 --- a/generic/itclClass.c +++ b/generic/itclClass.c @@ -1552,7 +1552,7 @@ ItclClassCreateObject( do { Tcl_CmdInfo dummy; - sprintf(unique,"%.200s%" ITCL_Z_MODIFIER "u", Tcl_GetString(iclsPtr->namePtr), + sprintf(unique,"%.200s%" TCL_SIZE_MODIFIER "u", Tcl_GetString(iclsPtr->namePtr), iclsPtr->unique++); unique[0] = tolower(UCHAR(unique[0])); diff --git a/generic/itclEnsemble.c b/generic/itclEnsemble.c index f7cf9f17..a11b3aa3 100644 --- a/generic/itclEnsemble.c +++ b/generic/itclEnsemble.c @@ -786,7 +786,7 @@ CreateEnsemble( memset(ensData->parts, 0, ensData->maxParts*sizeof(EnsemblePart*)); Tcl_DStringInit(&buffer); Tcl_DStringAppend(&buffer, ITCL_COMMANDS_NAMESPACE "::ensembles::", TCL_INDEX_NONE); - sprintf(buf, "%" ITCL_Z_MODIFIER "u", ensData->ensembleId); + sprintf(buf, "%" TCL_SIZE_MODIFIER "u", ensData->ensembleId); Tcl_DStringAppend(&buffer, buf, TCL_INDEX_NONE); ensData->nsPtr = Tcl_CreateNamespace(interp, Tcl_DStringValue(&buffer), ensData, DeleteEnsemble); @@ -839,7 +839,7 @@ CreateEnsemble( Tcl_DStringSetLength(&buffer, 0); Tcl_DStringAppend(&buffer, infoPtr->ensembleInfo->ensembleNsPtr->fullName, TCL_INDEX_NONE); Tcl_DStringAppend(&buffer, "::subensembles::", TCL_INDEX_NONE); - sprintf(buf, "%" ITCL_Z_MODIFIER "u", parentEnsData->ensembleId); + sprintf(buf, "%" TCL_SIZE_MODIFIER "u", parentEnsData->ensembleId); Tcl_DStringAppend(&buffer, buf, TCL_INDEX_NONE); Tcl_DStringAppend(&buffer, "::", 2); Tcl_DStringAppend(&buffer, ensName, TCL_INDEX_NONE); diff --git a/generic/itclHelpers.c b/generic/itclHelpers.c index 9c83ae23..c6151365 100644 --- a/generic/itclHelpers.c +++ b/generic/itclHelpers.c @@ -129,7 +129,7 @@ ItclCreateArgList( "\" has argument with no name", NULL); } else { char buf[TCL_INTEGER_SPACE]; - sprintf(buf, "%" ITCL_Z_MODIFIER "d", i); + sprintf(buf, "%" TCL_SIZE_MODIFIER "d", i); Tcl_AppendResult(interp, "argument #", buf, " has no name", NULL); } diff --git a/generic/itclInt.h b/generic/itclInt.h index 75edbcc3..712ab05a 100644 --- a/generic/itclInt.h +++ b/generic/itclInt.h @@ -80,10 +80,8 @@ # endif #endif -#if TCL_MAJOR_VERSION == 8 -# define ITCL_Z_MODIFIER "" -#else -# define ITCL_Z_MODIFIER TCL_Z_MODIFIER +#if TCL_MAJOR_VERSION == 8 && defined(TCL_MINOR_VERSION) && TCL_MINOR_VERSION < 7 +# define TCL_SIZE_MODIFIER "" #endif /* diff --git a/generic/itclObject.c b/generic/itclObject.c index fddd2399..8b0a07e6 100644 --- a/generic/itclObject.c +++ b/generic/itclObject.c @@ -404,7 +404,7 @@ ItclCreateObject( do { Tcl_CmdInfo dummy; - sprintf(unique,"%.200s_%" ITCL_Z_MODIFIER "u", name, iclsPtr->unique++); + sprintf(unique,"%.200s_%" TCL_SIZE_MODIFIER "u", name, iclsPtr->unique++); unique[0] = tolower(UCHAR(unique[0])); Tcl_DStringSetLength(&buffer, 0);