From c8db730c4ffcb7c9b1690358abe9c3a1bcf3cff1 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Thu, 19 May 2022 01:05:19 -0700 Subject: [PATCH] Backport a few warning squelches from sdl-2.0 branch https://sourceforge.net/p/tuxpaint/tuxpaint/ci/dfba73d327df49cbea16207ab25c11991be2c0c7/ --- src/fonts.h | 6 +++++- src/tuxpaint.c | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/fonts.h b/src/fonts.h index 822e14cbc..9d7918036 100644 --- a/src/fonts.h +++ b/src/fonts.h @@ -1,7 +1,7 @@ /* fonts.h - Copyright (c) 2009-2017 + Copyright (c) 2009-2022 http://www.tuxpaint.org/ This program is free software; you can redistribute it and/or modify @@ -65,9 +65,13 @@ #define SDL_mutex int #define SDL_CreateMutex() 0 // creates in released state #define SDL_DestroyMutex(lock) +#ifndef SDL_mutexP #define SDL_mutexP(lock) // take lock +#endif +#ifndef SDL_mutexV #define SDL_mutexV(lock) // release lock #endif +#endif #endif diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 7e3168a1e..7884c6212 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - May 18, 2022 + June 14, 2002 - May 19, 2022 */ #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) { /* 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) @@ -14551,7 +14551,7 @@ static int do_save(int tool, int dont_show_success_results) { int scroll; char *fname; - char tmp[1024]; + char tmp[FILENAME_MAX + 16]; SDL_Surface *thm; FILE *fi;