diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-07-13 07:33:57 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-07-13 07:33:57 (GMT) |
commit | a3eea6dc3f9b7ffcbcff6b1ee933f9ef1189df3f (patch) | |
tree | 6b969d5c8445849dfe47ca44caa7055fb1b60e68 /generic | |
parent | 9c5561ea5682d377441dd111da3730dc0be56abf (diff) | |
download | tcl-a3eea6dc3f9b7ffcbcff6b1ee933f9ef1189df3f.zip tcl-a3eea6dc3f9b7ffcbcff6b1ee933f9ef1189df3f.tar.gz tcl-a3eea6dc3f9b7ffcbcff6b1ee933f9ef1189df3f.tar.bz2 |
Fix build with -DTCL_NO_DEPRECATED
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclStringObj.c | 6 | ||||
-rw-r--r-- | generic/tclStubInit.c | 1 | ||||
-rw-r--r-- | generic/tclTest.c | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 130379f..b9d603d 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -68,7 +68,9 @@ static int SetStringFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static void SetUnicodeObj(Tcl_Obj *objPtr, const Tcl_UniChar *unicode, int numChars); static int UnicodeLength(const Tcl_UniChar *unicode); +#if !defined(TCL_NO_DEPRECATED) static int UTF16Length(const unsigned short *unicode); +#endif static void UpdateStringOfString(Tcl_Obj *objPtr); #if (TCL_UTF_MAX) > 3 && !defined(TCL_NO_DEPRECATED) static void DupUTF16StringInternalRep(Tcl_Obj *objPtr, @@ -979,6 +981,7 @@ Tcl_GetUnicodeFromObj( } #endif +#if !defined(TCL_NO_DEPRECATED) unsigned short * TclGetUnicodeFromObj( Tcl_Obj *objPtr, /* The object to find the unicode string @@ -1001,6 +1004,7 @@ TclGetUnicodeFromObj( } return stringPtr->unicode; } +#endif /* *---------------------------------------------------------------------- @@ -1481,7 +1485,6 @@ Tcl_SetUnicodeObj( TclInvalidateStringRep(objPtr); stringPtr->allocated = numChars; } -#endif static int UTF16Length( @@ -1497,6 +1500,7 @@ UTF16Length( stringCheckLimits(numChars); return numChars; } +#endif static int UnicodeLength( diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index eae72ba..2b7952d 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -96,6 +96,7 @@ static void uniCodePanic(void) { } # define Tcl_GetUnicode (unsigned short *(*)(Tcl_Obj *))(void *)uniCodePanic # define Tcl_GetUnicodeFromObj (unsigned short *(*)(Tcl_Obj *, int *))(void *)uniCodePanic +# define TclGetUnicodeFromObj (unsigned short *(*)(Tcl_Obj *, size_t *))(void *)uniCodePanic # define Tcl_NewUnicodeObj (Tcl_Obj *(*)(const unsigned short *, int))(void *)uniCodePanic # define Tcl_SetUnicodeObj (void(*)(Tcl_Obj *, const unsigned short *, int))(void *)uniCodePanic # define Tcl_AppendUnicodeToObj (void(*)(Tcl_Obj *, const unsigned short *, int))(void *)uniCodePanic diff --git a/generic/tclTest.c b/generic/tclTest.c index bf5741c..e3c6663 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -5195,14 +5195,12 @@ TestbytestringObjCmd( static int Testutf16stringObjCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { - int n = 0; - const Tcl_UniChar *p; - (void)dummy; + const unsigned short *p; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "string"); |