summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2010-04-26 22:30:05 (GMT)
committerKevin B Kenny <kennykb@acm.org>2010-04-26 22:30:05 (GMT)
commit66d33c6513aced61bd81726fdbecf546712c36cf (patch)
tree6acb15f2dbc71fdc22022f4a6db35160c76a2a25 /unix
parent4138af452c3949c861b66d47a0f123966698f74d (diff)
downloadtcl-66d33c6513aced61bd81726fdbecf546712c36cf.zip
tcl-66d33c6513aced61bd81726fdbecf546712c36cf.tar.gz
tcl-66d33c6513aced61bd81726fdbecf546712c36cf.tar.bz2
* 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.
Diffstat (limited to 'unix')
-rw-r--r--unix/tclLoadDl.c19
1 files changed, 12 insertions, 7 deletions
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;
}
/*