summaryrefslogtreecommitdiffstats
path: root/generic/tclInt.h
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r--generic/tclInt.h7
1 files changed, 6 insertions, 1 deletions
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; \