From: Kevin M. Rosenberg Date: Tue, 29 Apr 2003 14:13:55 +0000 (+0000) Subject: r4704: Auto commit for Debian build X-Git-Tag: v1.6.1~225 X-Git-Url: http://git.kpe.io/?p=uffi.git;a=commitdiff_plain;h=1a9bfad7573c63b34181820e2186a3580cf2d283 r4704: Auto commit for Debian build --- diff --git a/debian/changelog b/debian/changelog index 00e03ce..5aaecbf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-uffi (1.2.11-1) unstable; urgency=low + + * Add test suite, new binary package uffi-tests + + -- Kevin M. Rosenberg Tue, 29 Apr 2003 08:10:26 -0600 + cl-uffi (1.2.10-1) unstable; urgency=low * Fix allegro free-cstring bug diff --git a/tests/compress.lisp b/tests/compress.lisp index fcff615..acc6f0e 100644 --- a/tests/compress.lisp +++ b/tests/compress.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: compress.lisp,v 1.6 2003/04/29 13:16:14 kevin Exp $ +;;;; $Id: compress.lisp,v 1.7 2003/04/29 14:13:55 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -100,7 +100,9 @@ (defun compress-uncompress (str) (multiple-value-bind (compressed len) (compress str) + (declare (ignore len)) (multiple-value-bind (uncompressed len2) (uncompress compressed) + (declare (ignore len2)) uncompressed))) diff --git a/tests/gethostname.lisp b/tests/gethostname.lisp index e973891..6b8e482 100644 --- a/tests/gethostname.lisp +++ b/tests/gethostname.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: gethostname.lisp,v 1.4 2003/04/29 14:08:02 kevin Exp $ +;;;; $Id: gethostname.lisp,v 1.5 2003/04/29 14:13:55 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -21,28 +21,29 @@ ;;; This example is inspired by the example on the CL-Cookbook web site -(uffi:def-function ("gethostname" c-gethostname) - ((name (* :unsigned-char)) - (len :int)) - :returning :int) - -(defun gethostname () - "Returns the hostname" - (let* ((name (uffi:allocate-foreign-string 256)) - (result-code (c-gethostname name 256)) - (hostname (when (zerop result-code) - (uffi:convert-from-foreign-string name)))) - (uffi:free-foreign-object name) - (unless (zerop result-code) - (error "gethostname() failed.")) - hostname)) - -(defun gethostname2 () - "Returns the hostname" - (uffi:with-foreign-object (name '(:array :unsigned-char 256)) - (if (zerop (c-gethostname (uffi:char-array-to-pointer name) 256)) - (uffi:convert-from-foreign-string name) - (error "gethostname() failed.")))) +(eval-when (:compile-toplevel :load-toplevel :execute) + (uffi:def-function ("gethostname" c-gethostname) + ((name (* :unsigned-char)) + (len :int)) + :returning :int) + + (defun gethostname () + "Returns the hostname" + (let* ((name (uffi:allocate-foreign-string 256)) + (result-code (c-gethostname name 256)) + (hostname (when (zerop result-code) + (uffi:convert-from-foreign-string name)))) + (uffi:free-foreign-object name) + (unless (zerop result-code) + (error "gethostname() failed.")) + hostname)) + + (defun gethostname2 () + "Returns the hostname" + (uffi:with-foreign-object (name '(:array :unsigned-char 256)) + (if (zerop (c-gethostname (uffi:char-array-to-pointer name) 256)) + (uffi:convert-from-foreign-string name) + (error "gethostname() failed."))))) (deftest gethostname.1 (stringp (gethostname)) t) (deftest gethostname.2 (stringp (gethostname2)) t)