Changeset 36725 in project


Ignore:
Timestamp:
10/27/18 18:05:59 (3 weeks ago)
Author:
kon
Message:

reflow, more specific types, shorten type alias names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/message-digest-primitive/trunk/message-digest-primitive.scm

    r36722 r36725  
    4343;;
    4444
    45 (define (positive-fixnum? obj)
    46   (and (fixnum? obj) (positive? obj)) )
     45(define (positive-fixnum? obj) (and (fixnum? obj) (positive? obj)))
    4746
    48 (define (primitive-context-info? obj)
    49   (or (procedure? obj) (positive-fixnum? obj)) )
     47(define (primitive-context-info? obj) (or (procedure? obj) (positive-fixnum? obj)))
    5048
    51 (define (primitive-name? obj)
    52   (or (symbol? obj) (string? obj)) )
     49(define (primitive-name? obj) (or (symbol? obj) (string? obj)))
    5350
    5451;;; Message Digest Algorithm API
     
    5653;;
    5754
    58 (define-type message-digest-primitive-name (or symbol string))
     55(define-type primitive-name (or symbol string))
    5956
    60 (define-type message-digest-primitive-context-info (or fixnum procedure))
     57(define-type data-type (not immediate))
    6158
     59(define-type init-procedure (data-type -> *))
    6260;(foreign-lambda void ***Update     c-pointer   scheme-pointer  unsigned-int)
    6361;(foreign-lambda void ***RawUpdate  c-pointer   c-pointer       unsigned-int)
     62(define-type update-procedure (data-type data-type fixnum -> *))
     63(define-type final-procedure (data-type data-type -> *))
    6464
    65 (define-type message-digest-primitive-raw-update (or boolean procedure))
     65(define-type context-info (or fixnum procedure))
     66
     67(define-type raw-update-value (or boolean update-procedure))
    6668
    6769(define-type message-digest-primitive (struct message-digest-primitive))
     70
     71;;
    6872
    6973;assignment of value of type `(procedure
     
    7579;fixnum procedure procedure procedure fixnum (or symbol string) (or boolean
    7680;procedure)) (struct message-digest-primitive))'
    77 (: *make-message-digest-primitive (message-digest-primitive-context-info fixnum procedure procedure procedure fixnum message-digest-primitive-name message-digest-primitive-raw-update -> message-digest-primitive))
     81(: *make-message-digest-primitive (context-info fixnum init-procedure update-procedure final-procedure fixnum primitive-name raw-update-value -> message-digest-primitive))
    7882(: message-digest-primitive? (* -> boolean : message-digest-primitive))
    79 (: message-digest-primitive-context-info (message-digest-primitive --> message-digest-primitive-context-info))
     83(: message-digest-primitive-context-info (message-digest-primitive --> context-info))
    8084(: message-digest-primitive-digest-length (message-digest-primitive --> fixnum))
    81 (: message-digest-primitive-init (message-digest-primitive --> procedure))
    82 (: message-digest-primitive-update (message-digest-primitive --> procedure))
    83 (: message-digest-primitive-final (message-digest-primitive --> procedure))
     85(: message-digest-primitive-init (message-digest-primitive --> init-procedure))
     86(: message-digest-primitive-update (message-digest-primitive --> update-procedure))
     87(: message-digest-primitive-final (message-digest-primitive --> final-procedure))
    8488(: message-digest-primitive-block-length (message-digest-primitive --> fixnum))
    85 (: message-digest-primitive-name (message-digest-primitive --> message-digest-primitive-name))
    86 (: message-digest-primitive-raw-update (message-digest-primitive --> message-digest-primitive-raw-update))
     89(: message-digest-primitive-name (message-digest-primitive --> primitive-name))
     90(: message-digest-primitive-raw-update (message-digest-primitive --> raw-update-value))
    8791;
    8892(define-record-type message-digest-primitive
     
    118122;;
    119123
    120 ;(: scheme-object-data-pointer ())
     124(: scheme-object-data-pointer (data-type -> pointer))
     125;
    121126(define scheme-object-data-pointer
    122127  (foreign-lambda* c-pointer ((scheme-pointer psrc)) "C_return( psrc );"))
     
    124129;;
    125130
     131(: make-scheme-object-updater (update-procedure -> update-procedure))
     132;
    126133(define ((make-scheme-object-updater raw-update) ctx-info obj len)
    127134  (raw-update ctx-info (scheme-object-data-pointer obj) len) )
     
    130137
    131138;assignment of value of type `(procedure message-digest-primitive#make-message-digest-primitive (* * * * * #!rest) (struct message-digest-primitive#message-digest-primitive))' to toplevel variable `message-digest-primitive#make-message-digest-primitive' does not match declared type `(procedure message-digest-primitive#make-message-digest-primitive ((or fixnum procedure) fixnum procedure procedure procedure #!rest *) (struct message-digest-primitive))'
    132 (: make-message-digest-primitive (message-digest-primitive-context-info fixnum procedure (or boolean procedure) procedure #!rest -> message-digest-primitive))
     139(: make-message-digest-primitive (context-info fixnum init-procedure (or boolean update-procedure) final-procedure #!rest -> message-digest-primitive))
    133140;
    134141(define (make-message-digest-primitive ctx-info digest-len init update final
Note: See TracChangeset for help on using the changeset viewer.