mirror of
https://github.com/simh/simh.git
synced 2026-05-14 09:32:32 +00:00
FRONTPANEL: Cleanup potential build warnings
This commit is contained in:
@@ -640,7 +640,7 @@ return 0;
|
||||
static int
|
||||
_panel_establish_register_bits_collection (PANEL *panel)
|
||||
{
|
||||
size_t i, buf_data, buf_needed = 1, reg_count = 0, bit_reg_count = 0;
|
||||
size_t i, buf_data, buf_needed = 1;
|
||||
int cmd_stat, bits_count = 0;
|
||||
char *buf, *response = NULL;
|
||||
|
||||
@@ -753,7 +753,7 @@ struct stat statb;
|
||||
char *buf = NULL;
|
||||
int port;
|
||||
int cmd_stat;
|
||||
size_t i, device_num;
|
||||
size_t i, device_num = 0;
|
||||
char hostport[64];
|
||||
union {int i; char c[sizeof (int)]; } end_test;
|
||||
|
||||
@@ -1444,7 +1444,7 @@ if (!panel->reg_count) {
|
||||
}
|
||||
pthread_mutex_lock (&panel->io_command_lock);
|
||||
pthread_mutex_lock (&panel->io_lock);
|
||||
if (panel->reg_query_size != _panel_send (panel, panel->reg_query, panel->reg_query_size)) {
|
||||
if ((int)panel->reg_query_size != _panel_send (panel, panel->reg_query, panel->reg_query_size)) {
|
||||
pthread_mutex_unlock (&panel->io_lock);
|
||||
pthread_mutex_unlock (&panel->io_command_lock);
|
||||
return -1;
|
||||
@@ -2571,7 +2571,6 @@ int sched_policy;
|
||||
struct sched_param sched_priority;
|
||||
char *buf = NULL;
|
||||
size_t buf_data = 0;
|
||||
unsigned int callback_count = 0;
|
||||
int cmd_stat;
|
||||
|
||||
/*
|
||||
@@ -2594,7 +2593,6 @@ pthread_mutex_lock (&p->io_lock);
|
||||
while ((p->sock != INVALID_SOCKET) &&
|
||||
(p->usecs_between_callbacks) &&
|
||||
(p->State != Error)) {
|
||||
int interval = p->usecs_between_callbacks;
|
||||
int new_register = p->new_register;
|
||||
|
||||
pthread_mutex_unlock (&p->io_lock);
|
||||
|
||||
@@ -163,6 +163,8 @@ typedef size_t socklen_t;
|
||||
typedef int (WSAAPI *getnameinfo_func) (const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags);
|
||||
static getnameinfo_func p_getnameinfo;
|
||||
|
||||
#if !defined(AF_INET6) || defined(TEST_INFO_STUBS) || defined(_WIN32)
|
||||
|
||||
static void WSAAPI s_freeaddrinfo (struct addrinfo *ai)
|
||||
{
|
||||
struct addrinfo *a, *an;
|
||||
@@ -384,6 +386,8 @@ if ((host) && (hostlen > 0)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* !defined(AF_INET6) || defined(TEST_INFO_STUBS) || defined(_WIN32) */
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
|
||||
#if !defined(IPV6_V6ONLY) /* Older XP environments may not define IPV6_V6ONLY */
|
||||
@@ -675,7 +679,7 @@ if (c != NULL) {
|
||||
bits = strtoul (c + 1, &c1, 10);
|
||||
if ((bits == 0) || (bits > 128) || (*c1 != '\0'))
|
||||
return status;
|
||||
if ((c - validate_addr) > sizeof (v_cpy) - 1)
|
||||
if ((size_t)(c - validate_addr) > sizeof (v_cpy) - 1)
|
||||
return status;
|
||||
memcpy (v_cpy, validate_addr, c - validate_addr); /* Copy everything before the / */
|
||||
v_cpy[c - validate_addr] = '\0'; /* NUL terminate the result */
|
||||
@@ -701,7 +705,7 @@ while ((*acl != '\0') && !done) {
|
||||
permit = (*acl == '+');
|
||||
cc = strchr (acl, ',');
|
||||
if (cc != NULL) {
|
||||
if ((cc - acl) > sizeof (rule))
|
||||
if ((size_t)(cc - acl) > sizeof (rule))
|
||||
break; /* Too big - error */
|
||||
memcpy (rule, acl + 1, cc - (acl + 1));
|
||||
rule[cc - (acl + 1)] = '\0';
|
||||
|
||||
Reference in New Issue
Block a user