]> gitweb.factorcode.org Git - factor.git/commitdiff
scrub memory>struct calls made redundant
authorJoe Groff <arcata@gmail.com>
Mon, 22 Feb 2010 20:22:29 +0000 (12:22 -0800)
committerJoe Groff <arcata@gmail.com>
Mon, 22 Feb 2010 20:22:29 +0000 (12:22 -0800)
basis/calendar/unix/unix.factor
basis/game/input/dinput/dinput.factor
basis/specialized-arrays/specialized-arrays.factor
basis/ui/backend/x11/x11.factor
basis/unix/groups/groups.factor
basis/unix/users/users.factor
basis/unix/utmpx/utmpx.factor
basis/windows/com/wrapper/wrapper.factor
basis/windows/uniscribe/uniscribe.factor

index ac72385d8c75a33d8ce55270a7cfcaf4b17eaa40..fdc85c943a422041d50848861ebec70fee6a6006 100644 (file)
@@ -21,7 +21,7 @@ IN: calendar.unix
     timespec>seconds since-1970 ;
 
 : get-time ( -- alien )
-    f time <time_t> localtime tm memory>struct ;
+    f time <time_t> localtime ;
 
 : timezone-name ( -- string )
     get-time zone>> ;
index e2c1fda75934280d392c8b286787c364f9e112ae..a95dbd06c3ae406a4b460554f6c26dcd4185aa65 100755 (executable)
@@ -94,7 +94,6 @@ SYMBOLS: +dinput+ +keyboard-device+ +keyboard-state+
 
 : find-device-axes-callback ( -- alien )
     [ ! ( lpddoi pvRef -- BOOL )
-        [ DIDEVICEOBJECTINSTANCEW memory>struct ] dip
         +controller-devices+ get at
         swap guidType>> {
             { [ dup GUID_XAxis = ] [ drop 0.0 >>x ] }
@@ -142,7 +141,7 @@ SYMBOLS: +dinput+ +keyboard-device+ +keyboard-state+
 
 : find-controller-callback ( -- alien )
     [ ! ( lpddi pvRef -- BOOL )
-        drop DIDEVICEINSTANCEW memory>struct guidInstance>> add-controller
+        drop guidInstance>> add-controller
         DIENUM_CONTINUE
     ] LPDIENUMDEVICESCALLBACKW ; inline
 
index 97ce2ed1ff10fe113c602d1bfd42a13d3a387a33..2aca62cc771c3a3b35cdfb4e6bf944ce2b921422 100644 (file)
@@ -143,9 +143,6 @@ PRIVATE>
     [ specialized-array-vocab ] [ '[ _ define-array ] ] bi
     generate-vocab ;
 
-M: c-type-word require-c-array define-array-vocab drop ;
-M: pointer require-c-array drop void* require-c-array ;
-
 ERROR: specialized-array-vocab-not-loaded c-type ;
 
 M: c-type-word c-array-constructor
index 673dd8e9c3899a592e42bdcca393a1f8b7ea4c35..74d911ef90d365f8f87450cd77745ca2e2d254be 100644 (file)
@@ -49,8 +49,7 @@ PIXEL-FORMAT-ATTRIBUTE-TABLE: glx-visual { $ GLX_USE_GL $ GLX_RGBA } H{
 
 M: x11-ui-backend (make-pixel-format)
     [ drop dpy get scr get ] dip
-    >glx-visual-int-array glXChooseVisual
-    XVisualInfo memory>struct ;
+    >glx-visual-int-array glXChooseVisual ;
 
 M: x11-ui-backend (free-pixel-format)
     handle>> XFree ;
index b009fe529fca0e4d1fd459da38fa54ac20a09c2c..7be124ced4c2f2568927259f4192d80e6c2eedcb 100644 (file)
@@ -83,7 +83,7 @@ M: integer user-groups ( id -- seq )
     user-name (user-groups) ;
     
 : all-groups ( -- seq )
-    [ unix.ffi:getgrent dup ] [ \ unix.ffi:group memory>struct group-struct>group ] produce nip ;
+    [ unix.ffi:getgrent dup ] [ group-struct>group ] produce nip ;
 
 : <group-cache> ( -- assoc )
     all-groups [ [ id>> ] keep ] H{ } map>assoc ;
index 5de176e2424cab7cad635cc40dec93470234a638..0575538b87aa8cc256b0871c7254e0753ce1def9 100644 (file)
@@ -37,7 +37,7 @@ PRIVATE>
 
 : all-users ( -- seq )
     [
-        [ unix.ffi:getpwent dup ] [ unix.ffi:passwd memory>struct passwd>new-passwd ] produce nip
+        [ unix.ffi:getpwent dup ] [ passwd>new-passwd ] produce nip
     ] with-pwent ;
 
 SYMBOL: user-cache
@@ -52,10 +52,10 @@ GENERIC: user-passwd ( obj -- passwd/f )
 
 M: integer user-passwd ( id -- passwd/f )
     user-cache get
-    [ at ] [ unix.ffi:getpwuid [ unix.ffi:passwd memory>struct passwd>new-passwd ] [ f ] if* ] if* ;
+    [ at ] [ unix.ffi:getpwuid [ passwd>new-passwd ] [ f ] if* ] if* ;
 
 M: string user-passwd ( string -- passwd/f )
-    unix.ffi:getpwnam dup [ unix.ffi:passwd memory>struct passwd>new-passwd ] when ;
+    unix.ffi:getpwnam dup [ passwd>new-passwd ] when ;
 
 : user-name ( id -- string )
     dup user-passwd
index 78556ab22524d7d5c4a3ba7d5ece2ed3b4ee1de7..1d6dfdedec12ab954fd2e9564e66ac47a47e368b 100644 (file)
@@ -41,7 +41,7 @@ M: unix new-utmpx-record
     utmpx-record new ;
     
 M: unix utmpx>utmpx-record ( utmpx -- utmpx-record )
-    [ new-utmpx-record ] dip \ utmpx memory>struct
+    [ new-utmpx-record ] dip
     {
         [ ut_user>> _UTX_USERSIZE memory>string >>user ]
         [ ut_id>>   _UTX_IDSIZE memory>string >>id ]
index 696902439ca7f9d075d29c6f5732594ad0cb37fc..623a9c8db3189e88a8d27b7f215256407a5c6451 100644 (file)
@@ -49,8 +49,7 @@ unless
 : (make-query-interface) ( interfaces -- quot )
     (query-interface-cases) 
     '[
-        swap GUID memory>struct
-        _ case
+        swap _ case
         [
             void* heap-size * rot <displaced-alien> com-add-ref
             swap 0 set-alien-cell S_OK
index 87540dc24f7b050124f7829a32ab5b99342a9bd7..2783840df066eccb88cfe69927c27117381d4c03 100644 (file)
@@ -82,7 +82,6 @@ TUPLE: script-string < disposable font string metrics ssa size image ;
 : script-string-size ( script-string -- dim )
     ssa>> ScriptString_pSize
     dup win32-error=0/f
-    SIZE memory>struct
     [ cx>> ] [ cy>> ] bi 2array ;
 
 : dc-metrics ( dc -- metrics )