summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--ChangeLog6
-rw-r--r--unix/tclLoadDl.c19
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 <kennykb@acm.org>
+
+ * 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 <dkf@users.sf.net>
* 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;
}
/*