diff options
author | nijtmans <nijtmans> | 2010-05-19 08:23:09 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-05-19 08:23:09 (GMT) |
commit | 2bdf96f5608d4e27a76ad4080398df6885a6209a (patch) | |
tree | 31dbdbc468a888b7db0ce1c24b08964fe129d83b /generic/tclLoad.c | |
parent | 0f67d4faac5372c251720b6f818d319392f0b868 (diff) | |
download | tcl-2bdf96f5608d4e27a76ad4080398df6885a6209a.zip tcl-2bdf96f5608d4e27a76ad4080398df6885a6209a.tar.gz tcl-2bdf96f5608d4e27a76ad4080398df6885a6209a.tar.bz2 |
Don't use arrays of length 1, just use a single element then, it makes code more readable.
Diffstat (limited to 'generic/tclLoad.c')
-rw-r--r-- | generic/tclLoad.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclLoad.c b/generic/tclLoad.c index 8ba90ed..22f1c86 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.25 2010/04/02 21:21:06 kennykb Exp $ + * RCS: @(#) $Id: tclLoad.c,v 1.26 2010/05/19 08:23:09 nijtmans Exp $ */ #include "tclInt.h" @@ -129,7 +129,7 @@ Tcl_LoadObjCmd( InterpPackage *ipFirstPtr, *ipPtr; int code, namesMatch, filesMatch, offset; const char *symbols[2]; - void* procPtrs[1]; + Tcl_PackageInitProc *initProc; const char *p, *fullFileName, *packageName; Tcl_LoadHandle loadHandle; Tcl_UniChar ch; @@ -354,7 +354,7 @@ Tcl_LoadObjCmd( symbols[1] = NULL; Tcl_MutexLock(&packageMutex); - code = Tcl_LoadFile(interp, objv[1], symbols, 0, procPtrs, &loadHandle); + code = Tcl_LoadFile(interp, objv[1], symbols, 0, &initProc, &loadHandle); Tcl_MutexUnlock(&packageMutex); if (code != TCL_OK) { goto done; @@ -372,7 +372,7 @@ Tcl_LoadObjCmd( ckalloc((unsigned) (Tcl_DStringLength(&pkgName) + 1)); strcpy(pkgPtr->packageName, Tcl_DStringValue(&pkgName)); pkgPtr->loadHandle = loadHandle; - pkgPtr->initProc = (Tcl_PackageInitProc*) procPtrs[0]; + pkgPtr->initProc = initProc; pkgPtr->safeInitProc = (Tcl_PackageInitProc*) Tcl_FindSymbol(interp, loadHandle, Tcl_DStringValue(&safeInitName)); pkgPtr->unloadProc = (Tcl_PackageUnloadProc*) |