diff options
author | das <das@noemail.net> | 2002-01-27 11:09:18 (GMT) |
---|---|---|
committer | das <das@noemail.net> | 2002-01-27 11:09:18 (GMT) |
commit | 30eca791b646b2d2f2f5a7f817b289d32751b65e (patch) | |
tree | 8f740075fb62f904aa60a596cb07aebb02849a6f /mac/tclMacLoad.c | |
parent | da60cfbf6311b66574506fff568f0ffcf2165dcc (diff) | |
download | tcl-30eca791b646b2d2f2f5a7f817b289d32751b65e.zip tcl-30eca791b646b2d2f2f5a7f817b289d32751b65e.tar.gz tcl-30eca791b646b2d2f2f5a7f817b289d32751b65e.tar.bz2 |
* generic/tclInt.decls:
* generic/tclIntPlatDecls.h:
* mac/tclMacChan.c:
* mac/tclMacFCmd.c:
* mac/tclMacFile.c:
* mac/tclMacInit.c:
* mac/tclMacLoad.c:
* mac/tclMacResource.c:
* mac/tclMacSock.c: TIP 27 CONSTification induced changes
* tests/event.test:
* tests/main.test: added catches/constraints to test that
use features that don't exist on the mac.
FossilOrigin-Name: 02f6dcb5d2e40852b7e678559c5f3964c826593e
Diffstat (limited to 'mac/tclMacLoad.c')
-rw-r--r-- | mac/tclMacLoad.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/mac/tclMacLoad.c b/mac/tclMacLoad.c index 1082a23..e767651 100644 --- a/mac/tclMacLoad.c +++ b/mac/tclMacLoad.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacLoad.c,v 1.11 2002/01/18 03:22:58 das Exp $ + * RCS: @(#) $Id: tclMacLoad.c,v 1.12 2002/01/27 11:09:58 das Exp $ */ #include <CodeFragments.h> @@ -126,11 +126,11 @@ TclpLoadFile( UInt32 offset = 0; UInt32 length = kCFragGoesToEOF; StringPtr fragName=NULL; - Str255 errName; + Str255 errName, symbolName; Tcl_DString ds; - char *native; + CONST char *native; - native = (char *) Tcl_FSGetNativePath(pathPtr); + native = Tcl_FSGetNativePath(pathPtr); err = FSpLocationFromPath(strlen(native), native, &fileSpec); if (err != noErr) { @@ -145,7 +145,7 @@ TclpLoadFile( * it to us. */ native = Tcl_UtfToExternalDString(NULL, sym1, -1, &ds); - native[strlen(native) - 5] = 0; + Tcl_DStringSetLength(&ds, Tcl_DStringLength(&ds) - 5); /* * See if this fragment has a 'cfrg' resource. It will tell us where @@ -215,9 +215,10 @@ TclpLoadFile( *unloadProcPtr = &TclpUnloadFile; - native = Tcl_UtfToExternalDString(NULL, sym1, -1, &ds); - c2pstr(native); - err = FindSymbol(connID, (StringPtr) native, (Ptr *) proc1Ptr, &symClass); + Tcl_UtfToExternalDString(NULL, sym1, -1, &ds); + strcpy((char *) symbolName + 1, Tcl_DStringValue(&ds)); + symbolName[0] = (unsigned) Tcl_DStringLength(&ds); + err = FindSymbol(connID, symbolName, (Ptr *) proc1Ptr, &symClass); Tcl_DStringFree(&ds); if (err != fragNoErr || symClass == kDataCFragSymbol) { Tcl_SetResult(interp, @@ -226,9 +227,10 @@ TclpLoadFile( return TCL_ERROR; } - native = Tcl_UtfToExternalDString(NULL, sym2, -1, &ds); - c2pstr(native); - err = FindSymbol(connID, (StringPtr) native, (Ptr *) proc2Ptr, &symClass); + Tcl_UtfToExternalDString(NULL, sym2, -1, &ds); + strcpy((char *) symbolName + 1, Tcl_DStringValue(&ds)); + symbolName[0] = (unsigned) Tcl_DStringLength(&ds); + err = FindSymbol(connID, symbolName, (Ptr *) proc2Ptr, &symClass); Tcl_DStringFree(&ds); if (err != fragNoErr || symClass == kDataCFragSymbol) { *proc2Ptr = NULL; |