projects
/
uffi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r1717: *** empty log message ***
[uffi.git]
/
examples
/
union.cl
diff --git
a/examples/union.cl
b/examples/union.cl
index 197332f168e0a04b843640241aa96daefd57f47c..d0d32812ab4661592af50cd81ea940a4ce6d3361 100644
(file)
--- a/
examples/union.cl
+++ b/
examples/union.cl
@@
-7,7
+7,7
@@
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id: union.cl,v 1.
1 2002/03/21 07:56:45
kevin Exp $
+;;;; $Id: union.cl,v 1.
3 2002/03/23 16:32:39
kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
@@
-26,18
+26,18
@@
(df :double))
(defun test-union-1 ()
(df :double))
(defun test-union-1 ()
- (let ((u (uffi:allocate-foreign-object tunion1)))
- (setf (uffi:get-slot-value u 'tunion1 'int)
+ (let ((u (uffi:allocate-foreign-object
'
tunion1)))
+ (setf (uffi:get-slot-value u 'tunion1 '
u
int)
(+ (char-code #\A)
(* 256 (char-code #\B))
(* 65536 (char-code #\C))
(* 16777216 255)))
(+ (char-code #\A)
(* 256 (char-code #\B))
(* 65536 (char-code #\C))
(* 16777216 255)))
- (format
t
"~&Should be #\A: ~S"
+ (format
*standard-output*
"~&Should be #\A: ~S"
(uffi:ensure-char-character
(uffi:get-slot-value u 'tunion1 'char)))
(uffi:ensure-char-character
(uffi:get-slot-value u 'tunion1 'char)))
- (format
t
"~&Should be negative number: ~D"
+ (format
*standard-output*
"~&Should be negative number: ~D"
(uffi:get-slot-value u 'tunion1 'int))
(uffi:get-slot-value u 'tunion1 'int))
- (format
t
"~&Should be positive number: ~D"
+ (format
*standard-output*
"~&Should be positive number: ~D"
(uffi:get-slot-value u 'tunion1 'uint))
(uffi:free-foreign-object u))
(values))
(uffi:get-slot-value u 'tunion1 'uint))
(uffi:free-foreign-object u))
(values))