summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-15 20:59:07 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-15 20:59:07 -0800
commit0dd8652385533322d41b30fbd9375e6de9903548 (patch)
tree786b2554d78044d5613640220af6ab0fab9e2b01 /lib.c
parent24130a3641ae179816ca5672bde12cc04be17813 (diff)
downloadtxr-0dd8652385533322d41b30fbd9375e6de9903548.tar.gz
txr-0dd8652385533322d41b30fbd9375e6de9903548.tar.bz2
txr-0dd8652385533322d41b30fbd9375e6de9903548.zip
* lib.c (chr): Take wchar_t argument, not int. Dropped range check.
(c_chr): Return wchar_t not int. * lib.h (chr, c_chr): Declarations updated.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib.c b/lib.c
index 05927cb9..b014015b 100644
--- a/lib.c
+++ b/lib.c
@@ -967,9 +967,8 @@ obj_t *string_lt(obj_t *astr, obj_t *bstr)
return cmp == -1 ? t : nil;
}
-obj_t *chr(int ch)
+obj_t *chr(wchar_t ch)
{
- numeric_assert (ch >= NUM_MIN && ch <= NUM_MAX);
return (obj_t *) ((ch << TAG_SHIFT) | TAG_CHR);
}
@@ -978,11 +977,11 @@ obj_t *chrp(obj_t *chr)
return (is_chr(num)) ? t : nil;
}
-int c_chr(obj_t *chr)
+wchar_t c_chr(obj_t *chr)
{
if (!is_chr(chr))
type_mismatch(L"~s is not a character", chr, nao);
- return ((int) chr) >> TAG_SHIFT;
+ return ((wchar_t) chr) >> TAG_SHIFT;
}
obj_t *chr_str(obj_t *str, obj_t *index)