Changeset 13466 in project for chicken


Ignore:
Timestamp:
03/03/09 18:57:13 (11 years ago)
Author:
Kon Lovett
Message:

Fix for core prim calls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/chicken-primitive-object-inlines.scm

    r13168 r13466  
    191191(define-inline (%eq? x y) (##core#inline "C_eqp" x y))
    192192
    193 ; (%peek-signed-integer BLOCK INDEX)
    194 ;
    195 (define-inline %peek-signed-integer (##core#primitive "C_peek_signed_integer"))
    196 
    197 ; (%peek-unsigned-integer BLOCK INDEX)
    198 ;
    199 (define-inline %peek-unsigned-integer (##core#primitive "C_peek_unsigned_integer"))
     193(define-inline (%peek-signed-integer b i) ((##core#primitive "C_peek_signed_integer") b i))
     194
     195(define-inline (%peek-unsigned-integer b i) ((##core#primitive "C_peek_unsigned_integer") b i))
    200196
    201197(define-inline (%poke-integer b i n) (##core#inline "C_poke_integer" b i n))
     
    244240; Fill is a character when 'byteblock?', otherwise any.
    245241;
    246 (define-inline %block-allocate (##core#primitive "C_allocate_vector"))
     242(define-inline (%block-allocate n bb f a) ((##core#primitive "C_allocate_vector") n bb f a))
    247243
    248244(define-inline (%block-address x) (##core#inline_allocate ("C_block_address" 4) x))
     
    448444;; Structure (wordblock)
    449445
    450 ;; (%make-structure tag fill)
    451 ;;
    452 
    453 ; (%make-structure TAG [SLOT ...])
    454 (define-inline %make-structure (##core#primitive "C_make_structure"))
     446(define-inline (%make-structure t . s) (apply (##core#primitive "C_make_structure") t s))
    455447
    456448(define-inline (%generic-structure? x) (and (%block? x) (%structure-type? x)))
    457449
    458450(define-inline (%structure-instance? x s) (##core#inline "C_i_structurep" x s))
    459 
    460 (cond-expand
    461   [hygienic-macros
    462     (define-syntax %structure?
    463       (syntax-rules ()
    464         [(_ ?x)     (%generic-structure? ?x)]
    465         [(_ ?x ?t)  (%structure-instance? ?x ?t)] ) ) ]
    466   [else
    467     (define-macro (%structure? ?x . ?t)
    468       (if (%null? ?t)
    469           `(%generic-structure? ,?x)
    470           `(%structure-instance? ,?x ,(car ?t)) ) ) ] )
    471451
    472452(define-inline (%structure-ref r i) (%block-word-ref r i))
     
    561541(define-inline (%symbol-bucket s) (%block-word-ref s 2))
    562542
    563 (define-inline %string->symbol-interned (##core#primitive "C_string_to_symbol"))
     543(define-inline (%string->symbol-interned s) ((##core#primitive "C_string_to_symbol") s))
    564544
    565545;(define-inline (%symbol-intern! s) (%string->symbol (%symbol-string s)))
     
    636616;; Simple-pointer (wordblock)
    637617
    638 (define-inline %make-simple-pointer (##core#primitive "C_make_pointer"))
     618(define-inline (%make-simple-pointer) ((##core#primitive "C_make_pointer")))
    639619
    640620(define-inline (%simple-pointer? x) (and (%block? x) (%simple-pointer-type? x)))
     
    658638;; Tagged-pointer (wordblock)
    659639
    660 (define-inline %make-tagged-pointer (##core#primitive "C_make_tagged_pointer"))
     640(define-inline (%make-tagged-pointer t) ((##core#primitive "C_make_tagged_pointer") t))
    661641
    662642(define-inline (%tagged-pointer? x) (and (%block? x) (%tagged-pointer-type? x)))
Note: See TracChangeset for help on using the changeset viewer.