Skip to content

Commit

Permalink
Fix a printf format string signedness warning
Browse files Browse the repository at this point in the history
gcc 13.2 outputs several warnings for mismatched printf format strings, such as:

/home/david/Development/julius/test/sav/sav_compare.c: In function ‘compare_part’:
/home/david/Development/julius/test/sav/sav_compare.c:522:45: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 3 has type ‘int’ [-Wformat=]
  522 |                 printf("record %d offset 0x%X", i / save_game_parts[index].record_length, i % save_game_parts[index].record_length);
      |                                            ~^                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                             |                                               |
      |                                             unsigned int                                    int
      |                                            %X

This patch doesn't fix all of them, but does fix the simple ones.

Signed-off-by: David Gow <david@ingeniumdigital.com>
  • Loading branch information
sulix authored and bvschaik committed Mar 1, 2024
1 parent b679c28 commit af7996c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/platform/julius.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ static void handle_window_event(SDL_WindowEvent *event, int *window_active)
break;

case SDL_WINDOWEVENT_SHOWN:
SDL_Log("Window %d shown", (unsigned int) event->windowID);
SDL_Log("Window %u shown", (unsigned int) event->windowID);
*window_active = 1;
break;
case SDL_WINDOWEVENT_HIDDEN:
SDL_Log("Window %d hidden", (unsigned int) event->windowID);
SDL_Log("Window %u hidden", (unsigned int) event->windowID);
*window_active = 0;
break;
}
Expand Down

0 comments on commit af7996c

Please sign in to comment.