summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-23 19:02:24 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-23 19:02:24 -0800
commita96e16af6a24bf929032612fb8cd0397ca5aeb11 (patch)
treee078277313d96531c7fd6a4aec190fbae0e3aefb
parent8ba87177ddfa5e5a77dcc1447da2233a3bf3732c (diff)
downloadtxr-a96e16af6a24bf929032612fb8cd0397ca5aeb11.tar.gz
txr-a96e16af6a24bf929032612fb8cd0397ca5aeb11.tar.bz2
txr-a96e16af6a24bf929032612fb8cd0397ca5aeb11.zip
Follow up on 64 bit compilation warnings.
-rw-r--r--ChangeLog11
-rw-r--r--lib.c4
-rw-r--r--stream.c2
3 files changed, 14 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 081d5e6f..9f3d4a38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2009-11-23 Kaz Kylheku <kkylheku@gmail.com>
+ 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 <kkylheku@gmail.com>
+
* Makefile (conftest.o): revert change that took CFLAGS from
this target.
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;