summaryrefslogtreecommitdiffstats
path: root/ffi.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-10-08 07:14:28 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-10-08 07:14:28 -0700
commit30be092e6bd3e80c50186d74f66f19189a184777 (patch)
tree2c3ca45c7320423ba1d4ad4ca3bcefc99fc5579c /ffi.c
parent884002da2e6365f1e03cad618ecc8624275f7646 (diff)
downloadtxr-30be092e6bd3e80c50186d74f66f19189a184777.tar.gz
txr-30be092e6bd3e80c50186d74f66f19189a184777.tar.bz2
txr-30be092e6bd3e80c50186d74f66f19189a184777.zip
ffi: C++ upkeep.
* ffi.c (sock_opt, sock_set_opt): Fix a few integer conversions to use convert (mapping to static_cast) rather than coerce (reinterpret_cast).
Diffstat (limited to 'ffi.c')
-rw-r--r--ffi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ffi.c b/ffi.c
index a77c48a4..cf628de8 100644
--- a/ffi.c
+++ b/ffi.c
@@ -6633,7 +6633,7 @@ static val sock_opt(val sock, val level, val option, val type_opt)
uw_throwf(socket_error_s, lit("~a: cannot get option on ~s"),
self, sock, nao);
} else {
- socklen_t size = coerce(socklen_t, tft->size);
+ socklen_t size = convert(socklen_t, tft->size);
mem_t *data = coerce(mem_t *, zalloca(size));
if (getsockopt(c_num(sfd, self), lvl, opt, data, &size) != 0)
uw_ethrowf(socket_error_s, lit("~a failed on ~s: ~d/~s"),
@@ -6644,7 +6644,7 @@ static val sock_opt(val sock, val level, val option, val type_opt)
* (Or perhaps add an optional argument following type_opt
* specifying the requested length of the value, presumably of type
* carray.) */
- if (size != coerce(socklen_t, tft->size))
+ if (size != convert(socklen_t, tft->size))
uw_throwf(socket_error_s, lit("~a: variable-size option on ~s"),
self, sock, nao);
return tft->get(tft, data, self);
@@ -6665,7 +6665,7 @@ static val sock_set_opt(val sock, val level, val option, val value,
uw_throwf(socket_error_s, lit("~a: cannot set option on ~s"),
self, sock, nao);
} else {
- socklen_t size = coerce(socklen_t, tft->size);
+ socklen_t size = convert(socklen_t, tft->size);
mem_t *data = coerce(mem_t *, zalloca(size));
tft->put(tft, value, data, self);
if (setsockopt(c_num(sfd, self), lvl, opt, data, size) != 0)