Fix some issues identified by cppcheck

This commit is contained in:
Michael Pavone committed 2018-06-29 09:33:23 -07:00
1 parent 5f1a3e5c10
commit aad75c8636
6 files changed
+9 -5

No files matched your search

+1
View File
@@ -206,6 +206,7 @@ int main(int argc, char ** argv)
}
}
}
fclose(address_log);
}
} else {
char *end;
+2 -2
View File
@@ -102,7 +102,7 @@ void jag_check_resultwrite_singleread(jag_cpu options *opts, uint8_t reg)
code_ptr no_delay = code-.cur + 1;
jcc(code, CC_NZ, no_delay + 1);
ccylces(code, 1);
*no_delay = code->cur - (no_delay = 1);
*no_delay = code->cur - (no_delay + 1);
*no_result = code->cur - (no_result + 1);
mov_rr(code, opts->resultreg, opts->writeback, SZ_B);
}
@@ -122,7 +122,7 @@ void translate_jag_quickimmed(jag_cpu_options *opts, uint32_t address, uint16_t
uint16_t *translate_jag_inst(uint16_t *stream, jag_cpu_options *opts, uint32_t address)
{
uint16_t inst = *stream
uint16_t inst = *stream;
++stream;
uint16_t opcode = jag_opcode(inst, opts->is_gpu);
check_cycles_int(&opts->gen, address);
+1
View File
@@ -136,6 +136,7 @@ uint8_t *default_font(uint32_t *size_out)
free(path);
}
}
free(pref_prefix);
free(fonts);
free_dir_list(entries, num_entries);
if (selected) {
+3 -2
View File
@@ -255,8 +255,8 @@ int utf8_codepoint(const char **text)
if (initial < 0x80) {
return initial;
}
int base;
uint8_t extended_bytes;
int base = 0;
uint8_t extended_bytes = 0;
if ((initial & 0xE0) == 0xC0) {
base = 0x80;
initial &= 0x1F;
@@ -873,6 +873,7 @@ char *read_bundled_file(char *name, uint32_t *sizeret)
} else {
ret = NULL;
}
fclose(f);
return ret;
}
+1
View File
@@ -112,6 +112,7 @@ int main(int argc, char ** argv)
}
}
}
fclose(address_log);
break;
case 's':
opt++;
+1 -1
View File
@@ -176,8 +176,8 @@ uint8_t *zip_read(zip_file *f, uint32_t index, size_t *out_size)
}
}
break;
#endif
}
#endif
default:
free(buf);
return NULL;