diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-06 06:46:28 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-06 06:46:28 -0700 |
commit | 7f35218581067e5b3449258326a54235d6e10bbc (patch) | |
tree | f94237cef9897672654d603ef43fbe45844b7a6f /itypes.c | |
parent | 840330f271f25b093c7a86b41e7cddaec0cb6d7f (diff) | |
download | txr-7f35218581067e5b3449258326a54235d6e10bbc.tar.gz txr-7f35218581067e5b3449258326a54235d6e10bbc.tar.bz2 txr-7f35218581067e5b3449258326a54235d6e10bbc.zip |
c++ maintenance: eliminate old-style casts.
Old style casts have crept into the code base.
* buf.c (make_buf, buf_grow, buf_get_i8, buf_get_u8): Replace
old style cast with macro.
* ffi.c (align_sw_get, align_sw_put, ffi_be_i32_get,
ffi_be_u32_get, ffi_le_i32_put, ffi_le_i32_get,
ffi_le_u32_get, ffi_be_i64_put, ffi_be_i64_get,
ffi_be_u64_get, ffi_le_i64_put, ffi_le_i64_get,
ffi_le_u64_get, ffi_sbit_put, ffi_sbit_get,
ffi_init_extra_types): Likewise.
* hash.c (hash_buf): Likewise.
* itypes.c (c_i32, c_i64, c_u64): Likewise.
* stream.c (stdio_put_buf, stdio_fill_buf): Likewise.
Diffstat (limited to 'itypes.c')
-rw-r--r-- | itypes.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -81,7 +81,7 @@ u16_t c_u16(val n, val self) i32_t c_i32(val n, val self) { cnum v = c_num(n); - if (v < (- (cnum) 0x7FFFFFFF - 1) || v > (cnum) 0x7FFFFFFF) + if (v < (-convert(cnum, 0x7FFFFFFF) - 1) || v > 0x7FFFFFFF) uw_throwf(error_s, lit("~a: value ~s is out of signed 32 bit range"), self, n, nao); return v; @@ -121,14 +121,14 @@ i64_t c_i64(val n, val self) { val low32 = logtrunc(n, num_fast(32)); val high32 = ash(n, num_fast(-32)); - return ((i64_t) c_i32(high32, self)) << 32 | c_u32(low32, self); + return convert(i64_t, c_i32(high32, self)) << 32 | c_u32(low32, self); } u64_t c_u64(val n, val self) { val low32 = logtrunc(n, num_fast(32)); val high32 = ash(n, num_fast(-32)); - return ((u64_t) c_u32(high32, self)) << 32 | c_u32(low32, self); + return convert(u64_t, c_u32(high32, self)) << 32 | c_u32(low32, self); } #endif #endif |