From 176023f4707011ceec5b1ed5d3aa75114d5e7a40 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 3 Jan 2021 14:28:22 +0100 Subject: [PATCH] Remove compiler warnings --- src/xspice/icm/table/mada/alloc.c | 4 ++-- src/xspice/icm/table/support/gettokens.c | 6 +++--- src/xspice/ipc/ipcsockets.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/xspice/icm/table/mada/alloc.c b/src/xspice/icm/table/mada/alloc.c index b45d611aa..aa483a625 100644 --- a/src/xspice/icm/table/mada/alloc.c +++ b/src/xspice/icm/table/mada/alloc.c @@ -41,9 +41,9 @@ sf_alloc(int n /* number of elements */, /* Use calloc so that any internal allocations will be set to NULL to * facilitate error recovery */ - if ((ptr = calloc(n, size)) == NULL) { + if ((ptr = calloc((size_t)n, size)) == NULL) { cm_message_printf("%s: cannot allocate %zd bytes : ", - __FILE__, n * size); + __FILE__, (size_t)n * size); return NULL; } diff --git a/src/xspice/icm/table/support/gettokens.c b/src/xspice/icm/table/support/gettokens.c index 4c936c017..18ff08ea8 100644 --- a/src/xspice/icm/table/support/gettokens.c +++ b/src/xspice/icm/table/support/gettokens.c @@ -30,7 +30,7 @@ char *CNVgettok(char **s) /* skip over any white space */ - while (isspace(**s) || (**s == '=') || + while (isspace_c(**s) || (**s == '=') || (**s == '(') || (**s == ')') || (**s == ',')) (*s)++; @@ -49,7 +49,7 @@ char *CNVgettok(char **s) /* or a mess o' characters. */ i = 0; while ( (**s != '\0') && - (! ( isspace(**s) || (**s == '=') || + (! ( isspace_c(**s) || (**s == '=') || (**s == '(') || (**s == ')') || (**s == ',') ) ) ) { @@ -63,7 +63,7 @@ char *CNVgettok(char **s) /* skip over white space up to next token */ - while (isspace(**s) || (**s == '=') || + while (isspace_c(**s) || (**s == '=') || (**s == '(') || (**s == ')') || (**s == ',')) (*s)++; diff --git a/src/xspice/ipc/ipcsockets.c b/src/xspice/ipc/ipcsockets.c index 9da84e43b..eff18edff 100644 --- a/src/xspice/ipc/ipcsockets.c +++ b/src/xspice/ipc/ipcsockets.c @@ -166,7 +166,7 @@ ipc_transport_initialize_server ( /* with version 1 (mailboxes) functions of the same names. */ { struct sockaddr_in server; /* Server specifications for socket*/ - unsigned int server_length; /* Size of server structure */ + int server_length; /* Size of server structure */ int port_num; /* Port number converted from server_name */ NG_IGNORE(mode); @@ -513,7 +513,7 @@ ipc_transport_get_line ( if (sock_state == IPC_SOCK_INITIALIZED) { /* We have an open socket but have not connected to a client. */ /* Accept a connection from a client. */ - msg_stream = accept (sock_desc, (struct sockaddr *)0, (unsigned int *)0); + msg_stream = accept (sock_desc, (struct sockaddr *)0, (socklen_t*)0); if (msg_stream == -1) { fprintf (stderr, "ERROR: IPC: Server accepting request\n");