From f2070308a370f83bf12bcd7d309a3a52bbe5a6d7 Mon Sep 17 00:00:00 2001 From: nijtmans Date: Fri, 19 Dec 2008 09:33:16 +0000 Subject: CONSTify TclGetLoadedPackages second param --- ChangeLog | 6 ++++++ generic/tclInt.decls | 4 ++-- generic/tclIntDecls.h | 6 +++--- generic/tclLoad.c | 20 ++++++++++---------- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfa1e01..e0a0e5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-19 Jan Nijtmans + + * generic/tclInt.decls CONSTify TclGetLoadedPackages second param + * generic/tclLoad.c + * generic/tclIntDecls.h (regenerated) + 2008-12-19 Don Porter * unix/Makefile.in: Update `make dist` target to include the files diff --git a/generic/tclInt.decls b/generic/tclInt.decls index b413a4a..433ba9b 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -13,7 +13,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tclInt.decls,v 1.134 2008/12/18 06:40:02 nijtmans Exp $ +# RCS: @(#) $Id: tclInt.decls,v 1.135 2008/12/19 09:33:16 nijtmans Exp $ library tcl @@ -168,7 +168,7 @@ declare 34 generic { # int TclGetLong(Tcl_Interp *interp, const char *str, long *longPtr) #} declare 37 generic { - int TclGetLoadedPackages(Tcl_Interp *interp, char *targetName) + int TclGetLoadedPackages(Tcl_Interp *interp, const char *targetName) } declare 38 generic { int TclGetNamespaceForQualName(Tcl_Interp *interp, const char *qualName, diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index b4adc16..1057bda 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIntDecls.h,v 1.129 2008/12/18 06:40:02 nijtmans Exp $ + * RCS: @(#) $Id: tclIntDecls.h,v 1.130 2008/12/19 09:33:16 nijtmans Exp $ */ #ifndef _TCLINTDECLS @@ -217,7 +217,7 @@ EXTERN int TclGetIntForIndex (Tcl_Interp * interp, #define TclGetLoadedPackages_TCL_DECLARED /* 37 */ EXTERN int TclGetLoadedPackages (Tcl_Interp * interp, - char * targetName); + const char * targetName); #endif #ifndef TclGetNamespaceForQualName_TCL_DECLARED #define TclGetNamespaceForQualName_TCL_DECLARED @@ -1140,7 +1140,7 @@ typedef struct TclIntStubs { int (*tclGetIntForIndex) (Tcl_Interp * interp, Tcl_Obj * objPtr, int endValue, int * indexPtr); /* 34 */ void *reserved35; void *reserved36; - int (*tclGetLoadedPackages) (Tcl_Interp * interp, char * targetName); /* 37 */ + int (*tclGetLoadedPackages) (Tcl_Interp * interp, const char * targetName); /* 37 */ int (*tclGetNamespaceForQualName) (Tcl_Interp * interp, const char * qualName, Namespace * cxtNsPtr, int flags, Namespace ** nsPtrPtr, Namespace ** altNsPtrPtr, Namespace ** actualCxtPtrPtr, const char ** simpleNamePtr); /* 38 */ TclObjCmdProcType (*tclGetObjInterpProc) (void); /* 39 */ int (*tclGetOpenMode) (Tcl_Interp * interp, const char * str, int * seekFlagPtr); /* 40 */ diff --git a/generic/tclLoad.c b/generic/tclLoad.c index 0f64137..e5b70c3 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLoad.c,v 1.22 2008/12/05 14:27:36 dkf Exp $ + * RCS: @(#) $Id: tclLoad.c,v 1.23 2008/12/19 09:33:16 nijtmans Exp $ */ #include "tclInt.h" @@ -137,7 +137,7 @@ Tcl_LoadObjCmd( const char *symbols[4]; Tcl_PackageInitProc **procPtrs[4]; ClientData clientData; - char *p, *fullFileName, *packageName; + const char *p, *fullFileName, *packageName; Tcl_LoadHandle loadHandle; Tcl_FSUnloadFileProc *unLoadProcPtr = NULL; Tcl_UniChar ch; @@ -179,7 +179,7 @@ Tcl_LoadObjCmd( target = interp; if (objc == 4) { - char *slaveIntName = Tcl_GetString(objv[3]); + const char *slaveIntName = Tcl_GetString(objv[3]); target = Tcl_GetSlave(interp, slaveIntName); if (target == NULL) { @@ -292,7 +292,7 @@ Tcl_LoadObjCmd( Tcl_Obj *splitPtr; Tcl_Obj *pkgGuessPtr; int pElements; - char *pkgGuess; + const char *pkgGuess; /* * The platform-specific code couldn't figure out the module @@ -505,7 +505,7 @@ Tcl_UnloadObjCmd( int i, index, code, complain = 1, keepLibrary = 0; int trustedRefCount = -1, safeRefCount = -1; const char *fullFileName = ""; - char *packageName; + const char *packageName; static const char *const options[] = { "-nocomplain", "-keeplibrary", "--", NULL }; @@ -581,7 +581,7 @@ Tcl_UnloadObjCmd( target = interp; if (objc - i == 3) { - char *slaveIntName = Tcl_GetString(objv[i + 2]); + const char *slaveIntName = Tcl_GetString(objv[i + 2]); target = Tcl_GetSlave(interp, slaveIntName); if (target == NULL) { @@ -872,8 +872,8 @@ Tcl_UnloadObjCmd( * Our result is the two reference counts. */ - objPtr[0] = Tcl_NewIntObj(trustedRefCount); - objPtr[1] = Tcl_NewIntObj(safeRefCount); + TclNewIntObj(objPtr[0], trustedRefCount); + TclNewIntObj(objPtr[1], safeRefCount); if (objPtr[0] == NULL || objPtr[1] == NULL) { if (objPtr[0]) { Tcl_DecrRefCount(objPtr[0]); @@ -882,7 +882,7 @@ Tcl_UnloadObjCmd( Tcl_DecrRefCount(objPtr[1]); } } else { - resultObjPtr = Tcl_NewListObj(2, objPtr); + TclNewListObj(resultObjPtr, 2, objPtr); if (resultObjPtr != NULL) { Tcl_SetObjResult(interp, resultObjPtr); } @@ -1018,7 +1018,7 @@ int TclGetLoadedPackages( Tcl_Interp *interp, /* Interpreter in which to return information * or error message. */ - char *targetName) /* Name of target interpreter or NULL. If + const char *targetName) /* Name of target interpreter or NULL. If * NULL, return info about all interps; * otherwise, just return info about this * interpreter. */ -- cgit v0.12