summaryrefslogtreecommitdiffstats
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
commit35a8cfbfd30ebc588ca904c111e87e27723ee385 (patch)
tree2c3ca45c7320423ba1d4ad4ca3bcefc99fc5579c
parent6596f10047a42b411db710d9ee4efc32178d5855 (diff)
downloadtxr-35a8cfbfd30ebc588ca904c111e87e27723ee385.tar.gz
txr-35a8cfbfd30ebc588ca904c111e87e27723ee385.tar.bz2
txr-35a8cfbfd30ebc588ca904c111e87e27723ee385.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).
-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)