anchor.diff:  (defgeneric marshal (arg tc buffer))
   
   (defmethod marshal (arg (type CORBA:TypeCode) buffer)
  -  (let ((kind (typecode-kind type))
  -        (params (typecode-params type)))
  +  (let ((kind (typecode-kind type)))
       (ecase kind
         ((:tk_any) (marshal-any arg buffer))
         ((:tk_octet) (marshal-octet arg buffer))
  -      ((:tk_char) (marshal-octet (char-code arg) buffer))
  +      ((:tk_char) (marshal-char arg buffer))
         ((:tk_boolean) (marshal-bool arg buffer))
  -      ((:tk_ushort :tk_short) (marshal-ushort arg buffer))
  +      ((:tk_ushort) (marshal-ushort arg buffer))
  +      ((:tk_short) (marshal-short arg buffer))
         ((:tk_ulong) (marshal-ulong arg buffer))
         ((:tk_long) (marshal-long arg buffer))
  -      ((:tk_enum) (marshal-enum arg type buffer))
  -      ((:tk_longlong :tk_ulonglong) (marshal-number arg 8 buffer))
  +      ((:tk_longlong) (marshal-longlong arg buffer))
  +      ((:tk_ulonglong) (marshal-ulonglong arg buffer))
         ((:tk_float) (marshal-float arg buffer))
         ((:tk_double) (marshal-double arg buffer))
         ((:tk_longdouble) (marshal-longdouble arg buffer))
         ((:tk_string) (marshal-string arg buffer))
  -      ((:tk_objref object) (marshal-object arg buffer))
  -      ((:tk_alias) (marshal arg (third params) buffer))
  +      ((:tk_objref) (marshal-object arg buffer))
         ((:tk_typecode) (marshal-typecode arg buffer))
  -      ((:tk_null))
  -      ((:tk_sequence)
  -       (let ((el_type (first params)))
  -         (marshal-sequence
  -          arg 
  -          (lambda (arg buffer) (marshal arg el_type buffer)) 
  -          buffer)))
  -      ((:tk_array)
  -       (let ((tc (first params))
  -             (len (second params)))
  -         (unless (= len (length arg))
  -           (error 'CORBA:MARSHAL))
  -         (doseq (el arg) (marshal el tc buffer)))))))
  +      ((:tk_null)))))
  +
   
   (defun marshal-multiple (values types buffer)
     (loop for val in values
  
positive.code: ;;;; Marshal
  
  (in-package :clorb)
  
  (defun marshal-octet (n buffer)
    (declare (type buffer buffer)
             (optimize (speed 3) (debug 0)))
    (vector-push-extend n (buffer-octets buffer) 400))
  
  (defun marshal-bool (s buffer)
    (marshal-octet (if s 1 0) buffer))
  
  (defun marshal-align (n buffer)
    (declare (type buffer buffer)
             (type (integer 0 8) n)
             (optimize (speed 3) (safety 1) (debug 0)))
    (let* ((octets (buffer-octets buffer))
           (start-pos (buffer-start-pos buffer))
           (skip (- n (logand (- (the buffer-index (fill-pointer octets))
                                 start-pos) 
                              (- n 1)))))
      (when (< skip n)
        (dotimes (x skip)
          (declare (type (integer 0 8) x))
          (vector-push-extend 0 octets) ))))
  
  #-clisp
  (defun marshal-number (n size buffer &optional (align size))
    (declare (fixnum size)
             (integer n)
             (optimize (speed 3) (debug 0) (safety 1)))
    (marshal-align align buffer)
    (loop for p from 0 by 8
  	for c fixnum below size
  	do (marshal-octet (ldb (byte 8 p) n) buffer)))
  
  ;;
  (#-clisp define-compiler-macro #+clisp defmacro
           marshal-number (&whole form n size buffer &optional (align size))
    (if (numberp size)
        (let ((nvar '#:nvar)
              (nnvar '#:nnvar)
              (bvar '#:bvar))
          `(let* (,@(if (> size 3) 
                        `((,nnvar ,n) 
                          (,nvar (logand ,nnvar #16rffffff)))
                        `((,nvar ,n)))
                  (,bvar ,buffer))
            ,@(if (> size 3)
                  `((declare (type (integer 0 #16rFFFFFF) ,nvar))))
            (marshal-align ,align ,bvar)
            (marshal-octet (logand #16rff ,nvar) ,bvar)
            ,@(loop for p from 8 by 8
                    for c from 1 below size
                    collect `(marshal-octet (ldb (byte 8 ,p) 
                                             ,(if (>= c 3) nnvar nvar)) 
                              ,bvar))))
        form))
  
  (defun marshal-short (n buffer)
    (declare (type (or CORBA:ushort CORBA:short) n)
             (optimize speed))
    (marshal-number n 2 buffer))
  
  (defun marshal-ushort (n buffer)
    (declare (type (or CORBA:ushort CORBA:short) n)
             (optimize speed))
    (marshal-number n 2 buffer))
  
  (defun marshal-ulong (n buffer)
    (declare (type CORBA:ulong n)
             (optimize speed))
    (marshal-number n 4 buffer))
  
  (defun marshal-long (n buffer)
    (declare (type CORBA:long n)
             (optimize speed))
    (marshal-number n 4 buffer))
  
  (defun float-as-ieee-integer (number sign-bit fraction-bits bias)
    (multiple-value-bind (frac expn sign)
  
negative.code:     (marshal-typecode tc buffer)
      (marshal (any-value arg) tc buffer)))
  
   
  
  
  
  