SCP: Silence GCC optimizer warnings about unused function results
This commit is contained in:
parent
1d1fe6f329
commit
b18912cda8
4 changed files with 10 additions and 10 deletions
2
scp.c
2
scp.c
|
@ -13618,7 +13618,7 @@ rewind (tmp);
|
||||||
/* Discard leading blank lines/redundant titles */
|
/* Discard leading blank lines/redundant titles */
|
||||||
|
|
||||||
for (i =0; i < skiplines; i++)
|
for (i =0; i < skiplines; i++)
|
||||||
fgets (tbuf, sizeof (tbuf), tmp);
|
if (fgets (tbuf, sizeof (tbuf), tmp)) {};
|
||||||
|
|
||||||
while (fgets (tbuf, sizeof (tbuf), tmp)) {
|
while (fgets (tbuf, sizeof (tbuf), tmp)) {
|
||||||
if (tbuf[0] != '\n')
|
if (tbuf[0] != '\n')
|
||||||
|
|
|
@ -4219,7 +4219,7 @@ static t_stat sim_os_putchar (int32 out)
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
c = out;
|
c = out;
|
||||||
(void)write (1, &c, 1);
|
if (write (1, &c, 1)) {};
|
||||||
return SCPE_OK;
|
return SCPE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
sim_ether.c
14
sim_ether.c
|
@ -417,7 +417,7 @@ t_stat eth_mac_scan_ex (ETH_MAC* mac, const char* strmac, UNIT *uptr)
|
||||||
memset (&state, 0, sizeof(state));
|
memset (&state, 0, sizeof(state));
|
||||||
_eth_get_system_id (state.system_id, sizeof(state.system_id));
|
_eth_get_system_id (state.system_id, sizeof(state.system_id));
|
||||||
strlcpy (state.sim, sim_name, sizeof(state.sim));
|
strlcpy (state.sim, sim_name, sizeof(state.sim));
|
||||||
getcwd (state.cwd, sizeof(state.cwd));
|
if (getcwd (state.cwd, sizeof(state.cwd))) {};
|
||||||
if (uptr)
|
if (uptr)
|
||||||
strlcpy (state.uname, sim_uname (uptr), sizeof(state.uname));
|
strlcpy (state.uname, sim_uname (uptr), sizeof(state.uname));
|
||||||
cptr = strchr (strmac, '>');
|
cptr = strchr (strmac, '>');
|
||||||
|
@ -426,7 +426,7 @@ t_stat eth_mac_scan_ex (ETH_MAC* mac, const char* strmac, UNIT *uptr)
|
||||||
strlcpy (state.file, cptr + 1, sizeof(state.file));
|
strlcpy (state.file, cptr + 1, sizeof(state.file));
|
||||||
if ((f = fopen (state.file, "r"))) {
|
if ((f = fopen (state.file, "r"))) {
|
||||||
filebuf[sizeof(filebuf)-1] = '\0';
|
filebuf[sizeof(filebuf)-1] = '\0';
|
||||||
fgets (filebuf, sizeof(filebuf)-1, f);
|
if (fgets (filebuf, sizeof(filebuf)-1, f)) {};
|
||||||
strmac = filebuf;
|
strmac = filebuf;
|
||||||
fclose (f);
|
fclose (f);
|
||||||
strcpy (state.file, ""); /* avoid saving */
|
strcpy (state.file, ""); /* avoid saving */
|
||||||
|
@ -1573,10 +1573,10 @@ static void eth_get_nic_hw_addr(ETH_DEV* dev, const char *devname)
|
||||||
memset(command, 0, sizeof(command));
|
memset(command, 0, sizeof(command));
|
||||||
/* try to force an otherwise unused interface to be turned on */
|
/* try to force an otherwise unused interface to be turned on */
|
||||||
snprintf(command, sizeof(command)-1, "ifconfig %.*s up", (int)(sizeof(command) - 14), devname);
|
snprintf(command, sizeof(command)-1, "ifconfig %.*s up", (int)(sizeof(command) - 14), devname);
|
||||||
(void)system(command);
|
if (system(command)) {};
|
||||||
for (i=0; patterns[i] && (0 == dev->have_host_nic_phy_addr); ++i) {
|
for (i=0; patterns[i] && (0 == dev->have_host_nic_phy_addr); ++i) {
|
||||||
snprintf(command, sizeof(command)-1, "ifconfig %.*s | %s >NIC.hwaddr", (int)(sizeof(command) - (26 + strlen(patterns[i]))), devname, patterns[i]);
|
snprintf(command, sizeof(command)-1, "ifconfig %.*s | %s >NIC.hwaddr", (int)(sizeof(command) - (26 + strlen(patterns[i]))), devname, patterns[i]);
|
||||||
(void)system(command);
|
if (system(command)) {};
|
||||||
if (NULL != (f = fopen("NIC.hwaddr", "r"))) {
|
if (NULL != (f = fopen("NIC.hwaddr", "r"))) {
|
||||||
while (0 == dev->have_host_nic_phy_addr) {
|
while (0 == dev->have_host_nic_phy_addr) {
|
||||||
if (fgets(command, sizeof(command)-1, f)) {
|
if (fgets(command, sizeof(command)-1, f)) {
|
||||||
|
@ -1662,12 +1662,12 @@ FILE *f;
|
||||||
|
|
||||||
memset (buf, 0, buf_size);
|
memset (buf, 0, buf_size);
|
||||||
if ((f = fopen ("/etc/machine-id", "r"))) {
|
if ((f = fopen ("/etc/machine-id", "r"))) {
|
||||||
fread (buf, 1, buf_size, f);
|
if (fread (buf, 1, buf_size - 1, f)) {};
|
||||||
fclose (f);
|
fclose (f);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ((f = popen ("hostname", "r"))) {
|
if ((f = popen ("hostname", "r"))) {
|
||||||
fread (buf, 1, buf_size, f);
|
if (fread (buf, 1, buf_size - 1, f)) {};
|
||||||
pclose (f);
|
pclose (f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2165,7 +2165,7 @@ else { /* !tap: */
|
||||||
/* try to force an otherwise unused interface to be turned on */
|
/* try to force an otherwise unused interface to be turned on */
|
||||||
memset(command, 0, sizeof(command));
|
memset(command, 0, sizeof(command));
|
||||||
snprintf(command, sizeof(command)-1, "ifconfig %s up", savname);
|
snprintf(command, sizeof(command)-1, "ifconfig %s up", savname);
|
||||||
(void)system(command);
|
if (system(command)) {};
|
||||||
errbuf[0] = '\0';
|
errbuf[0] = '\0';
|
||||||
*handle = (void*) pcap_open_live(savname, bufsz, ETH_PROMISC, PCAP_READ_TIMEOUT, errbuf);
|
*handle = (void*) pcap_open_live(savname, bufsz, ETH_PROMISC, PCAP_READ_TIMEOUT, errbuf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -867,7 +867,7 @@ if (!simulator_panel) {
|
||||||
p->pidProcess = fork();
|
p->pidProcess = fork();
|
||||||
if (p->pidProcess == 0) {
|
if (p->pidProcess == 0) {
|
||||||
close (0); close (1); close (2); /* make sure not to pass the open standard handles */
|
close (0); close (1); close (2); /* make sure not to pass the open standard handles */
|
||||||
dup (dup (open ("/dev/null", O_RDWR))); /* open standard handles to /dev/null */
|
if (dup (dup (open ("/dev/null", O_RDWR)))) {}; /* open standard handles to /dev/null */
|
||||||
if (execlp (sim_path, sim_path, p->temp_config, NULL, NULL)) {
|
if (execlp (sim_path, sim_path, p->temp_config, NULL, NULL)) {
|
||||||
perror ("execl");
|
perror ("execl");
|
||||||
exit(errno);
|
exit(errno);
|
||||||
|
|
Loading…
Add table
Reference in a new issue