diff options
author | Michael Gran <spk121@yahoo.com> | 2009-08-01 10:15:20 -0700 |
---|---|---|
committer | Michael Gran <spk121@yahoo.com> | 2009-08-01 10:15:20 -0700 |
commit | 4c402b889eecaa7ffc61da6656f415c8c983507a (patch) | |
tree | 3f2abeffb8a43afce6e04fcdeebfa0ce007edfb2 /libguile/chars.h | |
parent | 64bad3f5a8d7351a41a5b9ccb1df5c393a48b4a9 (diff) | |
download | guile-4c402b889eecaa7ffc61da6656f415c8c983507a.tar.gz |
Don't use GNU extensions for SCM_MAKE_CHAR macro
Since the contents of SCM_MAKE_CHAR are evaluated more than once,
don't use it in situations where this could cause side-effects.
* libguile/vm-i-system.c (make-char8): avoid side-effects with
SCM_MAKE_CHAR call
* libguile/chars.h (SCM_MAKE_CHAR): modified
Diffstat (limited to 'libguile/chars.h')
-rw-r--r-- | libguile/chars.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libguile/chars.h b/libguile/chars.h index e68f06d21..8e1bc64b4 100644 --- a/libguile/chars.h +++ b/libguile/chars.h @@ -37,10 +37,10 @@ typedef scm_t_int32 scm_t_wchar; #define SCM_CHARP(x) (SCM_ITAG8(x) == scm_tc8_char) #define SCM_CHAR(x) ((scm_t_wchar)SCM_ITAG8_DATA(x)) -#define SCM_MAKE_CHAR(x) ({scm_t_int32 _x = (x); \ - _x < 0 \ - ? SCM_MAKE_ITAG8((scm_t_bits)(unsigned char)_x, scm_tc8_char) \ - : SCM_MAKE_ITAG8((scm_t_bits)_x, scm_tc8_char);}) +#define SCM_MAKE_CHAR(x) \ + (x < 0 \ + ? SCM_MAKE_ITAG8 ((scm_t_bits) (unsigned char) x, scm_tc8_char) \ + : SCM_MAKE_ITAG8 ((scm_t_bits) x, scm_tc8_char)) #define SCM_CODEPOINT_MAX (0x10ffff) #define SCM_IS_UNICODE_CHAR(c) \ |