r2786: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 20 Sep 2002 06:03:36 +0000 (06:03 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 20 Sep 2002 06:03:36 +0000 (06:03 +0000)
ChangeLog
examples/compress.cl
examples/union.cl
src-main/aggregates.cl
tests/compress.cl
tests/union.cl

index 35e3f51187bccb9378ebf0301eb17de4cd5c3ac0..6a534db158e197ed85a508244c708d26655d4e64 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,14 @@
 2002-09-19 Kevin Rosenberg (kevin@rosenberg.net)
         - Integrate John Desoi's OpenMCL support into src-mcl
        * examples/Makefile: add section for building on MacOS X (John Desoi)
-       * examples/test-examples: changed from mk: to asdf: package loading
-       * examples/run-examples: changed from mk: to asdf: package loading, 
+       * examples/test-examples: changed from mk: to asdf: package loading (KMR)
+       * examples/run-examples: changed from mk: to asdf: package loading (KMR)
        add conditional loading if UFFI not loaded (John Desoi)
-       * examples/compress.cl: Add dylib to library types for MacOSX (John Desoi)
+       * examples/compress.cl: Add dylib to library types for MacOSX (John Desoi),
+       converted compressed output to hexidecimal display (KMR)
+       * examples/union.cl: Rework the tests (KMR)
        * src-main/libraries.cl: add dylib as default library type on MacOSX (John Desoi)
+       * src-main/aggregates.cl: convert from uffi type in deref-array (John Desoi)
        
 2002-09-16 Kevin Rosenberg (kevin@rosenberg.net)
        - Restructure directories to move to a asdf definition file
index 475be125129cbc584147ec3e5123125b5905dd84..1abaff6a4542dd831d4a05d02d0a14221a1e5c49 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: compress.cl,v 1.12 2002/09/20 04:51:14 kevin Exp $
+;;;; $Id: compress.cl,v 1.13 2002/09/20 06:03:36 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 (progn
   (flet ((print-results (str)
           (multiple-value-bind (compressed len) (compress str)
-              (format t "~&(compress ~S) => ~S,~D" str compressed len))))
+              (format t "~&(compress ~S) => " str)
+              (dotimes (i len)
+                (format t "~X" (char-code (char compressed i))))
+              (format t ",~D" len))))
     (print-results "")
     (print-results "test")
     (print-results "test2")))
+
+;; Results of the above on my system:
+;; (compress "") => 789c300001,8
+;; (compress "test") => 789c2b492d2e1045d1c1,12
+;; (compress "test2") => 789c2b492d2e31206501f3,13
index 967fc25b1ef73ca6d64901cb1c25ffc05d1a0d2b..7a1e72ca095cc735ad8e5311fdb8ef5abfebfad5 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Mar 2002
 ;;;;
