diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-01-25 11:53:59 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-01-25 11:53:59 (GMT) |
commit | 9907f028e850ebaaeb9c6ca06046e347bee0af70 (patch) | |
tree | 9e06fa941530d84e40e4dd352037537a750f1662 /generic | |
parent | f464b7f127e31aa1590da57c7c917c14126630ac (diff) | |
download | tcl-9907f028e850ebaaeb9c6ca06046e347bee0af70.zip tcl-9907f028e850ebaaeb9c6ca06046e347bee0af70.tar.gz tcl-9907f028e850ebaaeb9c6ca06046e347bee0af70.tar.bz2 |
Make Tcl_GetString() a macro calling Tcl_GetStringFromObj(). Just the same as Tcl_GetUnicode().
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclDecls.h | 3 | ||||
-rw-r--r-- | generic/tclObj.c | 1 | ||||
-rw-r--r-- | generic/tclTestObj.c | 6 |
3 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 0803448..dc39657 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -4138,7 +4138,10 @@ extern const TclStubs *tclStubsPtr; # endif #endif +#undef Tcl_GetString #undef Tcl_GetUnicode +#define Tcl_GetString(objPtr) \ + Tcl_GetStringFromObj(objPtr, (int *)NULL) #define Tcl_GetUnicode(objPtr) \ Tcl_GetUnicodeFromObj(objPtr, (int *)NULL) #ifdef TCL_NO_DEPRECATED diff --git a/generic/tclObj.c b/generic/tclObj.c index 882ec6b..421c1da 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -1617,6 +1617,7 @@ TclSetDuplicateObj( *---------------------------------------------------------------------- */ +#undef Tcl_GetString char * Tcl_GetString( Tcl_Obj *objPtr) /* Object whose string rep byte pointer should diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index a199ea0..17546a4 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -1176,7 +1176,7 @@ TeststringobjCmd( { Tcl_UniChar *unicode; int varIndex, option, i, length; - size_t size; + int size; #define MAX_STRINGS 11 const char *index, *string, *strings[MAX_STRINGS+1]; String *strPtr; @@ -1371,7 +1371,7 @@ TeststringobjCmd( if (Tcl_GetIntFromObj(interp, objv[3], &i) != TCL_OK) { return TCL_ERROR; } - if ((i < 0) || ((size_t)i > size)) { + if ((i < 0) || (i > size)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "index value out of range", -1)); return TCL_ERROR; @@ -1402,7 +1402,7 @@ TeststringobjCmd( if (Tcl_GetIntFromObj(interp, objv[3], &i) != TCL_OK) { return TCL_ERROR; } - if ((i < 0) || ((size_t)i > size)) { + if ((i < 0) || (i > size)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "index value out of range", -1)); return TCL_ERROR; |