Jon Boone pushed to branch issue-154-piglatin-translation-doesnt-work-anymore at cmucl / cmucl
Commits:
28c7d555 by Jon Boone at 2023-06-17T14:14:17-04:00
testing removal of conditional
- - - - -
1 changed file:
- bin/build.sh
Changes:
=====================================
bin/build.sh
=====================================
@@ -130,13 +130,14 @@ buildit ()
time $BUILDWORLD $TARGET $OLDLISP $BOOT || { echo "Failed: $BUILDWORLD"; exit 1; }
if [ "$REBUILD_LISP" = "yes" ]; then
$TOOLDIR/rebuild-lisp.sh $TARGET
- else
+ fi
+ # else
# Set the LANG to C. For whatever reason, if I (rtoy) don't
# do this on my openSuSE system, any messages from gcc are
# basically garbled. This should be harmless on other
# systems.
- LANG=C $MAKE -C $TARGET/lisp $MAKE_TARGET || { echo "Failed: $MAKE -C $TARGET/lisp"; exit 1; }
- fi
+ # LANG=C $MAKE -C $TARGET/lisp $MAKE_TARGET || { echo "Failed: $MAKE -C $TARGET/lisp"; exit 1; }
+ # fi
if [ "$BUILD_WORLD2" = "yes" ];
then
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/28c7d55558a33943f2b0c68…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/28c7d55558a33943f2b0c68…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-242-c-call-char-result-wrong at cmucl / cmucl
Commits:
f5ad7b01 by Raymond Toy at 2023-06-16T07:20:26-07:00
Fix silly typo introduced in last commit
- - - - -
1 changed file:
- src/code/alieneval.lisp
Changes:
=====================================
src/code/alieneval.lisp
=====================================
@@ -173,7 +173,7 @@
;;
;; Method that accepts the alien type and the alien value. The
;; method converts the alien value into an appropriate lisp value.
- (naturalize-gen nil :type (or null function)
+ (naturalize-gen nil :type (or null function))
(deport-gen nil :type (or null function))
;; Cast?
(arg-tn nil :type (or null function))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/f5ad7b01e50ec09ee333ecf…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/f5ad7b01e50ec09ee333ecf…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-242-c-call-char-result-wrong at cmucl / cmucl
Commits:
a7a7029b by Raymond Toy at 2023-06-16T06:41:00-07:00
Remove unused function testing alien funcalls
In restructuring the tests, I forgot to remove a function for testing
alien funcalls. Remove it now.
- - - - -
1 changed file:
- tests/issues.lisp
Changes:
=====================================
tests/issues.lisp
=====================================
@@ -991,12 +991,6 @@
;; load-foreign apparently returns NIL if it succeeds.
(assert-true (eql nil (ext:load-foreign (merge-pathnames "test-return.o" *test-path*)))))
-(defun return-unsigned-int (x)
- ((alien:alien-funcall
- (alien:extern-alien "int_to_unsigned_int"
- (function c-call:unsigned-int c-call:unsigned-int))
- n)))
-
(define-test issue.242.test-alien-return-signed-char
(:tag :issues)
(flet ((fun (n)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a7a7029baf371e6c0f6f623…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a7a7029baf371e6c0f6f623…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-242-c-call-char-result-wrong at cmucl / cmucl
Commits:
3107832c by Raymond Toy at 2023-06-16T06:38:26-07:00
Remove debugging stuff and add comment
- - - - -
1 changed file:
- bin/run-tests.sh
Changes:
=====================================
bin/run-tests.sh
=====================================
@@ -47,8 +47,9 @@ function cleanup {
trap cleanup EXIT
-echo $PWD
-ls tests/*.c
+# Compile up the C file that is used for testing alien funcalls to
+# functions that return integer types of different lengths. We use
+# gcc since clang isn't always available.
(cd tests; gcc -m32 -O3 -c test-return.c)
if [ $# -eq 0 ]; then
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/3107832c9f11f35abc93903…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/3107832c9f11f35abc93903…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-242-c-call-char-result-wrong at cmucl / cmucl
Commits:
d5391d9a by Raymond Toy at 2023-06-15T15:53:13-07:00
Handle the signed integer case for alien integers
Mask out integer bits that we don't care about, and then sign-extend
the result, as needed.
- - - - -
1 changed file:
- src/code/alieneval.lisp
Changes:
=====================================
src/code/alieneval.lisp
=====================================
@@ -648,10 +648,21 @@
(def-alien-type-method (integer :naturalize-gen) (type alien)
;; Mask out any unwanted bits. Important if the C code returns
;; values in %al, or %ax
- (case (alien-integer-type-bits type)
- (8 `(ldb (byte 8 0) ,alien))
- (16 `(ldb (byte 16 0) ,alien))
- (t alien)))
+ (if (alien-integer-type-signed type)
+ (case (alien-integer-type-bits type)
+ ;; First, get just the low part of the alien and then
+ ;; sign-extend it appropriately.
+ (8 `(let ((val (ldb (byte 8 0) ,alien)))
+ (if (> val #x7f)
+ (- val #x100))))
+ (16 `(let ((val (ldb (byte 16 0) ,alien)))
+ (if (> val #x7fff)
+ (- val #x10000))))
+ (t alien))
+ (case (alien-integer-type-bits type)
+ (8 `(ldb (byte 8 0) ,alien))
+ (16 `(ldb (byte 16 0) ,alien))
+ (t alien))))
;; signed numbers <= 32 bits need to be sign extended.
;; I really should use the movsxd instruction, but I don't
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/d5391d9a0e25c687937e86f…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/d5391d9a0e25c687937e86f…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-240-set-diff-with-hash-table at cmucl / cmucl
Commits:
42fd6d23 by Raymond Toy at 2023-06-15T15:23:03-07:00
Make hashtable support multiset for list1
It's important that for list1 the hashtable support multisets since
list1 can be. This is needed so duplicates in list1 show up in the
output.
This variant was from @cshapiro.
- - - - -
85c8c1df by Raymond Toy at 2023-06-15T15:26:43-07:00
Reverse the output
Reverse the output for the case when list1 is longer so that the order
of the items matches the order of the input.
- - - - -
1 changed file:
- src/code/list.lisp
Changes:
=====================================
src/code/list.lisp
=====================================
@@ -770,15 +770,16 @@
(return (values length list2))))))
(when (< len 15)
(return-from list-to-hashtable (values nil nil)))
- (flet ((build-hash (len list)
- (let ((hashtable (make-hash-table :test test :size len)))
- (dolist (item list)
- (setf (gethash (apply-key key item) hashtable) item))
- hashtable)))
- (cond ((eq shorter-list list2)
- (values (build-hash len list2) list2))
- ((eq shorter-list list1)
- (values (build-hash len list1) list1))))))))
+ (cond ((eq shorter-list list2)
+ (let ((hashtable (make-hash-table :test test :size len)))
+ (dolist (item list2)
+ (setf (gethash (apply-key key item) hashtable) item))
+ (values hashtable list2)))
+ ((eq shorter-list list1)
+ (let ((hashtable (make-hash-table :test test :size len)))
+ (dolist (item list1)
+ (push item (gethash (apply-key key item) hashtable)))
+ (values hashtable list1))))))))
;;; UNION -- Public.
;;;
@@ -870,14 +871,17 @@
(dolist (item list1)
(unless (gethash (apply-key key item) hashtable)
(push item diff)))
- diff))
+ (nreverse diff)))
((eq shorter-list list1)
;; list1 was placed in the hash table.
(dolist (item list2)
- (when (gethash (apply-key key item) hashtable)
+ (unless (eq hashtable (gethash (apply-key key item) hashtable hashtable))
(remhash item hashtable)))
- (loop for item being the hash-values of hashtable
- collect item)))))
+ (let ((result '()))
+ (maphash #'(lambda (key value)
+ (declare (ignore key))
+ (setq result (nconc result value)))
+ hashtable))))))
(defun nset-difference (list1 list2 &key key
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5e47bcfc5129d5d7b47b11…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5e47bcfc5129d5d7b47b11…
You're receiving this email because of your account on gitlab.common-lisp.net.