From 7ac90ac289d2a10a0d99f626dab5d10df2d66c8d Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Sun, 23 Jul 2006 22:19:41 +0000 Subject: (scm_htonl, scm_ntohl): Use scm_to_uint32 rather than NUM2ULONG, to enforce 32-bit range check on systems with 64-bit long. --- libguile/socket.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libguile/socket.c b/libguile/socket.c index a9b7ed8ca..fb2e8c7b7 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -98,9 +98,7 @@ SCM_DEFINE (scm_htonl, "htonl", 1, 0, 0, "and returned as a new integer.") #define FUNC_NAME s_scm_htonl { - scm_t_uint32 c_in = SCM_NUM2ULONG (1, value); - - return scm_from_ulong (htonl (c_in)); + return scm_from_ulong (htonl (scm_to_uint32 (value))); } #undef FUNC_NAME @@ -111,9 +109,7 @@ SCM_DEFINE (scm_ntohl, "ntohl", 1, 0, 0, "and returned as a new integer.") #define FUNC_NAME s_scm_ntohl { - scm_t_uint32 c_in = SCM_NUM2ULONG (1, value); - - return scm_from_ulong (ntohl (c_in)); + return scm_from_ulong (ntohl (scm_to_uint32 (value))); } #undef FUNC_NAME -- cgit v1.2.1