diff options
author | das <das> | 2002-01-27 11:09:19 (GMT) |
---|---|---|
committer | das <das> | 2002-01-27 11:09:19 (GMT) |
commit | 22bb660bc6f7ab06cef0629d9f88a231ce5d2b7b (patch) | |
tree | 8f740075fb62f904aa60a596cb07aebb02849a6f /mac/tclMacLoad.c | |
parent | 107d41756017e763fb66994fb0ba6072b20a7d2b (diff) | |
download | tcl-22bb660bc6f7ab06cef0629d9f88a231ce5d2b7b.zip tcl-22bb660bc6f7ab06cef0629d9f88a231ce5d2b7b.tar.gz tcl-22bb660bc6f7ab06cef0629d9f88a231ce5d2b7b.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.
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; |