diff --git a/LOG b/LOG index 1be2605453..9b161f4afb 100644 --- a/LOG +++ b/LOG @@ -24,3 +24,15 @@ so they show up in the Windows workarea c directory. cmacros.ss, fasl.c, number.c, c/Mf-base, c/Makefile.{t,}{i3,a6}nt +- The scheme.h definition of Sfixnum(x) now uses multiply rather than + left shift to avoid counting on the behavior of << on negative numbers, + which is undefined in C. + mkheader.ss +- Fixed a couple of casts, one harmless and the other causing + Sinteger64_value to return 0 for the most-negative I64 on 32-bit + builds. + number.c +- The configure-generated Makefile distclean target no longer removes + zlib and nanopass, since they are logically part of the git clone. + It does run make distclean in zlib. + makefiles/Makefile.in diff --git a/c/number.c b/c/number.c index d27f7dfe0c..a25b4e216d 100644 --- a/c/number.c +++ b/c/number.c @@ -289,7 +289,7 @@ I32 S_int32_value(who, x) char *who; ptr x; { if (!BIGSIGN(x)) return (I32)u; if (u < ((U32)1 << 31)) return -(I32)u; if (u > ((U32)1 << 31)) S_error1(who, "~s is out of range", x); - return (iptr)0x80000000; + return (I32)0x80000000; } #endif /* (fixnum_bits > 32) */ @@ -320,7 +320,7 @@ I64 S_int64_value(who, x) char *who; ptr x; { if (!BIGSIGN(x)) return (I64)u; if (u < ((U64)1 << 63)) return -(I64)u; if (u > ((U64)1 << 63)) S_error1(who, "~s is out of range", x); - return (iptr)0x8000000000000000; + return (I64)0x8000000000000000; } S_error1(who, "~s is not an integer", x); diff --git a/makefiles/Makefile.in b/makefiles/Makefile.in index f780585820..4b4abe338c 100644 --- a/makefiles/Makefile.in +++ b/makefiles/Makefile.in @@ -32,7 +32,6 @@ clean: distclean: rm -rf $(workarea) - rm -rf nanopass - rm -rf zlib + (cd zlib ; make distclean) rm -f Makefile rm -f Make.out diff --git a/s/mkheader.ss b/s/mkheader.ss index 04b6444996..0a45118507 100644 --- a/s/mkheader.ss +++ b/s/mkheader.ss @@ -310,7 +310,7 @@ (export "void" "Svector_set" "(ptr, iptr, ptr)") (nl) (comment "Constructors") - (def "Sfixnum(x)" (format "((ptr)(uptr)((x)<<~d))" ($ fixnum-offset))) + (def "Sfixnum(x)" (format "((ptr)(uptr)((x)*~d))" ($ fixnum-factor))) (def "Schar(x)" (format "((ptr)(uptr)((x)<<~d|0x~x))" ($ char-data-offset)