]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorJoe Groff <arcata@gmail.com>
Mon, 31 Aug 2009 22:49:55 +0000 (17:49 -0500)
committerJoe Groff <arcata@gmail.com>
Mon, 31 Aug 2009 22:49:55 +0000 (17:49 -0500)
1  2 
basis/struct-arrays/struct-arrays.factor

index a378754590596f7b131679c3facf51aae4634bf8,390a03455d75d63066bf4f30fc2a56a17993f7f8..53815c7da4f052b0f7b4570eff9e91b53b9253c2
@@@ -41,17 -60,12 +60,15 @@@ M: struct-array resize ( n seq -- newse
  ERROR: bad-byte-array-length byte-array ;
  
  : byte-array>struct-array ( byte-array c-type -- struct-array )
-     [ heap-size [
+     [
+         heap-size
          [ dup length ] dip /mod 0 =
          [ drop bad-byte-array-length ] unless
-     ] keep ] [ c-type-struct-class ] bi struct-array boa ; inline
- : <direct-struct-array> ( alien length c-type -- struct-array )
-     [ heap-size ] [ c-type-struct-class ] bi struct-array boa ; inline
+     ] keep <direct-struct-array> ; inline
  
 +: struct-array-on ( struct length -- struct-array )
 +    [ [ >c-ptr ] [ class ] bi ] dip swap <direct-struct-array> ; inline    
 +
  : malloc-struct-array ( length c-type -- struct-array )
      [ heap-size calloc ] 2keep <direct-struct-array> ; inline