From: Alex M. <ale...@us...> - 2007-07-06 09:06:42
|
Update of /cvsroot/win32forth/win32forth-stc/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12810/src Modified Files: paths.f primutil.f Log Message: arm: tidy up localalloc, remove uses of internal words _localalloc _localfree Index: primutil.f =================================================================== RCS file: /cvsroot/win32forth/win32forth-stc/src/primutil.f,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** primutil.f 21 May 2007 13:51:45 -0000 1.35 --- primutil.f 6 Jul 2007 09:06:39 -0000 1.36 *************** *** 263,267 **** : winver-init ( -- ) \ get windows version ! 148 dup _localalloc dup>r ! \ set length of structure r@ call GetVersionEx \ call os for version 0= abort" call failed" --- 263,267 ---- : winver-init ( -- ) \ get windows version ! 148 dup localalloc dup>r ! \ set length of structure r@ call GetVersionEx \ call os for version 0= abort" call failed" *************** *** 295,299 **** endof endcase to winver ! r>drop _localfree ; --- 295,299 ---- endof endcase to winver ! r>drop ; Index: paths.f =================================================================== RCS file: /cvsroot/win32forth/win32forth-stc/src/paths.f,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** paths.f 11 Dec 2006 10:42:37 -0000 1.7 --- paths.f 6 Jul 2007 09:06:39 -0000 1.8 *************** *** 36,48 **** 1 PROC PathRemoveExtension as (call-pre) ! : ("path-func") ( a1 n1 xt -- a2 n2 ) \ execute path function ! -rot \ save the xt under the string ! over >r \ save original address ! MAX-PATH _localalloc \ allocate space on stack ! ascii-z dup>r \ make a zstring ! swap execute drop \ call the function ! r> zcount \ count the chars ! _localfree ! nip r> swap \ use original address ; --- 36,47 ---- 1 PROC PathRemoveExtension as (call-pre) ! : ("path-func") ( a1 n1 xt -- a1 n2 ) \ execute path function a1 n1 xt ! localbuff >r \ allocate string space a1 n1 xt r:a2 ! -rot \ save the xt under the string xt a1 n1 r:a2 ! over r> swap >r \ swap addresses xt a1 n1 a2 r:a1 ! ascii-z dup>r \ make a zstring xt a2 r:a1 a2 ! swap execute drop \ call the function r:a1 a2 ! r> zcount \ count the chars a2 n2 r:a1 ! nip r> swap \ use original address a1 n2 ; *************** *** 64,71 **** \ *G return a2 and count=n1 of filename 2dup \ save originals ! MAX_PATH _LOCALALLOC ascii-z dup \ make zstring on the stack call PathFindFileName \ find the file part swap - /string \ remove the chars from caller - _LOCALFREE ; --- 63,69 ---- \ *G return a2 and count=n1 of filename 2dup \ save originals ! MAX_PATH LOCALALLOC ascii-z dup \ make zstring on the stack call PathFindFileName \ find the file part swap - /string \ remove the chars from caller ; *************** *** 356,364 **** : IsAbsolutePath? ( a1 n1 -- f ) \ *G Returns true if path is absolute. ! MAXCOUNTED _LOCALALLOC \ allocate a string dup>r place r@ +null \ move the string r> 1+ \ for call call PathIsRelative 0= \ call function - _LOCALFREE \ free buffer ; --- 354,361 ---- : IsAbsolutePath? ( a1 n1 -- f ) \ *G Returns true if path is absolute. ! MAXCOUNTED LOCALALLOC \ allocate a string dup>r place r@ +null \ move the string r> 1+ \ for call call PathIsRelative 0= \ call function ; |