From e7d81ef63f6d8c7fd227e5bed1da130ae05d86b9 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Sat, 5 Feb 2022 16:59:59 -0800 Subject: [PATCH] Clean up some compile-time warnings/errors Under Xcode with clang, Mark Kim was getting an error: src/tuxpaint.c:23125:44: error: use of undeclared identifier 'i' SDL_MapRGB(img_color_btns[i]->format, ^ Oddly, I was not getting errors no matter what nonsense I put in there (e.g., changing "->format" to "->formatXYZ"), under "gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)" --- src/cursor.c | 4 +++- src/tuxpaint.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cursor.c b/src/cursor.c index 7653d7147..ecbc6300c 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - January 25, 2022 + June 14, 2002 - February 5, 2022 $Id$ */ @@ -82,6 +82,8 @@ void do_setcursor(SDL_Cursor * c) UNUSED(tiny_mask_bits); UNUSED(arrow_bits); UNUSED(arrow_mask_bits); + UNUSED(pipette_bits); + UNUSED(pipette_mask_bits); if (!hide_cursor && !no_fancy_cursors) SDL_SetCursor(c); diff --git a/src/tuxpaint.c b/src/tuxpaint.c index e1fac91bd..7c4f4477e 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -23122,13 +23122,13 @@ static void render_color_button(int the_color, SDL_Surface * decoration, SDL_Sur { putpixels[img_color_btns[the_color]->format->BytesPerPixel] (img_color_btns[the_color], x, y, - SDL_MapRGB(img_color_btns[i]->format, + SDL_MapRGB(img_color_btns[the_color]->format, linear_to_sRGB(rh * aa + ru * (1.0 - aa)), linear_to_sRGB(gh * aa + gu * (1.0 - aa)), linear_to_sRGB(bh * aa + bu * (1.0 - aa)))); putpixels[img_color_btns[the_color + NUM_COLORS]->format->BytesPerPixel] (img_color_btns[the_color + NUM_COLORS], x, y, - SDL_MapRGB(img_color_btns[i + NUM_COLORS]->format, + SDL_MapRGB(img_color_btns[the_color + NUM_COLORS]->format, linear_to_sRGB(rh * aa + rd * (1.0 - aa)), linear_to_sRGB(gh * aa + gd * (1.0 - aa)), linear_to_sRGB(bh * aa + bd * (1.0 - aa)))); }