From 66d33c6513aced61bd81726fdbecf546712c36cf Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Mon, 26 Apr 2010 22:30:05 +0000 Subject: * unix/tclLoadDl.c (FindSymbol): [Bug 2992295]: Simplified the logic so that the casts added in Donal Fellows's change for the same bug are no longer necessary. --- ChangeLog | 6 ++++++ unix/tclLoadDl.c | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 67ec5bb..99b0df2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-04-27 Kevin B. Kenny + + * unix/tclLoadDl.c (FindSymbol): [Bug 2992295]: Simplified the + logic so that the casts added in Donal Fellows's change for the + same bug are no longer necessary. + 2010-04-26 Donal K. Fellows * unix/tclLoadDl.c (FindSymbol): [Bug 2992295]: Added an explicit cast diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c index 71349bb..b0bff77 100644 --- a/unix/tclLoadDl.c +++ b/unix/tclLoadDl.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: tclLoadDl.c,v 1.22 2010/04/26 13:49:12 dkf Exp $ + * RCS: @(#) $Id: tclLoadDl.c,v 1.23 2010/04/26 22:30:05 kennykb Exp $ */ #include "tclInt.h" @@ -144,10 +144,15 @@ FindSymbol( Tcl_LoadHandle loadHandle, /* Value from TcpDlopen(). */ const char *symbol) /* Symbol to look up. */ { - const char *native; - Tcl_DString newName, ds; + const char *native; /* Name of the library to be loaded, in + * system encoding */ + Tcl_DString newName, ds; /* Buffers for converting the name to + * system encoding and prepending an + * underscore*/ void *handle = (void *) loadHandle->clientData; - Tcl_PackageInitProc *proc; + /* Native handle to the loaded library */ + void *proc; /* Address corresponding to the resolved + * symbol */ /* * Some platforms still add an underscore to the beginning of symbol @@ -156,12 +161,12 @@ FindSymbol( */ native = Tcl_UtfToExternalDString(NULL, symbol, -1, &ds); - proc = (Tcl_PackageInitProc *) dlsym(handle, native); /* INTL: Native. */ + proc = dlsym(handle, native); /* INTL: Native. */ if (proc == NULL) { Tcl_DStringInit(&newName); Tcl_DStringAppend(&newName, "_", 1); native = Tcl_DStringAppend(&newName, native, -1); - proc = (Tcl_PackageInitProc *) dlsym(handle, native); /* INTL: Native. */ + proc = dlsym(handle, native); /* INTL: Native. */ Tcl_DStringFree(&newName); } Tcl_DStringFree(&ds); @@ -172,7 +177,7 @@ FindSymbol( Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, NULL); } - return (void *) proc; + return proc; } /* -- cgit v0.12