-;;;; $Id: union.cl,v 1.8 2002/09/20 05:38:01 kevin Exp $
+;;;; $Id: union.cl,v 1.9 2002/09/20 06:03:36 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 (defun run-union-1 ()
   (let ((u (uffi:allocate-foreign-object 'tunion1)))
     (setf (uffi:get-slot-value u 'tunion1 'uint)
-         #-sparc
-         (+ (* 1 (char-code #\A))
-            (* 256 (char-code #\B))
-            (* 65536 (char-code #\C))
-            (* 16777216 255))
-         #+(or sparc sparc-v9)
-         (+ (* 16777216 (char-code #\A))
-            (* 65536 (char-code #\B))
-            (* 256 (char-code #\C))
-            (* 1 255)))
+      ;; little endian
+      #-(or sparc sparc-v9 powerpc ppc)
+      (+ (* 1 (char-code #\A))
+        (* 256 (char-code #\B))
+        (* 65536 (char-code #\C))
+        (* 16777216 128))
+      ;; big endian
+      #+(or sparc sparc-v9 powerpc ppc)
+      (+ (* 16777216 (char-code #\A))
+        (* 65536 (char-code #\B))
+        (* 256 (char-code #\C))
+        (* 1 128)))
     (format *standard-output* "~&Should be #\A: ~S" 
            (uffi:ensure-char-character 
             (uffi:get-slot-value u 'tunion1 'char)))
 (defun test-union-1 ()
   (let ((u (uffi:allocate-foreign-object 'tunion1)))
     (setf (uffi:get-slot-value u 'tunion1 'uint)
-         #-sparc
+         #-(or sparc sparc-v9 powerpc ppc)
          (+ (* 1 (char-code #\A))
             (* 256 (char-code #\B))
             (* 65536 (char-code #\C))
             (* 16777216 128))
-         #+(or sparc sparc-v9)
+         #+(or sparc sparc-v9 powerpc ppc)
          (+ (* 16777216 (char-code #\A))
             (* 65536 (char-code #\B))
             (* 256 (char-code #\C))
index f2df49c86c7e6fe1bb72122510d53c35dcec3627..6a912cecca9529edb44464de8d2065baac912222 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: aggregates.cl,v 1.1 2002/09/16 17:54:30 kevin Exp $
+;;;; $Id: aggregates.cl,v 1.2 2002/09/20 06:03:36 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -110,7 +110,7 @@ of the enum-name name, separator-string, and field-name"
   #+(or lispworks cmu) (declare (ignore type))
   #+cmu  `(alien:deref ,obj ,i)
   #+lispworks `(fli:dereference ,obj :index ,i)
-  #+allegro `(ff:fslot-value-typed ,type :c ,obj ,i)
+  #+allegro `(ff:fslot-value-typed ,(convert-from-uffi-type type :type) :c ,obj ,i)
   )
 
 (defmacro def-union (name &rest fields)
index 475be125129cbc584147ec3e5123125b5905dd84..1abaff6a4542dd831d4a05d02d0a14221a1e5c49 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: compress.cl,v 1.12 2002/09/20 04:51:14 kevin Exp $
+;;;; $Id: compress.cl,v 1.13 2002/09/20 06:03:36 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 (progn
   (flet ((print-results (str)
           (multiple-value-bind (compressed len) (compress str)
-              (format t "~&(compress ~S) => ~S,~D" str compressed len))))
+              (format t "~&(compress ~S) => " str)
+              (dotimes (i len)
+                (format t "~X" (char-code (char compressed i))))
+              (format t ",~D" len))))
     (print-results "")
     (print-results "test")
     (print-results "test2")))
+
+;; Results of the above on my system:
+;; (compress "") => 789c300001,8
+;; (compress "test") => 789c2b492d2e1045d1c1,12
+;; (compress "test2") => 789c2b492d2e31206501f3,13
index 967fc25b1ef73ca6d64901cb1c25ffc05d1a0d2b..7a1e72ca095cc735ad8e5311fdb8ef5abfebfad5 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Mar 2002
 ;;;;
-;;;; $Id: union.cl,v 1.8 2002/09/20 05:38:01 kevin Exp $
+;;;; $Id: union.cl,v 1.9 2002/09/20 06:03:36 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 (defun run-union-1 ()
   (let ((u (uffi:allocate-foreign-object 'tunion1)))
     (setf (uffi:get-slot-value u 'tunion1 'uint)
-         #-sparc
-         (+ (* 1 (char-code #\A))
-            (* 256 (char-code #\B))
-            (* 65536 (char-code #\C))
-            (* 16777216 255))
-         #+(or sparc sparc-v9)
-         (+ (* 16777216 (char-code #\A))
-            (* 65536 (char-code #\B))
-            (* 256 (char-code #\C))
-            (* 1 255)))
+      ;; little endian
+      #-(or sparc sparc-v9 powerpc ppc)
+      (+ (* 1 (char-code #\A))
+        (* 256 (char-code #\B))
+        (* 65536 (char-code #\C))
+        (* 16777216 128))
+      ;; big endian
+      #+(or sparc sparc-v9 powerpc ppc)
+      (+ (* 16777216 (char-code #\A))
+        (* 65536 (char-code #\B))
+        (* 256 (char-code #\C))
+        (* 1 128)))
     (format *standard-output* "~&Should be #\A: ~S" 
            (uffi:ensure-char-character 
             (uffi:get-slot-value u 'tunion1 'char)))
 (defun test-union-1 ()
   (let ((u (uffi:allocate-foreign-object 'tunion1)))
     (setf (uffi:get-slot-value u 'tunion1 'uint)
-         #-sparc
+         #-(or sparc sparc-v9 powerpc ppc)
          (+ (* 1 (char-code #\A))
             (* 256 (char-code #\B))
             (* 65536 (char-code #\C))
             (* 16777216 128))
-         #+(or sparc sparc-v9)
+         #+(or sparc sparc-v9 powerpc ppc)
          (+ (* 16777216 (char-code #\A))
             (* 65536 (char-code #\B))
             (* 256 (char-code #\C))