]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/macho/macho.factor
alien.c-types: not necessary to import `short` differently anymore
[factor.git] / extra / macho / macho.factor
index f404317123fcc93e04e37b31b631ee51e192dcef..1f0732b380e8c14ee5e0009fe30af66e019837cc 100644 (file)
@@ -4,8 +4,7 @@ USING: accessors alien alien.c-types alien.data alien.strings
 alien.syntax classes classes.struct combinators
 combinators.short-circuit io.encodings.ascii io.encodings.string
 kernel literals make math sequences specialized-arrays typed
-fry io.mmap formatting locals splitting endian arrays ;
-FROM: alien.c-types => short ;
+io.mmap formatting splitting endian ;
 IN: macho
 
 ! FFI data
@@ -944,7 +943,7 @@ TYPED: load-commands ( macho: mach_header_32/64 -- load-commands )
     [ symtab_command? ] filter ; inline
 
 : read-array-string ( uchar-array -- string )
-    ascii decode [ 0 = ] reject ;
+    ascii decode 0 swap remove ;
 
 : segment-sections ( segment-command -- sections )
     {
@@ -959,7 +958,7 @@ TYPED: load-commands ( macho: mach_header_32/64 -- load-commands )
 : sections-array ( segment-commands -- sections-array )
     [
         dup first segment_command_64?
-        [ section_64 ] [ section ] if <struct> ,
+        [ section_64 ] [ section ] if new ,
         segment-commands [ segment-sections [ , ] each ] each
     ] { } make ;