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)"
This commit is contained in:
Bill Kendrick 2022-02-05 16:59:59 -08:00
parent 36968b0abf
commit e7d81ef63f
2 changed files with 5 additions and 3 deletions

View file

@ -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))));
}