Skip to content

Commit

Permalink
Fix compiler warning on 32-bit platforms (ITCL_Z_MODIFIER -> TCL_SIZE…
Browse files Browse the repository at this point in the history
…_MODIFIER everywhere)
  • Loading branch information
jan.nijtmans committed Dec 26, 2024
1 parent 9098b1d commit 1bc89f1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion generic/itclClass.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]));

Expand Down
4 changes: 2 additions & 2 deletions generic/itclEnsemble.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion generic/itclHelpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 2 additions & 4 deletions generic/itclInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/*
Expand Down
2 changes: 1 addition & 1 deletion generic/itclObject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1bc89f1

Please sign in to comment.