From a96e16af6a24bf929032612fb8cd0397ca5aeb11 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 23 Nov 2009 19:02:24 -0800 Subject: Follow up on 64 bit compilation warnings. --- ChangeLog | 11 +++++++++++ lib.c | 4 ++-- stream.c | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 081d5e6f..9f3d4a38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-11-23 Kaz Kylheku + + Follow up on 64 bit compilation warnings. + + * lib.c (chr, chrp): Do not convert directly between wchar_t and + the pointer type; go through cnum intermediate value. + + * stream.c (vformat): Fix bad cast from pointer to int; this was + missed in the conversion to cnum because it should have been a + cast to long originally. + 2009-11-23 Kaz Kylheku * Makefile (conftest.o): revert change that took CFLAGS from diff --git a/lib.c b/lib.c index eb612f42..1349a8e6 100644 --- a/lib.c +++ b/lib.c @@ -1015,7 +1015,7 @@ val string_lt(val astr, val bstr) val chr(wchar_t ch) { - return (val) ((ch << TAG_SHIFT) | TAG_CHR); + return (val) (((cnum) ch << TAG_SHIFT) | TAG_CHR); } val chrp(val chr) @@ -1027,7 +1027,7 @@ wchar_t c_chr(val chr) { if (!is_chr(chr)) type_mismatch(lit("~s is not a character"), chr, nao); - return ((wchar_t) chr) >> TAG_SHIFT; + return (wchar_t) ((cnum) chr >> TAG_SHIFT); } val chr_str(val str, val index) diff --git a/stream.c b/stream.c index b76d037d..6b54b2f7 100644 --- a/stream.c +++ b/stream.c @@ -879,7 +879,7 @@ val vformat(val stream, val fmtstr, va_list vl) continue; case 'p': ptr = va_arg(vl, void *); - value = (int) ptr; + value = (cnum) ptr; strcpy(num_buf, "0x"); sprintf(num_buf + 2, num_fmt->hex, value); goto output_num; -- cgit v1.2.3