diff options
| author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-03-30 18:01:48 (GMT) |
|---|---|---|
| committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-03-30 18:01:48 (GMT) |
| commit | 5a1359a5e8aa149cea117f4f34239cd3a23872f4 (patch) | |
| tree | 85a0e53462d5b6da6b74451e0c3f9d59004369ed /generic/tclStringRep.h | |
| parent | edb3e7b8d2efcb3a1282f910f1e7120d5d34c6f8 (diff) | |
| download | tcl-5a1359a5e8aa149cea117f4f34239cd3a23872f4.zip tcl-5a1359a5e8aa149cea117f4f34239cd3a23872f4.tar.gz tcl-5a1359a5e8aa149cea117f4f34239cd3a23872f4.tar.bz2 | |
TIP 660. No compiler warnings. Tests suite pass on Win and Ubuntu
Diffstat (limited to 'generic/tclStringRep.h')
| -rw-r--r-- | generic/tclStringRep.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/generic/tclStringRep.h b/generic/tclStringRep.h index ab52ea8..d39f705 100644 --- a/generic/tclStringRep.h +++ b/generic/tclStringRep.h @@ -68,6 +68,10 @@ typedef struct { * field above. */ } String; +/* Limit on string lengths. The -1 because limit does not include the nul */ +#define STRING_MAXCHARS \ + ((Tcl_Size)((TCL_SIZE_MAX - offsetof(String, unicode))/sizeof(Tcl_UniChar) - 1)) +/* Memory needed to hold a string of length numChars - including NUL */ #define STRING_SIZE(numChars) \ (offsetof(String, unicode) + sizeof(Tcl_UniChar) + ((numChars) * sizeof(Tcl_UniChar))) #define stringAttemptAlloc(numChars) \ |
