From 30ed4b70c65061d1aef449c62bf3b7b020b39c86 Mon Sep 17 00:00:00 2001 From: Albert Cahalan Date: Sun, 9 Jan 2005 23:58:10 +0000 Subject: [PATCH] kill some compiler warnings, prep to enable -Wshadow --- src/tuxpaint.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 075320f12..3a080517d 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -122,9 +122,13 @@ static scaleparams scaletable[] = { #include #include #include -#include #include +// math.h makes y1 an obscure function! +#define y1 evil_y1 +#include +#undef y1 + #ifdef USE_HQ4X #include "hqxx.h" #include "hq3x.h" @@ -2099,7 +2103,7 @@ static void draw_none(void); #ifndef NOSOUND static void loadarbitrary(SDL_Surface * surfs[], SDL_Surface * altsurfs[], char * descs[], info_type * infs[], - Mix_Chunk * sounds[], int * count, int starting, int max, + Mix_Chunk * mysounds[], int * count, int starting, int max, const char * const dir, int fatal, int maxw, int maxh); #else static void loadarbitrary(SDL_Surface * surfs[], SDL_Surface * altsurfs[], @@ -5231,11 +5235,11 @@ static void do_brick(int x, int y, int w, int h) dest.h = h; // brick color: 127,76,73 - double rand_r = rand()/(double)RAND_MAX; - double rand_g = rand()/(double)RAND_MAX; - double base_r = sRGB_to_linear_table[color_hexes[cur_color][0]]*1.5 + sRGB_to_linear_table[127]*5.0 + rand_r; - double base_g = sRGB_to_linear_table[color_hexes[cur_color][1]]*1.5 + sRGB_to_linear_table[76] *5.0 + rand_g; - double base_b = sRGB_to_linear_table[color_hexes[cur_color][2]]*1.5 + sRGB_to_linear_table[73] *5.0 + (rand_r+rand_g*2.0)/3.0; + double ran_r = rand()/(double)RAND_MAX; + double ran_g = rand()/(double)RAND_MAX; + double base_r = sRGB_to_linear_table[color_hexes[cur_color][0]]*1.5 + sRGB_to_linear_table[127]*5.0 + ran_r; + double base_g = sRGB_to_linear_table[color_hexes[cur_color][1]]*1.5 + sRGB_to_linear_table[76] *5.0 + ran_g; + double base_b = sRGB_to_linear_table[color_hexes[cur_color][2]]*1.5 + sRGB_to_linear_table[73] *5.0 + (ran_r+ran_g*2.0)/3.0; Uint8 r = linear_to_sRGB(base_r/7.5); Uint8 g = linear_to_sRGB(base_g/7.5); @@ -6580,7 +6584,6 @@ static void setup(int argc, char * argv[]) if (ok_to_use_lockfile) { char * lock_fname; - FILE * fi; time_t time_lock, time_now; @@ -8731,7 +8734,7 @@ static void draw_none(void) #ifndef NOSOUND static void loadarbitrary(SDL_Surface * surfs[], SDL_Surface * altsurfs[], char * descs[], info_type * infs[], - Mix_Chunk * sounds[], + Mix_Chunk * mysounds[], int * count, int starting, int max, const char * const dir, int fatal, int maxw, int maxh) #else @@ -8848,7 +8851,7 @@ static void loadarbitrary(SDL_Surface * surfs[], SDL_Surface * altsurfs[], debug("...is a directory"); #ifndef NOSOUND - loadarbitrary(surfs, altsurfs, descs, infs, sounds, + loadarbitrary(surfs, altsurfs, descs, infs, mysounds, count, *count, max, fname, fatal, maxw, maxh); #else @@ -8883,8 +8886,8 @@ static void loadarbitrary(SDL_Surface * surfs[], SDL_Surface * altsurfs[], #ifndef NOSOUND if (use_sound) { - if (sounds != NULL) - sounds[*count] = loadsound(fname); + if (mysounds != NULL) + mysounds[*count] = loadsound(fname); } #endif