1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-01-11 23:43:04 +00:00

Fix some issues reported by cppcheck

This commit is contained in:
Gerald Schnabel 2023-09-18 22:40:27 +02:00
parent cbf1d9f7e5
commit d7e2a06369
5 changed files with 11 additions and 5 deletions

View File

@ -287,7 +287,8 @@ void ini_parse(const ini_cfg_t* cfg, const char *alter_section, int tag)
int section = INI_SECTION_INVALID_ID;
int line_status;
ini_parser_debugf("Start INI parser for core \"%s\".", alter_section);
if (alter_section)
ini_parser_debugf("Start INI parser for core \"%s\".", alter_section);
// open ini file
#ifdef INI_PARSER_TEST
@ -430,4 +431,3 @@ void ini_save(const ini_cfg_t* cfg, int tag)
#endif
}

View File

@ -214,6 +214,7 @@ static char CueISOFileSelected(uint8_t idx, const char *SelectedName) {
char res;
res = cue_parse(SelectedName, &sd_image[hdf_idx]);
if (res) ErrorMessage(cue_error_msg[res-1], res);
return 0;
}
static char KickstartReload(uint8_t idx) {

View File

@ -97,6 +97,8 @@ int main(int argc, char **argv) {
unsigned char *bin = malloc(size);
if(fread(bin, 1, size, inf) != size) {
printf("Read error on %s\n", argv[1]);
free(bin);
fclose(inf);
return -1;
}
fclose(inf);
@ -129,6 +131,7 @@ int main(int argc, char **argv) {
fwrite(&upgrade, 1, sizeof(UPGRADE), outf);
fwrite(bin, 1, size, outf);
free(bin);
fclose(outf);
return 0;

View File

@ -82,4 +82,6 @@ uint8_t joystick_release(uint8_t c_jindex) {
StateNumJoysticksSet(joysticks);
if (joysticks < 6)
StateUsbIdSet(0, 0, 0, joysticks);
return 0;
}

View File

@ -2235,7 +2235,7 @@ void user_io_kbd(unsigned char m, unsigned char *k, uint8_t priority, unsigned s
{
if(emu_mode == EMU_MOUSE)
{
unsigned char b;
unsigned char b = 0;
if(emu_state & JOY_BTN1) b |= 1;
if(emu_state & JOY_BTN2) b |= 2;
user_io_mouse(0, b, 0, 0, 0);
@ -2315,7 +2315,7 @@ void user_io_kbd(unsigned char m, unsigned char *k, uint8_t priority, unsigned s
user_io_joystick_emu();
if(keyrah == 2)
{
unsigned char b;
unsigned char b = 0;
if(emu_state & JOY_BTN1) b |= 1;
if(emu_state & JOY_BTN2) b |= 2;
user_io_mouse(0, b, 0, 0, 0);
@ -2382,7 +2382,7 @@ void user_io_kbd(unsigned char m, unsigned char *k, uint8_t priority, unsigned s
user_io_joystick_emu();
if(keyrah == 2)
{
unsigned char b;
unsigned char b = 0;
if(emu_state & JOY_BTN1) b |= 1;
if(emu_state & JOY_BTN2) b |= 2;
user_io_mouse(0, b, 0, 0, 0);