Typecast unused returns as (void)

This commit is contained in:
Emile Clark-Boman 2025-07-22 05:51:36 +10:00
parent a5de499495
commit d2709736e5
2 changed files with 4 additions and 4 deletions

View file

@ -1815,7 +1815,7 @@ static JSONValue json_load(const char *filename)
size = ftell(f); size = ftell(f);
fseek(f, 0, SEEK_SET); fseek(f, 0, SEEK_SET);
buf = malloc(size + 1); buf = malloc(size + 1);
fread(buf, 1, size, f); (void)(buf, 1, size, f);
fclose(f); fclose(f);
val = json_parse_value_len(buf, size); val = json_parse_value_len(buf, size);
free(buf); free(buf);

6
temu.c
View file

@ -250,7 +250,7 @@ static int bf_read_async(BlockDevice *bs,
for(i = 0; i < n; i++) { for(i = 0; i < n; i++) {
if (!bf->sector_table[sector_num]) { if (!bf->sector_table[sector_num]) {
fseek(bf->f, sector_num * SECTOR_SIZE, SEEK_SET); fseek(bf->f, sector_num * SECTOR_SIZE, SEEK_SET);
fread(buf, 1, SECTOR_SIZE, bf->f); (void)fread(buf, 1, SECTOR_SIZE, bf->f);
} else { } else {
memcpy(buf, bf->sector_table[sector_num], SECTOR_SIZE); memcpy(buf, bf->sector_table[sector_num], SECTOR_SIZE);
} }
@ -259,7 +259,7 @@ static int bf_read_async(BlockDevice *bs,
} }
} else { } else {
fseek(bf->f, sector_num * SECTOR_SIZE, SEEK_SET); fseek(bf->f, sector_num * SECTOR_SIZE, SEEK_SET);
fread(buf, 1, n * SECTOR_SIZE, bf->f); (void)fread(buf, 1, n * SECTOR_SIZE, bf->f);
} }
/* synchronous read */ /* synchronous read */
return 0; return 0;
@ -357,7 +357,7 @@ static void tun_write_packet(EthernetDevice *net,
const uint8_t *buf, int len) const uint8_t *buf, int len)
{ {
TunState *s = net->opaque; TunState *s = net->opaque;
write(s->fd, buf, len); (void)write(s->fd, buf, len);
} }
static void tun_select_fill(EthernetDevice *net, int *pfd_max, static void tun_select_fill(EthernetDevice *net, int *pfd_max,