Browse Source

tray, unix: fix -Wformat warnings

src/tray/unix/SDL_tray.c: In function 'get_tmp_filename':
src/tray/unix/SDL_tray.c:345: warning: format '%ld' expects type 'long int', but argument 2 has type 'size_t'
src/tray/unix/SDL_tray.c: In function 'get_appindicator_id':
src/tray/unix/SDL_tray.c:361: warning: format '%ld' expects type 'long int', but argument 3 has type 'unsigned int'
Ozkan Sezer 3 months ago
parent
commit
ec8a780ad4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/tray/unix/SDL_tray.c

+ 2 - 2
src/tray/unix/SDL_tray.c

@@ -342,7 +342,7 @@ static bool get_tmp_filename(char *buffer, size_t size)
     static int count = 0;
 
     if (size < 64) {
-        return SDL_SetError("Can't create temporary file for icon: size %ld < 64", size);
+        return SDL_SetError("Can't create temporary file for icon: size %u < 64", (unsigned int)size);
     }
 
     int would_have_written = SDL_snprintf(buffer, size, "/tmp/sdl_appindicator_icon_%d_%d.bmp", getpid(), count++);
@@ -358,7 +358,7 @@ static const char *get_appindicator_id(void)
     int would_have_written = SDL_snprintf(buffer, sizeof(buffer), "sdl-appindicator-%d-%d", getpid(), count++);
 
     if (would_have_written <= 0 || would_have_written >= sizeof(buffer) - 1) {
-        SDL_SetError("Couldn't fit %d bytes in buffer of size %ld", would_have_written, sizeof(buffer));
+        SDL_SetError("Couldn't fit %d bytes in buffer of size %d", would_have_written, (int) sizeof(buffer));
         return NULL;
     }