mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-13 07:10:20 +02:00
* socket.c (scm_getsockopt): Changed type for `optlen' from int to
size_t. (scm_accept, scm_getsockname, scm_getpeername, scm_recvfrom): Ditto for `tmp_size'. (scm_addr_buffer_size): Changed type from int to size_t.
This commit is contained in:
parent
f34d19c740
commit
2cf6d0146c
1 changed files with 13 additions and 13 deletions
|
@ -218,7 +218,7 @@ SCM_DEFINE (scm_getsockopt, "getsockopt", 3, 0, 0,
|
||||||
#define FUNC_NAME s_scm_getsockopt
|
#define FUNC_NAME s_scm_getsockopt
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
int optlen;
|
size_t optlen;
|
||||||
#ifdef HAVE_STRUCT_LINGER
|
#ifdef HAVE_STRUCT_LINGER
|
||||||
char optval[sizeof (struct linger)];
|
char optval[sizeof (struct linger)];
|
||||||
#else
|
#else
|
||||||
|
@ -228,9 +228,9 @@ SCM_DEFINE (scm_getsockopt, "getsockopt", 3, 0, 0,
|
||||||
int ioptname;
|
int ioptname;
|
||||||
|
|
||||||
#ifdef HAVE_STRUCT_LINGER
|
#ifdef HAVE_STRUCT_LINGER
|
||||||
optlen = (int) sizeof (struct linger);
|
optlen = sizeof (struct linger);
|
||||||
#else
|
#else
|
||||||
optlen = (int) sizeof (scm_sizet);
|
optlen = sizeof (size_t);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sock = SCM_COERCE_OUTPORT (sock);
|
sock = SCM_COERCE_OUTPORT (sock);
|
||||||
|
@ -582,20 +582,20 @@ scm_addr_vector (struct sockaddr *address,const char *proc)
|
||||||
|
|
||||||
/* Allocate a buffer large enough to hold any sockaddr type. */
|
/* Allocate a buffer large enough to hold any sockaddr type. */
|
||||||
static char *scm_addr_buffer;
|
static char *scm_addr_buffer;
|
||||||
static int scm_addr_buffer_size;
|
static size_t scm_addr_buffer_size;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
scm_init_addr_buffer (void)
|
scm_init_addr_buffer (void)
|
||||||
{
|
{
|
||||||
scm_addr_buffer_size =
|
scm_addr_buffer_size =
|
||||||
#ifdef HAVE_UNIX_DOMAIN_SOCKETS
|
#ifdef HAVE_UNIX_DOMAIN_SOCKETS
|
||||||
(int) sizeof (struct sockaddr_un)
|
sizeof (struct sockaddr_un)
|
||||||
#else
|
#else
|
||||||
0
|
0
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
if (sizeof (struct sockaddr_in) > scm_addr_buffer_size)
|
if (sizeof (struct sockaddr_in) > scm_addr_buffer_size)
|
||||||
scm_addr_buffer_size = (int) sizeof (struct sockaddr_in);
|
scm_addr_buffer_size = sizeof (struct sockaddr_in);
|
||||||
scm_addr_buffer = scm_must_malloc (scm_addr_buffer_size, "address buffer");
|
scm_addr_buffer = scm_must_malloc (scm_addr_buffer_size, "address buffer");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -619,7 +619,7 @@ SCM_DEFINE (scm_accept, "accept", 1, 0, 0,
|
||||||
SCM address;
|
SCM address;
|
||||||
SCM newsock;
|
SCM newsock;
|
||||||
|
|
||||||
int tmp_size;
|
size_t tmp_size;
|
||||||
sock = SCM_COERCE_OUTPORT (sock);
|
sock = SCM_COERCE_OUTPORT (sock);
|
||||||
SCM_VALIDATE_OPFPORT (1,sock);
|
SCM_VALIDATE_OPFPORT (1,sock);
|
||||||
fd = SCM_FPORT_FDES (sock);
|
fd = SCM_FPORT_FDES (sock);
|
||||||
|
@ -642,7 +642,7 @@ SCM_DEFINE (scm_getsockname, "getsockname", 1, 0, 0,
|
||||||
"in the @code{AF_FILE} namespace cannot be read.")
|
"in the @code{AF_FILE} namespace cannot be read.")
|
||||||
#define FUNC_NAME s_scm_getsockname
|
#define FUNC_NAME s_scm_getsockname
|
||||||
{
|
{
|
||||||
int tmp_size;
|
size_t tmp_size;
|
||||||
int fd;
|
int fd;
|
||||||
SCM result;
|
SCM result;
|
||||||
sock = SCM_COERCE_OUTPORT (sock);
|
sock = SCM_COERCE_OUTPORT (sock);
|
||||||
|
@ -667,7 +667,7 @@ SCM_DEFINE (scm_getpeername, "getpeername", 1, 0, 0,
|
||||||
"in the @code{AF_FILE} namespace cannot be read.")
|
"in the @code{AF_FILE} namespace cannot be read.")
|
||||||
#define FUNC_NAME s_scm_getpeername
|
#define FUNC_NAME s_scm_getpeername
|
||||||
{
|
{
|
||||||
int tmp_size;
|
size_t tmp_size;
|
||||||
int fd;
|
int fd;
|
||||||
SCM result;
|
SCM result;
|
||||||
sock = SCM_COERCE_OUTPORT (sock);
|
sock = SCM_COERCE_OUTPORT (sock);
|
||||||
|
@ -771,7 +771,7 @@ SCM_DEFINE (scm_recvfrom, "recvfrom!", 2, 3, 0,
|
||||||
int flg;
|
int flg;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
int cend;
|
int cend;
|
||||||
int tmp_size;
|
size_t tmp_size;
|
||||||
SCM address;
|
SCM address;
|
||||||
|
|
||||||
SCM_VALIDATE_OPFPORT (1,sock);
|
SCM_VALIDATE_OPFPORT (1,sock);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue