Thu Sep 7 09:03:12 CEST 2006 [EMAIL PROTECTED] * Use array-total-size-limit as the max size for strings
Thu Sep 7 09:03:39 CEST 2006 [EMAIL PROTECTED] * Allow ub8 arrays to be autoconverted to foreign strings
New patches: [Use array-total-size-limit as the max size for strings [EMAIL PROTECTED] { hunk ./src/strings.lisp 45 -(defun foreign-string-to-lisp (ptr &optional (size most-positive-fixnum) +(defun foreign-string-to-lisp (ptr &optional (size array-total-size-limit) } [Allow ub8 arrays to be autoconverted to foreign strings [EMAIL PROTECTED] { hunk ./src/strings.lisp 40 - (loop with i = 0 for char across string - while (< i size) - do (%mem-set (char-code char) ptr :unsigned-char (post-incf i)) - finally (%mem-set 0 ptr :unsigned-char i))) + (etypecase string + (string + (loop with i = 0 for char across string + while (< i size) + do (%mem-set (char-code char) ptr :unsigned-char (post-incf i)) + finally (%mem-set 0 ptr :unsigned-char i))) + ((array (unsigned-byte 8)) + (loop with i = 0 for elt across string + while (< i size) + do (%mem-set elt ptr :unsigned-char (post-incf i)) + finally (%mem-set 0 ptr :unsigned-char i))))) hunk ./src/strings.lisp 68 - (check-type string string) + (check-type string (or string (array (unsigned-byte 8)))) hunk ./src/strings.lisp 105 - (if (pointerp obj) - (values obj nil) - (error "~A is not a Lisp string or pointer." obj))) + (cond + ((pointerp obj) + (values obj nil)) + ((typep obj '(array (unsigned-byte 8))) + (values (foreign-string-alloc obj) t)) + (t (error "~A is not a Lisp string, (array (unsigned-byte 8) or pointer." obj)))) hunk ./src/strings.lisp 140 - (if (pointerp obj) - (values obj nil) - (error "~A is not a Lisp string or pointer." obj))) + (cond + ((pointerp obj) + (values obj nil)) + ((typep obj '(array (unsigned-byte 8))) + (values (foreign-string-alloc obj) t)) + (t (error "~A is not a Lisp string, (array (unsigned-byte 8) or pointer." obj)))) hunk ./tests/misc-types.lisp 38 + +(deftest misc-types.string+ptr.ub8 + (destructuring-bind (string pointer) + (strdup (make-array 3 :element-type '(unsigned-byte 8) :initial-contents (map 'list #'char-code "foo"))) + (foreign-free pointer) + string) + "foo") } Context: [Use the RTEST package nickname instead of RT because of Lispworks. Luis Oliveira <[EMAIL PROTECTED]>**20060906114027] [Backwards compatibility for cffi-clisp's foreign-funcall Luis Oliveira <[EMAIL PROTECTED]>**20060906101336] [Support for recent CVS versions of CLISP Luis Oliveira <[EMAIL PROTECTED]>**20060905103418 - As of 2006-09-03, CLISP's FFI::FOREIGN-LIBRARY-FUNCTION takes an additional argument. Accomodated this change. Patch courtesy of Kevin Rosenberg. ] [[u]llong alignment issues on darwin/ppc Luis Oliveira <[EMAIL PROTECTED]>**20060905101150 - CLISP: special case for :[unsigned-]long-long on darwin/ppc. - SBCL: missing special case for :unsigned-long-long. - New regression test: STRUCT.ALIGNMENT.8. ] [New TODO items about LOAD-FOREIGN-LIBRARY. Luis Oliveira <[EMAIL PROTECTED]>**20060831153130] [New macro: INCF-POINTER (with documentation) Luis Oliveira <[EMAIL PROTECTED]>**20060831153039] [Misc manual cleanups like s/=>/@result{}/, etc... Luis Oliveira <[EMAIL PROTECTED]>**20060831152837] [Update cffi-uffi-compat to reflect recent UFFI changes. Luis Oliveira <[EMAIL PROTECTED]>**20060831152423 - Better handling of shared library extensions on Windows. Patch courtesy of Kevin Rosenberg. ] [Add long-long support to CLISP Luis Oliveira <[EMAIL PROTECTED]>**20060627011858 Patch courtesy of Frédéric Jolliton. ] [ECL fixes Luis Oliveira <[EMAIL PROTECTED]>**20060627010520 - cffi-ecl fixes: - push cffi-features:unix on darwin too. - use si:load-foreign-module instead of ffi:load-foreign-library on DFFI platforms. - use convert-external-name in foreign-symbol-pointer. - wrap defcvar's define-foreign-symbol around eval-when. - simplify default-library-suffix - cffi-tests: - load libtest.o on ECL platforms without DFFI. - conditionalize the tests with 127 arguments based on the value of lambda-parameters-limit. ] [review Foreign Types; add Glossary Stephen Compall <[EMAIL PROTECTED]>**20060613205550] [uffi-compat: in load-foreign-library, don't probe for file if no directory. Nathan Bird <[EMAIL PROTECTED]>**20060517201239 If it is just a filename without a directory, continue passing it down to the underlying functions, as they probably know how to find a library in default location.s The test now matches the uffi behaviour too. ] [Run tests both compiled and uncompiled. Luis Oliveira <[EMAIL PROTECTED]>**20060607183000 - Make the test-suite run both with and without rt::*compile-tests* bound to T. ] [Huh. Found a very old and incomplete sentence in the manual. Luis Oliveira <[EMAIL PROTECTED]>**20060607022358] [Minor comestic change in foreign-vars.lisp Luis Oliveira <[EMAIL PROTECTED]>**20060607022335] [Lispworks bugfix: %mem-ref and %mem-set compiler macros Luis Oliveira <[EMAIL PROTECTED]>**20060607022325 - The %mem-ref and %mem-set in cffi-lispworks.lisp were using bogus indexes. FLI's documentation suggests foreign-typed-aref expects array indexes but it seems to want offsets in bytes instead. - Regression tests: mem-ref.rt.1 and mem-ref.rt.2. ] [bugfix: accept symbols in defcvar Luis Oliveira <[EMAIL PROTECTED]>**20060527020411 - Fix lisp-var-name to accept symbols. - Regression test: foreign-globals.symbol-name ] [Minor simplification in tests/bindings.lisp Luis Oliveira <[EMAIL PROTECTED]>**20060526113626] [Fix some ECL bugs (maybe) Luis Oliveira <[EMAIL PROTECTED]>**20060526113437 - Fixed some bitrot in cffi-ecl.lisp (maybe). Still can't test properly because of an ECL bug related to make-load-form. ] [Fix uffi-compat bugs Luis Oliveira <[EMAIL PROTECTED]>**20060520181344 - :pointer is no longer a built-in type so we have to parse it, not find-type it. - def-array-pointer actually defines an array type with 1 element. (this emulates UFFI's behaviour) Bug report and initial patches courtesy of Lou Vanek. ] [Fix problem with declarations in DEFCALLBACKs Luis Oliveira <[EMAIL PROTECTED]>**20060514234218 - Place declarations after the translations take place. - We no longer poke at ignore declarations in defcallback. ] [change first automatic defbitfield value to 1 Stephen Compall <[EMAIL PROTECTED]>**20060512153832 - make-foreign-bitfield now starts implicit bitfield values at 1. No more special cases for zero. - Document and update bf tests to match. ] [defbitfield: explicit initial zero case Stephen Compall <[EMAIL PROTECTED]>**20060511162202 - Provide for counting an initial zero as a pseudo-single-bit. - Test bitfield.4. ] [only single-bits affect defbitfield implicit values Stephen Compall <[EMAIL PROTECTED]>**20060511154221 - Remove a case in which a non-single-bit like 3 could hijack the implicit value computation for defbitfield. - New test bitfield.3 for this behavior. ] [Fix defbitfield bug and new test Luis Oliveira <[EMAIL PROTECTED]>**20060511145035 - Bug fix: when the first value was provided a (< foo nil) comparision would occur. Regresion test: bitfield.1. - New test bitfield.2. ] [implicit defbitfield symbol values Stephen Compall <[EMAIL PROTECTED]>**20060511072106 - Foreign Type Translators: defctype does not create Lisp types; you have to use eql specializers. - enum.lisp: Use reduce in %foreign-bitfield-value. Code a default rule for bitfield symbol values. ] [Make :POINTER a parameterized foreign type. James Bielman <[EMAIL PROTECTED]>**20060507003511 - :POINTER without arguments is a void pointer. - (:POINTER :INT) is a pointer to an :INT. - These nest properly: (:POINTER (:POINTER :INT)). - Pointers are not type checked yet---an optional pointer type checker will be added someday. ] [Bugfix: Quote type arguments to %DEFCFUN-VARARGS. James Bielman <[EMAIL PROTECTED]>**20060507002829] [Recognize OpenMCL/X86-64 and set CFFI features accordingly. James Bielman <[EMAIL PROTECTED]>**20060504173940] [Conditionalize against non-CPU specific word-size features in OpenMCL. James Bielman <[EMAIL PROTECTED]>**20060504021623] [Bugfix: Specialize UNPARSE for UFFI-CHAR in CFFI-UFFI-COMPAT. James Bielman <[EMAIL PROTECTED]>**20060504015421 - Fixes an error when loading FASL files that dumped UFFI-CHAR instead of (UFFI-CHAR :CHAR) using MAKE-LOAD-FORM. - Reported by Ricardo Boccato. ] [More copyright header year updates. James Bielman <[EMAIL PROTECTED]>**20060503064225] [Update copyright year in file headers. James Bielman <[EMAIL PROTECTED]>**20060503063944] [Conditionally set variables for implementations in Makefile. James Bielman <[EMAIL PROTECTED]>**20060503063241 - Allow overriding from the environment as suggest in the comment, which didn't actually work. (eg.: OPENMCL=openmcl64 make test) ] [Add OpenMCL/X86-64 fasl files to 'make clean'. James Bielman <[EMAIL PROTECTED]>**20060503061637] [Make corman's finalizers thread-safe (hopefully) Luis Oliveira <[EMAIL PROTECTED]>**20060424173620] [Add support for finalizers Luis Oliveira <[EMAIL PROTECTED]>**20060424025357 - New functions: finalize and cancel-finalization. - New cffi-"feature": no-finalizers. Only ECL pushes this. - Document new functions. ] [Include stdint.h in libtest.c Luis Oliveira <[EMAIL PROTECTED]>**20060424025320] [Oops, forgot to bump the version number. Luis Oliveira <[EMAIL PROTECTED]>**20060424025119] [TAG 0.9.1 Luis Oliveira <[EMAIL PROTECTED]>**20060418011351] Patch bundle hash: 846f09e9fbbb9728d9272336e73d2cc390325ce5
_______________________________________________ cffi-devel mailing list cffi-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel