Backport a few warning squelches from sdl-2.0 branch

https://sourceforge.net/p/tuxpaint/tuxpaint/ci/dfba73d327df49cbea16207ab25c11991be2c0c7/
This commit is contained in:
Bill Kendrick 2022-05-19 01:05:19 -07:00
parent a6f5449ce4
commit c8db730c4f
2 changed files with 8 additions and 4 deletions

View file

@ -1,7 +1,7 @@
/* /*
fonts.h fonts.h
Copyright (c) 2009-2017 Copyright (c) 2009-2022
http://www.tuxpaint.org/ http://www.tuxpaint.org/
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@ -65,9 +65,13 @@
#define SDL_mutex int #define SDL_mutex int
#define SDL_CreateMutex() 0 // creates in released state #define SDL_CreateMutex() 0 // creates in released state
#define SDL_DestroyMutex(lock) #define SDL_DestroyMutex(lock)
#ifndef SDL_mutexP
#define SDL_mutexP(lock) // take lock #define SDL_mutexP(lock) // take lock
#endif
#ifndef SDL_mutexV
#define SDL_mutexV(lock) // release lock #define SDL_mutexV(lock) // release lock
#endif #endif
#endif
#endif #endif

View file

@ -22,7 +22,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt) (See COPYING.txt)
June 14, 2002 - May 18, 2022 June 14, 2002 - May 19, 2022
*/ */
#include "platform.h" #include "platform.h"
@ -1050,7 +1050,7 @@ static void update_screen_rect(SDL_Rect * r)
static int hit_test(const SDL_Rect * const r, unsigned x, unsigned y) static int hit_test(const SDL_Rect * const r, unsigned x, unsigned y)
{ {
/* note the use of unsigned math: no need to check for negative */ /* note the use of unsigned math: no need to check for negative */
return x - r->x < r->w && y - r->y < r->h; return (x - (unsigned) r->x < (unsigned) r->w) && (y - (unsigned) r->y < (unsigned) r->h);
} }
#define HIT(r) hit_test(&(r), event.button.x, event.button.y) #define HIT(r) hit_test(&(r), event.button.x, event.button.y)
@ -14551,7 +14551,7 @@ static int do_save(int tool, int dont_show_success_results)
{ {
int scroll; int scroll;
char *fname; char *fname;
char tmp[1024]; char tmp[FILENAME_MAX + 16];
SDL_Surface *thm; SDL_Surface *thm;
FILE *fi; FILE *fi;