1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 23:50:19 +02:00

(scm_htonl, scm_ntohl): Use scm_to_uint32 rather than

NUM2ULONG, to enforce 32-bit range check on systems with 64-bit long.
This commit is contained in:
Kevin Ryde 2006-07-23 22:19:41 +00:00
parent 0c5365ea3e
commit 7ac90ac289

View file

@ -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