summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-12 09:09:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-12 09:09:05 (GMT)
commit648f2bd64be3781ac7d0dc2777e5a77ff9d21e70 (patch)
treecf3ba7b5a710de362503d5d78b4073b5ef4a5fa9 /generic
parentbbb594048998c37ffff17a30ac1ababd1be5c9bf (diff)
parentb2a28063811abb4c3bbe540d8e42b24c571b4588 (diff)
downloadtcl-648f2bd64be3781ac7d0dc2777e5a77ff9d21e70.zip
tcl-648f2bd64be3781ac7d0dc2777e5a77ff9d21e70.tar.gz
tcl-648f2bd64be3781ac7d0dc2777e5a77ff9d21e70.tar.bz2
Merge 9.0
Diffstat (limited to 'generic')
-rw-r--r--generic/tclClock.c2
-rw-r--r--generic/tclClockFmt.c10
-rw-r--r--generic/tclDecls.h26
-rw-r--r--generic/tclInt.h7
-rw-r--r--generic/tclObj.c1
-rw-r--r--generic/tclStubInit.c4
6 files changed, 26 insertions, 24 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c
index 107d4e5..0664432 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -4007,7 +4007,7 @@ ClockFreeScan(
Tcl_DecrRefCount(tzObjStor);
} else {
/* simplest case - GMT / UTC */
- opts->timezoneObj = ClockSetupTimeZone(dataPtr, interp,
+ opts->timezoneObj = ClockSetupTimeZone(dataPtr, interp,
dataPtr->literals[LIT_GMT]);
}
if (opts->timezoneObj == NULL) {
diff --git a/generic/tclClockFmt.c b/generic/tclClockFmt.c
index edb74ae..e46043a 100644
--- a/generic/tclClockFmt.c
+++ b/generic/tclClockFmt.c
@@ -1070,7 +1070,7 @@ ObjListSearch(
const char *s, *f, *sf;
/* search in list */
for (i = 0; i < lstc; i++) {
- s = Tcl_GetStringFromObj(lstv[i], &l);
+ s = TclGetStringFromObj(lstv[i], &l);
if ( l >= minLen
&& (f = TclUtfFindEqualNC(yyInput, yyInput + maxLen, s, s + l, &sf)) > yyInput
@@ -2617,7 +2617,7 @@ ClockFmtToken_AMPM_Proc(
if (mcObj == NULL) {
return TCL_ERROR;
}
- s = Tcl_GetStringFromObj(mcObj, &len);
+ s = TclGetStringFromObj(mcObj, &len);
if (FrmResultAllocate(dateFmt, len) != TCL_OK) { return TCL_ERROR; };
memcpy(dateFmt->output, s, len + 1);
if (*tok->tokWord.start == 'p') {
@@ -2775,7 +2775,7 @@ ClockFmtToken_TimeZone_Proc(
return TCL_ERROR;
};
objPtr = dateFmt->date.tzName;
- s = Tcl_GetStringFromObj(objPtr, &len);
+ s = TclGetStringFromObj(objPtr, &len);
if (FrmResultAllocate(dateFmt, len) != TCL_OK) { return TCL_ERROR; };
memcpy(dateFmt->output, s, len + 1);
dateFmt->output += len;
@@ -2802,7 +2802,7 @@ ClockFmtToken_LocaleERA_Proc(
if (mcObj == NULL) {
return TCL_ERROR;
}
- s = Tcl_GetStringFromObj(mcObj, &len);
+ s = TclGetStringFromObj(mcObj, &len);
if (FrmResultAllocate(dateFmt, len) != TCL_OK) { return TCL_ERROR; };
memcpy(dateFmt->output, s, len + 1);
dateFmt->output += len;
@@ -2885,7 +2885,7 @@ ClockFmtToken_LocaleERAYear_Proc(
return TCL_OK;
}
}
- s = Tcl_GetStringFromObj(objPtr, &len);
+ s = TclGetStringFromObj(objPtr, &len);
if (FrmResultAllocate(dateFmt, len) != TCL_OK) { return TCL_ERROR; };
memcpy(dateFmt->output, s, len + 1);
dateFmt->output += len;
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index a2b0ec1..2acbb38 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -4158,19 +4158,17 @@ extern const TclStubs *tclStubsPtr;
# define Tcl_GetMaster Tcl_GetParent
#endif
-#ifdef USE_TCL_STUBS
- /* Protect those 10 functions, make them useless through the stub table */
-# undef TclGetStringFromObj
-# undef TclGetBytesFromObj
-# undef TclGetUnicodeFromObj
-# undef TclListObjGetElements
-# undef TclListObjLength
-# undef TclDictObjSize
-# undef TclSplitList
-# undef TclSplitPath
-# undef TclFSSplitPath
-# undef TclParseArgsObjv
-#endif
+/* Protect those 10 functions, make them useless through the stub table */
+#undef TclGetStringFromObj
+#undef TclGetBytesFromObj
+#undef TclGetUnicodeFromObj
+#undef TclListObjGetElements
+#undef TclListObjLength
+#undef TclDictObjSize
+#undef TclSplitList
+#undef TclSplitPath
+#undef TclFSSplitPath
+#undef TclParseArgsObjv
#if TCL_MAJOR_VERSION < 9
/* TIP #627 for 8.7 */
@@ -4236,7 +4234,7 @@ extern const TclStubs *tclStubsPtr;
TclGetBytesFromObj((interp), (objPtr), (sizePtr)) : \
(Tcl_GetBytesFromObj)((interp), (objPtr), (Tcl_Size *)(void *)(sizePtr)))
# define Tcl_GetStringFromObj(objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \
- TclGetStringFromObj((objPtr), (sizePtr)) : \
+ (TclGetStringFromObj)((objPtr), (sizePtr)) : \
(Tcl_GetStringFromObj)((objPtr), (Tcl_Size *)(void *)(sizePtr)))
# define Tcl_GetUnicodeFromObj(objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \
TclGetUnicodeFromObj((objPtr), (sizePtr)) : \
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 66edbb3..9ea31bc 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4397,6 +4397,11 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
#define TclGetString(objPtr) \
((objPtr)->bytes? (objPtr)->bytes : Tcl_GetString(objPtr))
+#define TclGetStringFromObj(objPtr, lenPtr) \
+ ((objPtr)->bytes \
+ ? (*(lenPtr) = (objPtr)->length, (objPtr)->bytes) \
+ : (Tcl_GetStringFromObj)((objPtr), (lenPtr)))
+
/*
*----------------------------------------------------------------
* Macro used by the Tcl core to clean out an object's internal
@@ -4588,7 +4593,7 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
#define TclNumUtfCharsM(numChars, bytes, numBytes) \
do { \
- Tcl_Size _count = 0, _i = (numBytes); \
+ Tcl_Size _count, _i = (numBytes); \
unsigned char *_str = (unsigned char *) (bytes); \
while (_i > 0 && (*_str < 0xC0)) { _i--; _str++; } \
_count = (numBytes) - _i; \
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 17cb6a4..5dd4545 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -1660,6 +1660,7 @@ Tcl_GetString(
*/
#if !defined(TCL_NO_DEPRECATED)
+#undef TclGetStringFromObj
char *
TclGetStringFromObj(
Tcl_Obj *objPtr, /* Object whose string rep byte pointer should
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 9072796..b48ec1b 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -73,10 +73,8 @@
# undef Tcl_WinConvertError
# define Tcl_WinConvertError 0
#endif
+#undef TclGetStringFromObj
#if defined(TCL_NO_DEPRECATED)
-# undef TclGetStringFromObj
-# undef TclGetBytesFromObj
-# undef TclGetUnicodeFromObj
# define TclGetStringFromObj 0
# define TclGetBytesFromObj 0
# define TclGetUnicodeFromObj 0