summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-06-06 06:46:28 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-06-06 06:46:28 -0700
commit7f35218581067e5b3449258326a54235d6e10bbc (patch)
treef94237cef9897672654d603ef43fbe45844b7a6f /stream.c
parent840330f271f25b093c7a86b41e7cddaec0cb6d7f (diff)
downloadtxr-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 'stream.c')
-rw-r--r--stream.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stream.c b/stream.c
index 64ca8888..a533ee5f 100644
--- a/stream.c
+++ b/stream.c
@@ -860,7 +860,7 @@ static val stdio_put_buf(val stream, val buf, cnum pos)
ucnum len = c_unum(length_buf(buf));
mem_t *ptr = buf_get(buf, self);
struct stdio_handle *h = coerce(struct stdio_handle *, stream->co.handle);
- if ((size_t) len != len || len > INT_PTR_MAX)
+ if (convert(size_t, len) != len || len > INT_PTR_MAX)
uw_throwf(error_s, lit("~a: buffer too large"), self, nao);
if (convert(ucnum, pos) >= len)
return num(len);
@@ -880,7 +880,7 @@ static val stdio_fill_buf(val stream, val buf, cnum pos)
ucnum len = c_unum(length_buf(buf));
mem_t *ptr = buf_get(buf, self);
struct stdio_handle *h = coerce(struct stdio_handle *, stream->co.handle);
- if ((size_t) len != len || len > INT_PTR_MAX)
+ if (convert(size_t, len) != len || len > INT_PTR_MAX)
uw_throwf(error_s, lit("~a: buffer too large"), self, nao);
if (convert(ucnum, pos) >= len)
return num(len);