From cc240f86c997bfabb858ee9cac79fe0eee309355 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 2 Apr 2010 22:52:26 +0000 Subject: * generic/tclIOUtil.c (Tcl_LoadFile): Corrections to previous commit * unix/tclLoadDyld.c (TclpDlopen): to make it build on OSX. Also add missing ChangeLog entry for previous commit by KBK. --- ChangeLog | 38 ++++++++++++++++++++++++++++++++------ generic/tclIOUtil.c | 3 +-- unix/tclLoadDyld.c | 45 +++++++++++++++++++++++---------------------- 3 files changed, 56 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfeb154..75aadb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,13 +1,39 @@ +2010-04-02 Donal K. Fellows + + * generic/tclIOUtil.c (Tcl_LoadFile): Corrections to previous commit + * unix/tclLoadDyld.c (TclpDlopen): to make it build on OSX. + 2010-04-02 Kevin B. Kenny - * generic/tclStrToD.c: [Bug 2952904]: Defer creation of the smallest - floating point number until it is actually used. (This change avoids - a bogus syslog message regarding a 'floating point software assist + TIP #357 IMPLEMENTATION + + * generic/tcl.decls: First round of changes to export + * generic/tclDecls.h: Tcl_LoadFile, Tcl_FindSymbol, and + * generic/tclIOUtil.c: Tcl_FSUnloadFile to the public API. + * generic/tclInt.h: + * generic/tclLoad.c: + * generic/tclLoadNone.c: + * generic/tclStubInit.c: + * tests/fileSystem.test: + * tests/load.test: + * tests/unload.test: + * unix/tclLoadDl.c: + * unix/tclLoadDyld.c: + * unix/tclLoadNext.c: + * unix/tclLoadOSF.c: + * unix/tclLoadShl.c: + * unix/tclUnixPipe.c: + * win/Makefile.in: + * win/tclWinLoad.c: + + * generic/tclStrToD.c: [Bug 2952904]: Defer creation of the smallest + floating point number until it is actually used. (This change avoids a + bogus syslog message regarding a 'floating point software assist fault' on SGI systems.) - * library/reg/pkgIndex.tcl: [TIP #362]: Fixed first round of - * tests/registry.test: bugs resulting from the recent commits - * win/tclWinReg.c: of changes in support of the referenced + * library/reg/pkgIndex.tcl: [TIP #362]: Fixed first round of bugs + * tests/registry.test: resulting from the recent commits of + * win/tclWinReg.c: changes in support of the referenced TIP. 2010-03-31 Donal K. Fellows diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index c1e9430..f4dac35 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -17,7 +17,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOUtil.c,v 1.171 2010/04/02 21:21:06 kennykb Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.172 2010/04/02 22:52:26 dkf Exp $ */ #include "tclInt.h" @@ -3126,7 +3126,6 @@ Tcl_LoadFile( ret = TclpLoadMemory(interp, buffer, size, ret, handlePtr, &unloadProcPtr); if (ret == TCL_OK && *handlePtr != NULL) { - *clientDataPtr = *handlePtr; goto resolveSymbols; } } diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c index 2f833cd..bfdcc00 100644 --- a/unix/tclLoadDyld.c +++ b/unix/tclLoadDyld.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLoadDyld.c,v 1.35 2010/04/02 21:21:06 kennykb Exp $ + * RCS: @(#) $Id: tclLoadDyld.c,v 1.36 2010/04/02 22:52:26 dkf Exp $ */ #include "tclInt.h" @@ -86,21 +86,23 @@ MODULE_SCOPE long tclMacOSXDarwinRelease; #endif #ifdef TCL_DEBUG_LOAD -#define TclLoadDbgMsg(m, ...) do { \ - fprintf(stderr, "%s:%d: %s(): " m ".\n", \ - strrchr(__FILE__, '/')+1, __LINE__, __func__, ##__VA_ARGS__); \ - } while (0) +#define TclLoadDbgMsg(m, ...) \ + do { \ + fprintf(stderr, "%s:%d: %s(): " m ".\n", \ + strrchr(__FILE__, '/')+1, __LINE__, __func__, \ + ##__VA_ARGS__); \ + } while (0) #else #define TclLoadDbgMsg(m, ...) #endif - -/* Static functions defined in this file */ - -static void* FindSymbol(Tcl_Interp* interp, Tcl_LoadHandle loadHandle, - const char* symbol); -static void UnloadFile(Tcl_LoadHandle handle); +/* + * Static functions defined in this file. + */ +static void * FindSymbol(Tcl_Interp *interp, + Tcl_LoadHandle loadHandle, const char *symbol); +static void UnloadFile(Tcl_LoadHandle handle); #if TCL_DYLD_USE_NSMODULE || defined(TCL_LOAD_FROM_MEMORY) /* @@ -120,7 +122,7 @@ static void UnloadFile(Tcl_LoadHandle handle); *---------------------------------------------------------------------- */ -static const char* +static const char * DyldOFIErrorMsg( int err) { @@ -175,7 +177,7 @@ TclpDlopen( * file. */ { Tcl_DyldLoadHandle *dyldLoadHandle; - Tcl_LoadHandle* newHandle; + Tcl_LoadHandle newHandle; #if TCL_DYLD_USE_DLFCN void *dlHandle = NULL; #endif @@ -319,7 +321,7 @@ TclpDlopen( newHandle = (Tcl_LoadHandle) ckalloc(sizeof(*newHandle)); newHandle->clientData = dyldLoadHandle; newHandle->findSymbolProcPtr = &FindSymbol; - newHandle->unloadProcPtr = &UnloadFile; + newHandle->unloadFileProcPtr = &UnloadFile; *unloadProcPtr = &UnloadFile; *loadHandle = newHandle; result = TCL_OK; @@ -355,14 +357,13 @@ TclpDlopen( *---------------------------------------------------------------------- */ -static void* +static void * FindSymbol( Tcl_Interp *interp, /* For error reporting. */ Tcl_LoadHandle loadHandle, /* Handle from TclpDlopen. */ const char *symbol) /* Symbol name to look up. */ { - Tcl_DyldLoadHandle *dyldLoadHandle = - (Tcl_DyldLoadHandle *) (loadHandle->clientData); + Tcl_DyldLoadHandle *dyldLoadHandle = loadHandle->clientData; Tcl_PackageInitProc *proc = NULL; const char *errMsg = NULL; Tcl_DString ds; @@ -452,7 +453,8 @@ FindSymbol( Tcl_DStringFree(&ds); if (errMsg && (interp != NULL)) { Tcl_AppendResult(interp, errMsg, NULL); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, + NULL); } return proc; } @@ -483,8 +485,7 @@ UnloadFile( * TclpDlopen(). The loadHandle is a token * that represents the loaded file. */ { - Tcl_DyldLoadHandle *dyldLoadHandle = - (Tcl_DyldLoadHandle *) (loadHandle->clientData); + Tcl_DyldLoadHandle *dyldLoadHandle = loadHandle->clientData; #if TCL_DYLD_USE_DLFCN if (dyldLoadHandle->dlHandle) { @@ -519,8 +520,8 @@ UnloadFile( } #endif /* TCL_DYLD_USE_NSMODULE */ } - ckfree((char*) dyldLoadHandle); - ckfree((char*) loadHandle); + ckfree((char *) dyldLoadHandle); + ckfree((char *) loadHandle); } /* -- cgit v0.12