More linting in src

This commit is contained in:
Jasmine Iwanek
2023-08-21 20:25:33 -04:00
parent bacf8deae3
commit b8c4dee3bf
17 changed files with 193 additions and 161 deletions

View File

@@ -111,7 +111,7 @@ static void *
ps2_nvr_init(const device_t *info)
{
ps2_nvr_t *nvr;
FILE *f = NULL;
FILE *fp = NULL;
int c;
nvr = (ps2_nvr_t *) malloc(sizeof(ps2_nvr_t));
@@ -130,14 +130,14 @@ ps2_nvr_init(const device_t *info)
io_sethandler(0x0074, 3,
ps2_nvr_read, NULL, NULL, ps2_nvr_write, NULL, NULL, nvr);
f = nvr_fopen(nvr->fn, "rb");
fp = nvr_fopen(nvr->fn, "rb");
nvr->ram = (uint8_t *) malloc(nvr->size);
memset(nvr->ram, 0xff, nvr->size);
if (f != NULL) {
if (fread(nvr->ram, 1, nvr->size, f) != nvr->size)
if (fp != NULL) {
if (fread(nvr->ram, 1, nvr->size, fp) != nvr->size)
fatal("ps2_nvr_init(): Error reading EEPROM data\n");
fclose(f);
fclose(fp);
}
return nvr;
@@ -147,13 +147,13 @@ static void
ps2_nvr_close(void *priv)
{
ps2_nvr_t *nvr = (ps2_nvr_t *) priv;
FILE *f = NULL;
FILE *fp = NULL;
f = nvr_fopen(nvr->fn, "wb");
fp = nvr_fopen(nvr->fn, "wb");
if (f != NULL) {
(void) fwrite(nvr->ram, nvr->size, 1, f);
fclose(f);
if (fp != NULL) {
(void) fwrite(nvr->ram, nvr->size, 1, fp);
fclose(fp);
}
if (nvr->ram != NULL)