Re-run indent.sh under GNU indent 2.2.13

Slight change to its default behavior re: pointer variables
(before: "type * var"; now seems to prefer: "type *var").
This commit is contained in:
Bill Kendrick 2024-10-20 11:22:30 -07:00
parent 073ac19ce6
commit 44d7d0ee5d
94 changed files with 2831 additions and 2856 deletions

View file

@ -32,7 +32,7 @@ char *get_nativelibdir()
return nativelibdir;
}
void load_assets_dir(char *dirname, tp_ftw_str ** ffilenames, unsigned *num_file_names)
void load_assets_dir(char *dirname, tp_ftw_str **ffilenames, unsigned *num_file_names)
{
AAssetDir *assetDir = AAssetManager_openDir(asset_manager, dirname);
const char *filename = (const char *)NULL;
@ -67,7 +67,7 @@ void load_assets_dir(char *dirname, tp_ftw_str ** ffilenames, unsigned *num_file
*ffilenames = filenames;
}
JNIEXPORT jboolean Java_org_tuxpaint_tuxpaintActivity_managertojni(JNIEnv * env, jclass clazz, jobject mgr)
JNIEXPORT jboolean Java_org_tuxpaint_tuxpaintActivity_managertojni(JNIEnv *env, jclass clazz, jobject mgr)
{
asset_manager = AAssetManager_fromJava(env, mgr);
@ -77,7 +77,7 @@ JNIEXPORT jboolean Java_org_tuxpaint_tuxpaintActivity_managertojni(JNIEnv * env,
return 1;
}
JNIEXPORT void Java_org_tuxpaint_tuxpaintActivity_setnativelibdir(JNIEnv * env, jclass clazz, jstring path)
JNIEXPORT void Java_org_tuxpaint_tuxpaintActivity_setnativelibdir(JNIEnv *env, jclass clazz, jstring path)
{
const char *cpath = (*env)->GetStringUTFChars(env, path, NULL);
@ -86,13 +86,13 @@ JNIEXPORT void Java_org_tuxpaint_tuxpaintActivity_setnativelibdir(JNIEnv * env,
}
void load_brushes_from_assets(SDL_Surface * screen, SDL_Texture * texture,
SDL_Renderer * renderer, const char *dirname,
void (*fn)(SDL_Surface * screen,
SDL_Texture * texture,
SDL_Renderer * renderer,
void load_brushes_from_assets(SDL_Surface *screen, SDL_Texture *texture,
SDL_Renderer *renderer, const char *dirname,
void (*fn)(SDL_Surface *screen,
SDL_Texture *texture,
SDL_Renderer *renderer,
const char *restrict const dir,
unsigned dirlen, tp_ftw_str * files,
unsigned dirlen, tp_ftw_str *files,
unsigned count, const char *restrict const locale))
{
unsigned num_file_names = 0;
@ -111,13 +111,12 @@ void load_brushes_from_assets(SDL_Surface * screen, SDL_Texture * texture,
void load_from_assets(SDL_Surface * screen, SDL_Texture * texture,
SDL_Renderer * renderer, const char *dirname,
void (*fn)(SDL_Surface * screen, SDL_Texture * texture,
SDL_Renderer * renderer,
void load_from_assets(SDL_Surface *screen, SDL_Texture *texture,
SDL_Renderer *renderer, const char *dirname,
void (*fn)(SDL_Surface *screen, SDL_Texture *texture,
SDL_Renderer *renderer,
const char *restrict const dir,
unsigned dirlen, tp_ftw_str * files,
unsigned count, const char *restrict const locale))
unsigned dirlen, tp_ftw_str *files, unsigned count, const char *restrict const locale))
{
unsigned num_file_names = 0;

View file

@ -49,7 +49,7 @@ int IsPrinterAvailable(void)
// This function is based on
// (1) convert surface to Java BitMap object
// (2) call Java PrintHelper to do print job.
const char *SurfacePrint(SDL_Surface * surface)
const char *SurfacePrint(SDL_Surface *surface)
{
JNIEnv *mEnv = Android_JNI_GetEnv();
jclass mBitmapClass = (*mEnv)->FindClass(mEnv, "android/graphics/Bitmap");

View file

@ -54,7 +54,7 @@ int no_fancy_cursors;
*
* @param c The cursor shape to use.
*/
void do_setcursor(SDL_Cursor * c)
void do_setcursor(SDL_Cursor *c)
{
/* Shut GCC up over the fact that the XBMs are #included within cursor.h
but used in tuxpaint.c (and not cursor.c) */
@ -93,7 +93,7 @@ void do_setcursor(SDL_Cursor * c)
*
* @param cursor Pointer to a cursor to free; will be set to point to NULL afterwards.
*/
void free_cursor(SDL_Cursor ** cursor)
void free_cursor(SDL_Cursor **cursor)
{
if (*cursor)
{

View file

@ -79,10 +79,10 @@ extern char *strcasestr(const char *haystack, const char *needle);
* @param screen Screen surface, for animating progress bar.
* FIXME
*/
void loadfont_callback(SDL_Surface * screen, SDL_Texture * texture,
SDL_Renderer * renderer,
void loadfont_callback(SDL_Surface *screen, SDL_Texture *texture,
SDL_Renderer *renderer,
const char *restrict const dir, unsigned dirlen,
tp_ftw_str * files, unsigned i, const char *restrict const locale)
tp_ftw_str *files, unsigned i, const char *restrict const locale)
{
dirlen = dirlen;
@ -319,14 +319,14 @@ int compare_ftw_str(const void *v1, const void *v2)
* @param fn Callback function to invoke
* @param locale Locale, to pass to callback function when applicable (i.e., for fonts), else NULL
*/
void tp_ftw(SDL_Surface * screen, SDL_Texture * texture,
SDL_Renderer * renderer, char *restrict const dir,
unsigned dirlen, int rsrc, void (*fn)(SDL_Surface * screen,
SDL_Texture * texture,
SDL_Renderer * renderer,
void tp_ftw(SDL_Surface *screen, SDL_Texture *texture,
SDL_Renderer *renderer, char *restrict const dir,
unsigned dirlen, int rsrc, void (*fn)(SDL_Surface *screen,
SDL_Texture *texture,
SDL_Renderer *renderer,
const char *restrict const
dir, unsigned dirlen,
tp_ftw_str * files,
tp_ftw_str *files,
unsigned count,
const char *restrict const locale), const char *restrict const locale)
{

View file

@ -203,7 +203,7 @@ void cleanup_queue(void)
/* Returns how similar colors 'c1' and 'c2' are */
double colors_close(SDL_Surface * canvas, Uint32 c1, Uint32 c2)
double colors_close(SDL_Surface *canvas, Uint32 c1, Uint32 c2)
{
Uint8 r1, g1, b1, r2, g2, b2;
@ -236,7 +236,7 @@ double colors_close(SDL_Surface * canvas, Uint32 c1, Uint32 c2)
}
}
int would_flood_fill(SDL_Surface * canvas, Uint32 cur_colr, Uint32 old_colr)
int would_flood_fill(SDL_Surface *canvas, Uint32 cur_colr, Uint32 old_colr)
{
if (colors_close(canvas, cur_colr, old_colr) < COLOR_MATCH_NARROW)
{
@ -248,16 +248,16 @@ int would_flood_fill(SDL_Surface * canvas, Uint32 cur_colr, Uint32 old_colr)
}
}
void do_flood_fill(SDL_Surface * screen, SDL_Texture * texture,
SDL_Renderer * renderer, SDL_Surface * last,
SDL_Surface * canvas, int x, int y, Uint32 cur_colr,
Uint32 old_colr, int *x1, int *y1, int *x2, int *y2, Uint8 * touched)
void do_flood_fill(SDL_Surface *screen, SDL_Texture *texture,
SDL_Renderer *renderer, SDL_Surface *last,
SDL_Surface *canvas, int x, int y, Uint32 cur_colr,
Uint32 old_colr, int *x1, int *y1, int *x2, int *y2, Uint8 *touched)
{
simulate_flood_fill(screen, texture, renderer, last, canvas, x, y, cur_colr, old_colr, x1, y1, x2, y2, touched);
}
Uint32 blend(SDL_Surface * canvas, Uint32 draw_colr, Uint32 old_colr, double pct)
Uint32 blend(SDL_Surface *canvas, Uint32 draw_colr, Uint32 old_colr, double pct)
{
Uint8 old_r, old_g, old_b, draw_r, draw_g, draw_b, new_r, new_g, new_b;
@ -272,11 +272,11 @@ Uint32 blend(SDL_Surface * canvas, Uint32 draw_colr, Uint32 old_colr, double pct
return SDL_MapRGB(canvas->format, new_r, new_g, new_b);
}
void simulate_flood_fill(SDL_Surface * screen, SDL_Texture * texture,
SDL_Renderer * renderer, SDL_Surface * last,
SDL_Surface * canvas, int x, int y, Uint32 cur_colr,
void simulate_flood_fill(SDL_Surface *screen, SDL_Texture *texture,
SDL_Renderer *renderer, SDL_Surface *last,
SDL_Surface *canvas, int x, int y, Uint32 cur_colr,
Uint32 old_colr, int *extent_x1, int *extent_y1,
int *extent_x2, int *extent_y2, Uint8 * touched)
int *extent_x2, int *extent_y2, Uint8 *touched)
{
int y_outside;
@ -310,8 +310,8 @@ void simulate_flood_fill(SDL_Surface * screen, SDL_Texture * texture,
*extent_y2 = global_extent_y2;
}
void simulate_flood_fill_outside_check(SDL_Surface * screen,
SDL_Texture * texture, SDL_Renderer * renderer, int x, int y, int y_outside)
void simulate_flood_fill_outside_check(SDL_Surface *screen,
SDL_Texture *texture, SDL_Renderer *renderer, int x, int y, int y_outside)
{
int fillL, fillR, narrowFillL, narrowFillR, i, outside, just_queued;
double in_line, closeness;
@ -553,9 +553,9 @@ void simulate_flood_fill_outside_check(SDL_Surface * screen,
}
void draw_linear_gradient(SDL_Surface * canvas, SDL_Surface * last,
void draw_linear_gradient(SDL_Surface *canvas, SDL_Surface *last,
int x_left, int y_top, int x_right, int y_bottom,
int x1, int y1, int x2, int y2, Uint32 draw_color, Uint8 * touched)
int x1, int y1, int x2, int y2, Uint32 draw_color, Uint8 *touched)
{
Uint32 old_colr, new_colr;
int xx, yy;
@ -618,7 +618,7 @@ void draw_linear_gradient(SDL_Surface * canvas, SDL_Surface * last,
}
}
void draw_brush_fill_single(SDL_Surface * canvas, int x, int y, Uint32 draw_color, Uint8 * touched)
void draw_brush_fill_single(SDL_Surface *canvas, int x, int y, Uint32 draw_color, Uint8 *touched)
{
int xx, yy;
int pix;
@ -640,11 +640,11 @@ void draw_brush_fill_single(SDL_Surface * canvas, int x, int y, Uint32 draw_colo
}
}
void draw_brush_fill(SDL_Surface * canvas,
void draw_brush_fill(SDL_Surface *canvas,
int x_left ATTRIBUTE_UNUSED, int y_top ATTRIBUTE_UNUSED,
int x_right ATTRIBUTE_UNUSED,
int y_bottom ATTRIBUTE_UNUSED, int x1, int y1, int x2,
int y2, Uint32 draw_color, Uint8 * touched, int *up_x1, int *up_y1, int *up_x2, int *up_y2)
int y2, Uint32 draw_color, Uint8 *touched, int *up_x1, int *up_y1, int *up_x2, int *up_y2)
{
int dx, dy;
int y;
@ -722,8 +722,8 @@ void draw_brush_fill(SDL_Surface * canvas,
*up_y2 = orig_y2 + 16;
}
void draw_radial_gradient(SDL_Surface * canvas, int x_left, int y_top,
int x_right, int y_bottom, int x, int y, Uint32 draw_color, Uint8 * touched)
void draw_radial_gradient(SDL_Surface *canvas, int x_left, int y_top,
int x_right, int y_bottom, int x, int y, Uint32 draw_color, Uint8 *touched)
{
Uint32 old_colr, new_colr;
int xx, yy;
@ -788,7 +788,7 @@ void draw_radial_gradient(SDL_Surface * canvas, int x_left, int y_top,
Converted to C for Tux Paint by Bill Kendrick <bill@newbreedsoftware.com>, 2023
*/
void sdf_pt_get(sdf_grid * g, int x, int y, sdf_point * p)
void sdf_pt_get(sdf_grid *g, int x, int y, sdf_point *p)
{
if (x >= 0 && x < g->w && y >= 0 && y < g->h)
{
@ -800,7 +800,7 @@ void sdf_pt_get(sdf_grid * g, int x, int y, sdf_point * p)
}
}
void sdf_pt_put(sdf_grid * g, int x, int y, sdf_point p)
void sdf_pt_put(sdf_grid *g, int x, int y, sdf_point p)
{
memcpy(&(g->grid[y][x]), &p, sizeof(sdf_point));
}
@ -810,7 +810,7 @@ int sdf_distsq(sdf_point p)
return ((p.dx * p.dx) + (p.dy * p.dy));
}
void sdf_compare(sdf_grid * g, sdf_point * p, int x, int y, int offsetx, int offsety)
void sdf_compare(sdf_grid *g, sdf_point *p, int x, int y, int offsetx, int offsety)
{
sdf_point other;
@ -825,7 +825,7 @@ void sdf_compare(sdf_grid * g, sdf_point * p, int x, int y, int offsetx, int off
}
}
int malloc_sdf_grid(sdf_grid * g, int w, int h)
int malloc_sdf_grid(sdf_grid *g, int w, int h)
{
int i, abort;
@ -864,7 +864,7 @@ int malloc_sdf_grid(sdf_grid * g, int w, int h)
return 1;
}
void free_sdf_grid(sdf_grid * g)
void free_sdf_grid(sdf_grid *g)
{
int i;
@ -879,7 +879,7 @@ void free_sdf_grid(sdf_grid * g)
}
void sdf_fill_bitmask_to_sdf_grids(Uint8 * bitmask, int w, int h, sdf_grid * g1, sdf_grid * g2)
void sdf_fill_bitmask_to_sdf_grids(Uint8 *bitmask, int w, int h, sdf_grid *g1, sdf_grid *g2)
{
int x, y;
@ -902,7 +902,7 @@ void sdf_fill_bitmask_to_sdf_grids(Uint8 * bitmask, int w, int h, sdf_grid * g1,
}
void sdf_generate(sdf_grid * g)
void sdf_generate(sdf_grid *g)
{
int x, y;
sdf_point p;
@ -953,7 +953,7 @@ void sdf_generate(sdf_grid * g)
/* End of Signed Distance Field functions ------------------------------- */
void draw_shaped_gradient(SDL_Surface * canvas, Uint32 draw_color, Uint8 * touched)
void draw_shaped_gradient(SDL_Surface *canvas, Uint32 draw_color, Uint8 *touched)
{
Uint32 old_colr, new_colr;
int xx, yy;

View file

@ -50,12 +50,12 @@ enum
};
static int fill_color[NUM_FILLS] = {
1, /* Flood */
1, /* Brush */
1, /* Linear gradient */
1, /* Radial gradient */
1, /* Shaped gradient */
0, /* Eraser */
1, /* Flood */
1, /* Brush */
1, /* Linear gradient */
1, /* Radial gradient */
1, /* Shaped gradient */
0, /* Eraser */
};
const char *const fill_tips[NUM_FILLS] = {

View file

@ -203,7 +203,7 @@ default_locale_font_t default_local_fonts[] = {
{-1, NULL, NULL},
};
void TuxPaint_Font_CloseFont(TuxPaint_Font * tpf)
void TuxPaint_Font_CloseFont(TuxPaint_Font *tpf)
{
#ifdef DEBUG
printf("%s:%d - TuxPaint_Font_CloseFont step 1 (%p)\n", __FILE__, __LINE__, tpf);
@ -469,7 +469,7 @@ static void reliable_read(int fd, void *buf, size_t count)
#endif
static void groupfonts_range(style_info ** base, int count)
static void groupfonts_range(style_info **base, int count)
{
int boldcounts[4] = { 0, 0, 0, 0 };
int boldmap[4] = { -1, -1, -1, -1 };
@ -695,7 +695,7 @@ static int compar_fontscore(const void *v1, const void *v2)
//
// Cooper: Light, Medium, Light Bold, Black
// HoeflerText: (nil), Black
static void parse_font_style(style_info * si)
static void parse_font_style(style_info *si)
{
int have_light = 0;
int have_demi = 0;
@ -842,7 +842,7 @@ static void parse_font_style(style_info * si)
}
static void dupe_markdown_range(family_info ** base, int count)
static void dupe_markdown_range(family_info **base, int count)
{
int bestscore = -999;
int bestslot = 0;
@ -960,9 +960,9 @@ static void groupfonts(void)
}
static void loadfonts_locale_filter(SDL_Surface * screen,
SDL_Texture * texture,
SDL_Renderer * renderer, const char *const dir, const char *restrict const locale)
static void loadfonts_locale_filter(SDL_Surface *screen,
SDL_Texture *texture,
SDL_Renderer *renderer, const char *const dir, const char *restrict const locale)
{
char buf[TP_FTW_PATHSIZE];
unsigned dirlen = strlen(dir);
@ -973,14 +973,14 @@ static void loadfonts_locale_filter(SDL_Surface * screen,
tp_ftw(screen, texture, renderer, buf, dirlen, 1, loadfont_callback, locale);
}
static void loadfonts(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer * renderer, const char *const dir)
static void loadfonts(SDL_Surface *screen, SDL_Texture *texture, SDL_Renderer *renderer, const char *const dir)
{
loadfonts_locale_filter(screen, texture, renderer, dir, NULL);
}
/* static */ int load_user_fonts(SDL_Surface * screen, SDL_Texture * texture,
SDL_Renderer * renderer, void *vp, const char *restrict const locale)
/* static */ int load_user_fonts(SDL_Surface *screen, SDL_Texture *texture,
SDL_Renderer *renderer, void *vp, const char *restrict const locale)
{
char *homedirdir;
@ -1078,8 +1078,8 @@ static void loadfonts(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer
#ifdef FORKED_FONTS
void run_font_scanner(SDL_Surface * screen, SDL_Texture * texture,
SDL_Renderer * renderer, const char *restrict const locale)
void run_font_scanner(SDL_Surface *screen, SDL_Texture *texture,
SDL_Renderer *renderer, const char *restrict const locale)
{
int sv[2];
int size, i;
@ -1214,7 +1214,7 @@ void run_font_scanner(SDL_Surface * screen, SDL_Texture * texture,
}
void receive_some_font_info(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer * renderer)
void receive_some_font_info(SDL_Surface *screen, SDL_Texture *texture, SDL_Renderer *renderer)
{
char *buf = NULL;
unsigned buf_size = 0;
@ -1466,7 +1466,7 @@ TuxPaint_Font *getfonthandle(int desire)
static int was_bad_font;
// see if two font surfaces are the same
static int do_surfcmp(const SDL_Surface * const *const v1, const SDL_Surface * const *const v2)
static int do_surfcmp(const SDL_Surface *const *const v1, const SDL_Surface *const *const v2)
{
const SDL_Surface *const s1 = *v1;
const SDL_Surface *const s2 = *v2;
@ -1544,7 +1544,7 @@ static int surfcmp(const void *s1, const void *s2)
}
// check if the characters will render distinctly
int charset_works(TuxPaint_Font * font, const char *s)
int charset_works(TuxPaint_Font *font, const char *s)
{
SDL_Color black = { 0, 0, 0, 0 };
SDLPango_Matrix pango_color;
@ -1608,7 +1608,7 @@ out:
return ret;
}
int TuxPaint_Font_FontHeight(TuxPaint_Font * tpf)
int TuxPaint_Font_FontHeight(TuxPaint_Font *tpf)
{
if (tpf == NULL)
{
@ -1622,7 +1622,7 @@ int TuxPaint_Font_FontHeight(TuxPaint_Font * tpf)
return (tpf->height);
}
const char *TuxPaint_Font_FontFaceFamilyName(TuxPaint_Font * tpf)
const char *TuxPaint_Font_FontFaceFamilyName(TuxPaint_Font *tpf)
{
if (tpf == NULL)
{
@ -1651,7 +1651,7 @@ const char *TuxPaint_Font_FontFaceFamilyName(TuxPaint_Font * tpf)
return ("");
}
const char *TuxPaint_Font_FontFaceStyleName(TuxPaint_Font * tpf)
const char *TuxPaint_Font_FontFaceStyleName(TuxPaint_Font *tpf)
{
if (tpf == NULL)
{
@ -1681,7 +1681,7 @@ const char *TuxPaint_Font_FontFaceStyleName(TuxPaint_Font * tpf)
}
void sdl_color_to_pango_color(SDL_Color sdl_color, SDLPango_Matrix * pango_color)
void sdl_color_to_pango_color(SDL_Color sdl_color, SDLPango_Matrix *pango_color)
{
Uint8 pc[4][4];

View file

@ -61,7 +61,7 @@ static Node *new_trie(int degree, int *nkeys)
return root;
}
static void del_trie(Node * root, int degree)
static void del_trie(Node *root, int degree)
{
int i;
@ -77,7 +77,7 @@ static void put_loop(ge_GIF * gif, uint16_t loop);
#define OR_ABORT if (res == -1) { fprintf(stderr, "Cannot write to GIF\n"); return(NULL); }
#define OR_ABORT2 if (res == -1) { fprintf(stderr, "Cannot write to GIF\n"); return; }
ge_GIF *ge_new_gif(const char *fname, uint16_t width, uint16_t height, uint8_t * palette, int depth, int loop)
ge_GIF *ge_new_gif(const char *fname, uint16_t width, uint16_t height, uint8_t *palette, int depth, int loop)
{
int i, r, g, b, v;
ssize_t res;
@ -158,7 +158,7 @@ no_gif:
return NULL;
}
static void put_loop(ge_GIF * gif, uint16_t loop)
static void put_loop(ge_GIF *gif, uint16_t loop)
{
ssize_t res;
@ -181,7 +181,7 @@ static void put_loop(ge_GIF * gif, uint16_t loop)
/* Add packed key to buffer, updating offset and partial.
* gif->offset holds position to put next *bit*
* gif->partial holds bits to include in next byte */
static void put_key(ge_GIF * gif, uint16_t key, int key_size)
static void put_key(ge_GIF *gif, uint16_t key, int key_size)
{
int byte_offset, bit_offset, bits_to_write;
ssize_t res;
@ -207,7 +207,7 @@ static void put_key(ge_GIF * gif, uint16_t key, int key_size)
gif->offset = (gif->offset + key_size) % (0xFF * 8);
}
static void end_key(ge_GIF * gif)
static void end_key(ge_GIF *gif)
{
int byte_offset;
ssize_t res;
@ -227,7 +227,7 @@ static void end_key(ge_GIF * gif)
gif->offset = gif->partial = 0;
}
static void put_image(ge_GIF * gif, uint16_t w, uint16_t h, uint16_t x, uint16_t y)
static void put_image(ge_GIF *gif, uint16_t w, uint16_t h, uint16_t x, uint16_t y)
{
int nkeys, key_size, i, j;
Node *node, *child, *root;
@ -288,7 +288,7 @@ static void put_image(ge_GIF * gif, uint16_t w, uint16_t h, uint16_t x, uint16_t
del_trie(root, degree);
}
static int get_bbox(ge_GIF * gif, uint16_t * w, uint16_t * h, uint16_t * x, uint16_t * y)
static int get_bbox(ge_GIF *gif, uint16_t *w, uint16_t *h, uint16_t *x, uint16_t *y)
{
int i, j, k;
int left, right, top, bottom;
@ -337,7 +337,7 @@ static int get_bbox(ge_GIF * gif, uint16_t * w, uint16_t * h, uint16_t * x, uint
* a minimum of `delay` == 6. If `delay` == 0, no delay information will be stored
* for the frame. This can be used when creating still (single-frame) GIF images.
*/
static void set_delay(ge_GIF * gif, uint16_t d)
static void set_delay(ge_GIF *gif, uint16_t d)
{
ssize_t res;
@ -351,7 +351,7 @@ static void set_delay(ge_GIF * gif, uint16_t d)
OR_ABORT2;
}
void ge_add_frame(ge_GIF * gif, uint16_t delay)
void ge_add_frame(ge_GIF *gif, uint16_t delay)
{
uint16_t w, h, x, y;
uint8_t *tmp;
@ -377,7 +377,7 @@ void ge_add_frame(ge_GIF * gif, uint16_t delay)
gif->frame = tmp;
}
void ge_close_gif(ge_GIF * gif)
void ge_close_gif(ge_GIF *gif)
{
ssize_t res;

View file

@ -615,7 +615,7 @@ static void show_lang_usage(int exitcode)
* @param f File descriptor to write to (e.g., STDOUT or STDERR)
* @param prg Program name (e.g., "tuxpaint" or "tuxpaint.exe")
*/
static void show_locale_usage(FILE * f, const char *const prg)
static void show_locale_usage(FILE *f, const char *const prg)
{
/* FIXME: Add accented characters to the descriptions */
fprintf(f,

View file

@ -286,7 +286,7 @@ static int swk_compare(const void *swk1, const void *swk2)
/**
* Initialize the State Machine.
*/
static int sm_init(STATE_MACHINE * sm)
static int sm_init(STATE_MACHINE *sm)
{
memset(sm, 0, sizeof(STATE_MACHINE));
@ -305,7 +305,7 @@ static int sm_init(STATE_MACHINE * sm)
/**
* Free the State Machine resources.
*/
static void sm_free(STATE_MACHINE * sm)
static void sm_free(STATE_MACHINE *sm)
{
if (sm->next)
{
@ -331,7 +331,7 @@ static void sm_free(STATE_MACHINE * sm)
/**
* Double the storage space of the possible transition states.
*/
static int sm_dblspace(STATE_MACHINE * sm)
static int sm_dblspace(STATE_MACHINE *sm)
{
size_t newsize = sm->next_maxsize * 2;
SM_WITH_KEY *next = realloc(sm->next, sizeof(SM_WITH_KEY) * newsize);
@ -353,7 +353,7 @@ static int sm_dblspace(STATE_MACHINE * sm)
* Return NULL if none is found. The search is done only at 1 level, and does
* not recurse deep.
*/
static STATE_MACHINE *sm_search_shallow(STATE_MACHINE * sm, char key)
static STATE_MACHINE *sm_search_shallow(STATE_MACHINE *sm, char key)
{
SM_WITH_KEY smk = { key, NULL };
SM_WITH_KEY *smk_found;
@ -379,8 +379,8 @@ static STATE_MACHINE *sm_search_shallow(STATE_MACHINE * sm, char key)
*
* @return Found unicode character sequence output of the last state.
*/
static const wchar_t *sm_search(STATE_MACHINE * start, wchar_t *key,
int *matched, STATE_MACHINE ** penult, STATE_MACHINE ** end)
static const wchar_t *sm_search(STATE_MACHINE *start, wchar_t *key,
int *matched, STATE_MACHINE **penult, STATE_MACHINE **end)
{
STATE_MACHINE *sm = sm_search_shallow(start, (char)*key);
const wchar_t *unicode;
@ -407,7 +407,7 @@ static const wchar_t *sm_search(STATE_MACHINE * start, wchar_t *key,
* Sort the state machine's transition keys so it can be binary-searched.
* The sort is done only at 1 level, and does not recurse deep.
*/
static void sm_sort_shallow(STATE_MACHINE * sm)
static void sm_sort_shallow(STATE_MACHINE *sm)
{
qsort(sm->next, sm->next_size, sizeof(SM_WITH_KEY), swk_compare);
}
@ -416,7 +416,7 @@ static void sm_sort_shallow(STATE_MACHINE * sm)
/**
* Add a single sequence-to-unicode path to the state machine.
*/
static int sm_add(STATE_MACHINE * sm, char *seq, const wchar_t *unicode, char flag)
static int sm_add(STATE_MACHINE *sm, char *seq, const wchar_t *unicode, char flag)
{
STATE_MACHINE *sm_found = sm_search_shallow(sm, seq[0]);
@ -486,7 +486,7 @@ static int sm_add(STATE_MACHINE * sm, char *seq, const wchar_t *unicode, char fl
/**
* Initialize the character map table.
*/
static int charmap_init(CHARMAP * cm)
static int charmap_init(CHARMAP *cm)
{
int error_code = 0;
int i = 0;
@ -513,7 +513,7 @@ static int charmap_init(CHARMAP * cm)
*
* @return 0 if no error, 1 if error.
*/
static int charmap_add(CHARMAP * cm, int section, char *seq, const wchar_t *unicode, char *flag)
static int charmap_add(CHARMAP *cm, int section, char *seq, const wchar_t *unicode, char *flag)
{
if (section >= MAX_SECTIONS)
{
@ -538,7 +538,7 @@ static int charmap_add(CHARMAP * cm, int section, char *seq, const wchar_t *unic
* @param path The path of the file to load.
* @return Zero if the file is loaded fine, nonzero otherwise.
*/
static int charmap_load(CHARMAP * cm, const char *path)
static int charmap_load(CHARMAP *cm, const char *path)
{
FILE *is = NULL;
int section = 0;
@ -651,7 +651,7 @@ static int charmap_load(CHARMAP * cm, const char *path)
/**
* Free the resources used by a character map.
*/
static void charmap_free(CHARMAP * cm)
static void charmap_free(CHARMAP *cm)
{
int i;
@ -667,7 +667,7 @@ static void charmap_free(CHARMAP * cm)
/**
* Search for a matching character string in the character map.
*/
static const wchar_t *charmap_search(CHARMAP * cm, wchar_t *s)
static const wchar_t *charmap_search(CHARMAP *cm, wchar_t *s)
{
STATE_MACHINE *start;
const wchar_t *unicode;
@ -725,7 +725,7 @@ static const wchar_t *charmap_search(CHARMAP * cm, wchar_t *s)
*
* @see im_read
*/
static int im_event_c(IM_DATA * im, SDL_Event event)
static int im_event_c(IM_DATA *im, SDL_Event event)
{
SDL_Keysym ks = event.key.keysym;
@ -783,7 +783,7 @@ static int im_event_c(IM_DATA * im, SDL_Event event)
* @see im_event_c()
* @see im_event_fns
*/
int im_read(IM_DATA * im, SDL_Event event)
int im_read(IM_DATA *im, SDL_Event event)
{
IM_EVENT_FN im_event_fp = NULL;
int redraw = 0;
@ -838,7 +838,7 @@ int im_read(IM_DATA * im, SDL_Event event)
* Generic event handler that calls the appropriate language handler.
* im->request should have the event ID.
*/
static void im_event(IM_DATA * im)
static void im_event(IM_DATA *im)
{
SDL_Event event;
@ -852,7 +852,7 @@ static void im_event(IM_DATA * im)
/**
* Make an event request and call the event handler.
*/
static void im_request(IM_DATA * im, int request)
static void im_request(IM_DATA *im, int request)
{
im->request = request;
im_event(im);
@ -866,13 +866,13 @@ static void im_request(IM_DATA * im, int request)
/**
* Free any allocated resources.
*/
static void im_free(IM_DATA * im)
static void im_free(IM_DATA *im)
{
im_request(im, IM_REQ_FREE);
}
void im_softreset(IM_DATA * im)
void im_softreset(IM_DATA *im)
{
im->s[0] = L'\0';
im->buf[0] = L'\0';
@ -881,7 +881,7 @@ void im_softreset(IM_DATA * im)
}
static void im_fullreset(IM_DATA * im)
static void im_fullreset(IM_DATA *im)
{
im->s[0] = L'\0';
im->buf[0] = L'\0';
@ -936,7 +936,7 @@ static void im_fullreset(IM_DATA * im)
*
* @see im_read
*/
static int im_event_zh_tw(IM_DATA * im, SDL_Event event)
static int im_event_zh_tw(IM_DATA *im, SDL_Event event)
{
SDL_Keysym ks = event.key.keysym;
static const char *lang_file = IMDIR "zh_tw.im";
@ -1159,7 +1159,7 @@ static int im_event_zh_tw(IM_DATA * im, SDL_Event event)
*
* @see im_read
*/
static int im_event_th(IM_DATA * im, SDL_Event event)
static int im_event_th(IM_DATA *im, SDL_Event event)
{
SDL_Keysym ks = event.key.keysym;
static const char *lang_file = IMDIR "th.im";
@ -1379,7 +1379,7 @@ static int im_event_th(IM_DATA * im, SDL_Event event)
*
* @see im_read
*/
static int im_event_ja(IM_DATA * im, SDL_Event event)
static int im_event_ja(IM_DATA *im, SDL_Event event)
{
SDL_Keysym ks = event.key.keysym;
static const char *lang_file = IMDIR "ja.im";
@ -1605,7 +1605,7 @@ static int im_event_ja(IM_DATA * im, SDL_Event event)
*
* @see im_event_ko
*/
static int im_event_ko_isvowel(CHARMAP * cm, wchar_t c)
static int im_event_ko_isvowel(CHARMAP *cm, wchar_t c)
{
STATE_MACHINE *start, *next;
const wchar_t *unicode;
@ -1629,7 +1629,7 @@ static int im_event_ko_isvowel(CHARMAP * cm, wchar_t c)
*
* @see im_read
*/
static int im_event_ko(IM_DATA * im, SDL_Event event)
static int im_event_ko(IM_DATA *im, SDL_Event event)
{
SDL_Keysym ks = event.key.keysym;
static const char *lang_file = IMDIR "ko.im";
@ -1909,7 +1909,7 @@ static int im_event_ko(IM_DATA * im, SDL_Event event)
* @param im IM_DATA structure to initialize.
* @param lang LANG_* defined constant to initialize the structure with.
*/
void im_init(IM_DATA * im, int lang)
void im_init(IM_DATA *im, int lang)
{
/* Free already allocated resources if initialized before */
if (im_initialized)

View file

@ -73,7 +73,7 @@ static void print_composemap(osk_composenode * composemap, char *sp);
#define wcstombs(tok, wtok, size) WideCharToMultiByte(CP_UTF8,0,wtok,-1,tok,size,NULL,NULL)
#endif
static SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface * surface)
static SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *surface)
{
SDL_Surface *tmp;
@ -81,16 +81,16 @@ static SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface * surface)
return (tmp);
}
struct osk_keyboard *osk_create(char *layout_name, SDL_Surface * canvas,
SDL_Surface * BLANK_button_up,
SDL_Surface * BLANK_button_down,
SDL_Surface * BLANK_button_off,
SDL_Surface * BLANK_button_nav,
SDL_Surface * BLANK_button_hold,
SDL_Surface * BLANK_oskdel,
SDL_Surface * BLANK_osktab,
SDL_Surface * BLANK_oskenter,
SDL_Surface * BLANK_oskcapslock, SDL_Surface * BLANK_oskshift, int disable_change)
struct osk_keyboard *osk_create(char *layout_name, SDL_Surface *canvas,
SDL_Surface *BLANK_button_up,
SDL_Surface *BLANK_button_down,
SDL_Surface *BLANK_button_off,
SDL_Surface *BLANK_button_nav,
SDL_Surface *BLANK_button_hold,
SDL_Surface *BLANK_oskdel,
SDL_Surface *BLANK_osktab,
SDL_Surface *BLANK_oskenter,
SDL_Surface *BLANK_oskcapslock, SDL_Surface *BLANK_oskshift, int disable_change)
{
SDL_Surface *surface;
SDL_Surface *button_up, *button_down;
@ -252,7 +252,7 @@ struct osk_keyboard *osk_create(char *layout_name, SDL_Surface * canvas,
return keyboard;
}
static struct osk_layout *load_layout(on_screen_keyboard * keyboard, char *layout_name)
static struct osk_layout *load_layout(on_screen_keyboard *keyboard, char *layout_name)
{
FILE *fi;
int hlayout_loaded;
@ -381,7 +381,7 @@ static struct osk_layout *load_layout(on_screen_keyboard * keyboard, char *layou
/* A hlayout contains the definitions of the keyboard as seen in the screen.
Things like the number of rows of the keyboard, the font used to render the keys,
the width of the keys, and a code that matches each key like in real hardware keyboards */
void load_hlayout(osk_layout * layout, char *hlayout_name)
void load_hlayout(osk_layout *layout, char *hlayout_name)
{
int width, height;
int key_number, line_number;
@ -578,7 +578,7 @@ void load_hlayout(osk_layout * layout, char *hlayout_name)
/* A keymap contains the keysyms (X keysym mnemonics) associated to each keycode in the hlayout.*/
void load_keymap(osk_layout * layout, char *keymap_name)
void load_keymap(osk_layout *layout, char *keymap_name)
{
int i, keycode, readed;
char *filename;
@ -678,7 +678,7 @@ void load_keymap(osk_layout * layout, char *keymap_name)
}
/* Scans a line of keysyms and result and classifies them. */
static void gettokens(char *line, char *delim, char **pointer, osk_composenode * composenode, osk_layout * layout)
static void gettokens(char *line, char *delim, char **pointer, osk_composenode *composenode, osk_layout *layout)
{
int i;
char *tok;
@ -766,7 +766,7 @@ static void gettokens(char *line, char *delim, char **pointer, osk_composenode *
/* A compose map contains the sequences of keysyms (X keysym mnemonics) needed to generate another keysym.
The last in the sequence is the result, the others will be searched in the order they appear.
They will be classified in a multiway tree.*/
static void load_composemap(osk_layout * layout, char *composemap_name)
static void load_composemap(osk_layout *layout, char *composemap_name)
{
char *filename;
char **pointer;
@ -822,7 +822,7 @@ static void load_composemap(osk_layout * layout, char *composemap_name)
}
#ifdef DEBUG_OSK_COMPOSEMAP
static void print_composemap(osk_composenode * composemap, char *sp)
static void print_composemap(osk_composenode *composemap, char *sp)
{
int i;
char *space;
@ -875,7 +875,7 @@ static void print_composemap(osk_composenode * composemap, char *sp)
/* This parses the contents of keysymdef.h from the source of xorg.
Therefore, if somebody wants to provide custom keysymdefs, he has to follow its syntax. */
static void load_keysymdefs(osk_layout * layout, char *keysymdefs_name)
static void load_keysymdefs(osk_layout *layout, char *keysymdefs_name)
{
int i;
char *filename;
@ -943,7 +943,7 @@ static void load_keysymdefs(osk_layout * layout, char *keysymdefs_name)
/* } */
/* Returns the x keysym corresponding to a mnemonic string */
static int mnemo2keysym(char *mnemo, on_screen_keyboard * keyboard)
static int mnemo2keysym(char *mnemo, on_screen_keyboard *keyboard)
{
unsigned int i;
@ -966,7 +966,7 @@ static int mnemo2keysym(char *mnemo, on_screen_keyboard * keyboard)
}
/* Returns the unicode value of a x keysym if any, otherwise returns 0 */
static int keysym2unicode(int keysym, on_screen_keyboard * keyboard)
static int keysym2unicode(int keysym, on_screen_keyboard *keyboard)
{
unsigned int i;
@ -997,7 +997,7 @@ static int keysym2unicode(int keysym, on_screen_keyboard * keyboard)
/* Searches in the tree for composing stuff */
static void get_composed_keysym(on_screen_keyboard * keyboard, osk_composenode * composenode, wchar_t *keysym)
static void get_composed_keysym(on_screen_keyboard *keyboard, osk_composenode *composenode, wchar_t *keysym)
{
int i;
@ -1102,7 +1102,7 @@ static int is_blank_or_comment(char *line)
/* FIXME: Is it safe to supose that if a font is loaded at one size, it will be loaded at any size? */
/* FIXME: starting a layout with one font causes all other layouts be in that font */
static void keybd_prepare(on_screen_keyboard * keyboard)
static void keybd_prepare(on_screen_keyboard *keyboard)
{
char *fontname;
int font_height;
@ -1178,7 +1178,7 @@ static void keybd_prepare(on_screen_keyboard * keyboard)
}
static void apply_surface(int x, int y, SDL_Surface * source, SDL_Surface * destination, SDL_Rect * clip)
static void apply_surface(int x, int y, SDL_Surface *source, SDL_Surface *destination, SDL_Rect *clip)
{
SDL_Rect offset;
@ -1214,7 +1214,7 @@ static void apply_surface(int x, int y, SDL_Surface * source, SDL_Surface * dest
/* } */
/* Stretches a button from the middle, keeping the extrems intact */
static SDL_Surface *stretch_surface(SDL_Surface * orig, int width)
static SDL_Surface *stretch_surface(SDL_Surface *orig, int width)
{
int i;
SDL_Surface *dest;
@ -1271,7 +1271,7 @@ static SDL_Surface *stretch_surface(SDL_Surface * orig, int width)
}
/* Draws the keyboard surface */
static void draw_keyboard(on_screen_keyboard * keyboard)
static void draw_keyboard(on_screen_keyboard *keyboard)
{
int i, j;
int key_height, accumulated_width, accumulated_height;
@ -1307,7 +1307,7 @@ static void draw_keyboard(on_screen_keyboard * keyboard)
/* draw_key(keyboard->keymodifiers.dead, keyboard, 0); */
}
static void draw_key(osk_key key, on_screen_keyboard * keyboard, int hot)
static void draw_key(osk_key key, on_screen_keyboard *keyboard, int hot)
{
char *text;
SDL_Surface *skey;
@ -1352,7 +1352,7 @@ static void draw_key(osk_key key, on_screen_keyboard * keyboard, int hot)
/* FIXME: TODO draw top and bottom_right (altgr) labels */
static void label_key(osk_key key, on_screen_keyboard * keyboard)
static void label_key(osk_key key, on_screen_keyboard *keyboard)
{
SDL_Surface *messager;
int modstate;
@ -1455,7 +1455,7 @@ static void label_key(osk_key key, on_screen_keyboard * keyboard)
}
/* Searches the key corresponding to coordinates */
static osk_key *find_key(on_screen_keyboard * keyboard, int x, int y)
static osk_key *find_key(on_screen_keyboard *keyboard, int x, int y)
{
int i, j;
osk_key *key;
@ -1478,7 +1478,7 @@ static osk_key *find_key(on_screen_keyboard * keyboard, int x, int y)
/* Copies orig to dest or sets dest to defaults if orig is NULL.
if firstime is setted, don't frees the strings as there aren't. */
static void set_key(osk_key * orig, osk_key * dest, int firsttime)
static void set_key(osk_key *orig, osk_key *dest, int firsttime)
{
if (orig == NULL)
{
@ -1522,7 +1522,7 @@ static void set_key(osk_key * orig, osk_key * dest, int firsttime)
}
}
static char *find_keysym(osk_key key, on_screen_keyboard * keyboard)
static char *find_keysym(osk_key key, on_screen_keyboard *keyboard)
{
int keycode;
char *keysym;
@ -1594,7 +1594,7 @@ static char *find_keysym(osk_key key, on_screen_keyboard * keyboard)
}
/* We lose the SDL ModState by leaving and entering the tuxpaint window, so using a custom state */
static int handle_keymods(char *keysym, osk_key * key, on_screen_keyboard * keyboard)
static int handle_keymods(char *keysym, osk_key *key, on_screen_keyboard *keyboard)
{
SDL_Keymod mod;
SDL_Event ev;
@ -1683,7 +1683,7 @@ static int handle_keymods(char *keysym, osk_key * key, on_screen_keyboard * keyb
/* set_dead_sticks and clear_dead_sticks deals with the persistence of
the keys that are still affecting other key presses. */
static void set_dead_sticks(osk_key * key, on_screen_keyboard * keyboard)
static void set_dead_sticks(osk_key *key, on_screen_keyboard *keyboard)
{
key->stick = 1;
if (!keyboard->kmdf.dead)
@ -1696,7 +1696,7 @@ static void set_dead_sticks(osk_key * key, on_screen_keyboard * keyboard)
keyboard->kmdf.dead4 = key;
}
static void clear_dead_sticks(on_screen_keyboard * keyboard)
static void clear_dead_sticks(on_screen_keyboard *keyboard)
{
if (keyboard->kmdf.dead)
{
@ -1720,7 +1720,7 @@ static void clear_dead_sticks(on_screen_keyboard * keyboard)
}
}
struct osk_keyboard *osk_clicked(on_screen_keyboard * keyboard, int x, int y)
struct osk_keyboard *osk_clicked(on_screen_keyboard *keyboard, int x, int y)
{
int i;
osk_key *key;
@ -1956,7 +1956,7 @@ struct osk_keyboard *osk_clicked(on_screen_keyboard * keyboard, int x, int y)
return (keyboard);
}
void osk_released(on_screen_keyboard * keyboard)
void osk_released(on_screen_keyboard *keyboard)
{
osk_key *key;
@ -1971,7 +1971,7 @@ void osk_released(on_screen_keyboard * keyboard)
}
static void free_keymap(osk_keymap * keymap)
static void free_keymap(osk_keymap *keymap)
{
int i;
@ -1989,7 +1989,7 @@ static void free_keymap(osk_keymap * keymap)
free(keymap);
}
static void free_composemap(osk_composenode * composenode)
static void free_composemap(osk_composenode *composenode)
{
int i;
@ -2007,7 +2007,7 @@ static void free_composemap(osk_composenode * composenode)
free(composenode->keysym);
}
static void free_keysymdefs(keysymdefs * ksd, int size)
static void free_keysymdefs(keysymdefs *ksd, int size)
{
int i;
@ -2015,7 +2015,7 @@ static void free_keysymdefs(keysymdefs * ksd, int size)
free(ksd[i].mnemo);
}
static void free_keys(osk_layout * layout)
static void free_keys(osk_layout *layout)
{
int i, j;
@ -2038,7 +2038,7 @@ static void free_keys(osk_layout * layout)
free(layout->keys);
}
static void free_layout(osk_layout * layout)
static void free_layout(osk_layout *layout)
{
if (layout->name != NULL)
free(layout->name);
@ -2054,7 +2054,7 @@ static void free_layout(osk_layout * layout)
free(layout);
}
void osk_free(on_screen_keyboard * keyboard)
void osk_free(on_screen_keyboard *keyboard)
{
free(keyboard->name);
free_layout(keyboard->layout);

View file

@ -32,7 +32,7 @@
#include "debug.h"
/* Draw a single pixel into the surface: */
static void putpixel8(SDL_Surface * surface, int x, int y, Uint32 pixel)
static void putpixel8(SDL_Surface *surface, int x, int y, Uint32 pixel)
{
Uint8 *p;
@ -53,7 +53,7 @@ static void putpixel8(SDL_Surface * surface, int x, int y, Uint32 pixel)
}
/* Draw a single pixel into the surface: */
static void putpixel16(SDL_Surface * surface, int x, int y, Uint32 pixel)
static void putpixel16(SDL_Surface *surface, int x, int y, Uint32 pixel)
{
Uint8 *p;
@ -74,7 +74,7 @@ static void putpixel16(SDL_Surface * surface, int x, int y, Uint32 pixel)
}
/* Draw a single pixel into the surface: */
static void putpixel24(SDL_Surface * surface, int x, int y, Uint32 pixel)
static void putpixel24(SDL_Surface *surface, int x, int y, Uint32 pixel)
{
Uint8 *p;
@ -107,7 +107,7 @@ static void putpixel24(SDL_Surface * surface, int x, int y, Uint32 pixel)
}
/* Draw a single pixel into the surface: */
static void putpixel32(SDL_Surface * surface, int x, int y, Uint32 pixel)
static void putpixel32(SDL_Surface *surface, int x, int y, Uint32 pixel)
{
Uint8 *p;
@ -128,7 +128,7 @@ static void putpixel32(SDL_Surface * surface, int x, int y, Uint32 pixel)
}
/* Get a pixel: */
static Uint32 getpixel8(SDL_Surface * surface, int x, int y)
static Uint32 getpixel8(SDL_Surface *surface, int x, int y)
{
Uint8 *p;
@ -154,7 +154,7 @@ static Uint32 getpixel8(SDL_Surface * surface, int x, int y)
}
/* Get a pixel: */
static Uint32 getpixel16(SDL_Surface * surface, int x, int y)
static Uint32 getpixel16(SDL_Surface *surface, int x, int y)
{
Uint8 *p;
@ -180,7 +180,7 @@ static Uint32 getpixel16(SDL_Surface * surface, int x, int y)
}
/* Get a pixel: */
static Uint32 getpixel24(SDL_Surface * surface, int x, int y)
static Uint32 getpixel24(SDL_Surface *surface, int x, int y)
{
Uint8 *p;
Uint32 pixel;
@ -214,7 +214,7 @@ static Uint32 getpixel24(SDL_Surface * surface, int x, int y)
}
/* Get a pixel: */
static Uint32 getpixel32(SDL_Surface * surface, int x, int y)
static Uint32 getpixel32(SDL_Surface *surface, int x, int y)
{
Uint8 *p;

View file

@ -49,7 +49,7 @@ static int old_sound[4] = { -1, -1, -1, -1 };
* (low values, near the top of the window, are quieter), or
* SNDDIST_NEAR for full volume
*/
void playsound(SDL_Surface * screen, int chan, int s, int override, int x, int y)
void playsound(SDL_Surface *screen, int chan, int s, int override, int x, int y)
{
#ifndef NOSOUND
int left, dist;

View file

@ -77,8 +77,7 @@ static int f2dec(float f)
}
/* Actually save the PostScript data to the file stream: */
int do_ps_save(FILE * fi,
const char *restrict const fname, SDL_Surface * surf, const char *restrict pprsize, int is_pipe)
int do_ps_save(FILE *fi, const char *restrict const fname, SDL_Surface *surf, const char *restrict pprsize, int is_pipe)
{
const struct paper *ppr;
int img_w = surf->w;

View file

@ -39,7 +39,7 @@ int progress_bar_disabled, prog_bar_ctr;
*
* @param screen Screen surface
*/
void show_progress_bar_(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer * renderer)
void show_progress_bar_(SDL_Surface *screen, SDL_Texture *texture, SDL_Renderer *renderer)
{
SDL_Rect dest, src, r;
int x;

View file

@ -977,7 +977,7 @@ static void setup_normal_screen_layout(void)
* @param r The rectange
* @param name The name of the rect object
*/
static void debug_rect(SDL_Rect * r, char *name)
static void debug_rect(SDL_Rect *r, char *name)
{
/* FIXME: Send to stderr, not stdout? */
printf("%-12s %dx%d @ %d,%d\n", name, r->w, r->h, r->x, r->y);
@ -992,7 +992,7 @@ static void debug_rect(SDL_Rect * r, char *name)
* @param g The grid
* @param name The name of the grid object
*/
static void debug_dims(grid_dims * g, char *name)
static void debug_dims(grid_dims *g, char *name)
{
/* FIXME: Send to stderr, not stdout? */
printf("%-12s %dx%d\n", name, g->cols, g->rows);
@ -1062,7 +1062,7 @@ static void SDL_WarpMouse(Uint16 x, Uint16 y)
SDL_WarpMouseInWindow(window_screen, x, y);
}
static SDL_Surface *SDL_DisplayFormat(SDL_Surface * surface)
static SDL_Surface *SDL_DisplayFormat(SDL_Surface *surface)
{
SDL_Surface *tmp;
@ -1070,7 +1070,7 @@ static SDL_Surface *SDL_DisplayFormat(SDL_Surface * surface)
return (tmp);
}
static SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface * surface)
static SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *surface)
{
SDL_Surface *tmp;
@ -1078,7 +1078,7 @@ static SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface * surface)
return (tmp);
}
static void SDL_Flip(SDL_Surface * screen)
static void SDL_Flip(SDL_Surface *screen)
{
//SDL_UpdateWindowSurface(window_screen);
SDL_UpdateTexture(texture, NULL, screen->pixels, screen->pitch);
@ -1087,7 +1087,7 @@ static void SDL_Flip(SDL_Surface * screen)
SDL_RenderPresent(renderer);
}
static void SDL_UpdateRect(SDL_Surface * screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h)
static void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h)
{
SDL_Rect r;
@ -1105,7 +1105,7 @@ static void SDL_UpdateRect(SDL_Surface * screen, Sint32 x, Sint32 y, Sint32 w, S
SDL_RenderPresent(renderer);
}
static void show_progress_bar(SDL_Surface * screen)
static void show_progress_bar(SDL_Surface *screen)
{
show_progress_bar_(screen, texture, renderer);
}
@ -1174,7 +1174,7 @@ static void update_screen(int x1, int y1, int x2, int y2)
*
* @param r The rect
*/
static void update_screen_rect(SDL_Rect * r)
static void update_screen_rect(SDL_Rect *r)
{
SDL_UpdateRect(screen, r->x, r->y, r->w, r->h);
}
@ -1188,7 +1188,7 @@ static void update_screen_rect(SDL_Rect * r)
* @param y Y coordinate
* @return true if a hit, else false
*/
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 */
return (x - (unsigned)r->x < (unsigned)r->w) && (y - (unsigned)r->y < (unsigned)r->h);
@ -1206,7 +1206,7 @@ static int hit_test(const SDL_Rect * const r, unsigned x, unsigned y)
* @param gd The grid of items
* @returns The item clicked, or -1 if click was outside the grid.
*/
static int grid_hit_gd(const SDL_Rect * const r, unsigned x, unsigned y, grid_dims * gd)
static int grid_hit_gd(const SDL_Rect *const r, unsigned x, unsigned y, grid_dims *gd)
{
unsigned item_w = r->w / gd->cols;
unsigned item_h = r->h / gd->rows;
@ -1717,7 +1717,7 @@ static SDL_Surface *zoom(SDL_Surface * src, int new_x, int new_y);
* @param color The color to draw it in
* @return A new surface, containing the rendered text
*/
static SDL_Surface *render_text(TuxPaint_Font * restrict font, const char *restrict str, SDL_Color color)
static SDL_Surface *render_text(TuxPaint_Font *restrict font, const char *restrict str, SDL_Color color)
{
SDL_Surface *ret = NULL;
int height;
@ -1806,7 +1806,7 @@ static Uint16 *wcstou16(const wchar_t *str)
* @param color The color to draw it in
* @return A new surface, containing the rendered text
*/
static SDL_Surface *render_text_w(TuxPaint_Font * restrict font, const wchar_t *restrict str, SDL_Color color)
static SDL_Surface *render_text_w(TuxPaint_Font *restrict font, const wchar_t *restrict str, SDL_Color color)
{
SDL_Surface *ret = NULL;
int height;
@ -1975,8 +1975,7 @@ enum
static SDL_Surface *img_cur_brush;
static int img_cur_brush_frame_w, img_cur_brush_w, img_cur_brush_h,
img_cur_brush_frames, img_cur_brush_directional, img_cur_brush_rotate,
img_cur_brush_chaotic, img_cur_brush_spacing;
img_cur_brush_frames, img_cur_brush_directional, img_cur_brush_rotate, img_cur_brush_chaotic, img_cur_brush_spacing;
static int brush_counter, brush_frame;
enum
@ -5524,7 +5523,8 @@ static void mainloop(void)
else
{
draw_color = SDL_MapRGB(canvas->format,
color_hexes[cur_color][0], color_hexes[cur_color][1], color_hexes[cur_color][2]);
color_hexes[cur_color][0], color_hexes[cur_color][1],
color_hexes[cur_color][2]);
}
would_fill = would_flood_fill(canvas, draw_color, canv_color);
@ -5558,8 +5558,7 @@ static void mainloop(void)
}
}
if (cur_fill == FILL_FLOOD ||
(cur_fill == FILL_ERASER && img_starter_bkgd == NULL))
if (cur_fill == FILL_FLOOD || (cur_fill == FILL_ERASER && img_starter_bkgd == NULL))
{
/* Flood fill a solid color */
@ -5621,6 +5620,7 @@ static void mainloop(void)
else if (cur_fill == FILL_ERASER)
{
void (*putpixel)(SDL_Surface *, int, int, Uint32) = putpixels[canvas->format->BytesPerPixel];
Uint32(*getpixel) (SDL_Surface *, int, int) = getpixels[img_starter_bkgd->format->BytesPerPixel];
int x, y;
@ -5632,7 +5632,7 @@ static void mainloop(void)
for (y = sim_flood_y1; y <= sim_flood_y2; y++)
{
for (x = sim_flood_x1; x <= sim_flood_x2; x++)
for (x = sim_flood_x1; x <= sim_flood_x2; x++)
{
if (sim_flood_touched[y * canvas->w + x])
{
@ -6040,14 +6040,14 @@ static void mainloop(void)
debug("Playing description sound...");
#ifndef NOSOUND
Mix_ChannelFinished(NULL); /* Kill the callback, so we don't get stuck in a loop! */
Mix_ChannelFinished(NULL); /* Kill the callback, so we don't get stuck in a loop! */
if (event.user.data1 != NULL)
{
if ((int)(intptr_t) event.user.data1 == cur_stamp[stamp_group]) /* Don't play old stamp's sound... *///EP added (intptr_t) to avoid warning on x64
if ((int)(intptr_t) event.user.data1 == cur_stamp[stamp_group]) /* Don't play old stamp's sound... *///EP added (intptr_t) to avoid warning on x64
{
if (!mute && stamp_data[stamp_group][(int)(intptr_t) event.user.data1]->sdesc != NULL) //EP added (intptr_t) to avoid warning on x64
Mix_PlayChannel(2, stamp_data[stamp_group][(int)(intptr_t) event.user.data1]->sdesc, //EP added (intptr_t) to avoid warning on x64
if (!mute && stamp_data[stamp_group][(int)(intptr_t) event.user.data1]->sdesc != NULL) //EP added (intptr_t) to avoid warning on x64
Mix_PlayChannel(2, stamp_data[stamp_group][(int)(intptr_t) event.user.data1]->sdesc, //EP added (intptr_t) to avoid warning on x64
0);
}
}
@ -7202,7 +7202,7 @@ static void brush_draw(int x1, int y1, int x2, int y2, int update)
if (brushes_chaotic[cur_brush])
{
r = (float) (rand() % 36) * 10.0;
r = (float)(rand() % 36) * 10.0;
}
dx = x2 - x1;
@ -7390,14 +7390,15 @@ static void blit_brush(int x, int y, int direction, double rotation, int *w, int
{
SDL_Surface *brush_frame_surf;
brush_frame_surf =
SDL_CreateRGBSurface(0, src.w, src.h, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
brush_frame_surf = SDL_CreateRGBSurface(0, src.w, src.h, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
if (brush_frame_surf != NULL)
{
/* Ensure any semi-transparent areas or edges match the same color as we're painting
(and not cause a black halo; see https://sourceforge.net/p/tuxpaint/bugs/259/ -bjk 2024.10.11) */
SDL_FillRect(brush_frame_surf, NULL, SDL_MapRGBA(brush_frame_surf->format, color_hexes[cur_color][0], color_hexes[cur_color][1], color_hexes[cur_color][2], 0));
SDL_FillRect(brush_frame_surf, NULL,
SDL_MapRGBA(brush_frame_surf->format, color_hexes[cur_color][0], color_hexes[cur_color][1],
color_hexes[cur_color][2], 0));
/* 2021/09/28 SDL(2)_gfxBlitRGBA() is not available in the SDL2_gfx library, using plain SDL_BlitSurface() instead. Pere
SDL_gfxBlitRGBA(img_cur_brush, &src, brush_frame_surf, NULL); */
@ -7466,7 +7467,7 @@ typedef struct multichan
/**
* FIXME
*/
static void fill_multichan(multichan * mc, double *up, double *vp)
static void fill_multichan(multichan *mc, double *up, double *vp)
{
double X, Y, Z, u, v;
double u_prime, v_prime; /* temp, part of official formula */
@ -7502,7 +7503,7 @@ static void fill_multichan(multichan * mc, double *up, double *vp)
/**
* FIXME
*/
static double tint_part_1(multichan * work, SDL_Surface * in)
static double tint_part_1(multichan *work, SDL_Surface *in)
{
int xx, yy;
double u_total = 0;
@ -7546,7 +7547,7 @@ static double tint_part_1(multichan * work, SDL_Surface * in)
/**
* FIXME
*/
static void change_colors(SDL_Surface * out, multichan * work, double hue_range, multichan * key_color_ptr)
static void change_colors(SDL_Surface *out, multichan *work, double hue_range, multichan *key_color_ptr)
{
double lower_hue_1, upper_hue_1, lower_hue_2, upper_hue_2;
int xx, yy;
@ -7654,7 +7655,7 @@ static void change_colors(SDL_Surface * out, multichan * work, double hue_range,
/**
* FIXME
*/
static multichan *find_most_saturated(double initial_hue, multichan * work, unsigned num, double *hue_range_ptr)
static multichan *find_most_saturated(double initial_hue, multichan *work, unsigned num, double *hue_range_ptr)
{
/* find the most saturated pixel near the initial hue guess */
multichan *key_color_ptr = NULL;
@ -7731,7 +7732,7 @@ hue_range_retry:;
/**
* FIXME
*/
static void vector_tint_surface(SDL_Surface * out, SDL_Surface * in)
static void vector_tint_surface(SDL_Surface *out, SDL_Surface *in)
{
int xx, yy;
@ -7768,7 +7769,7 @@ static void vector_tint_surface(SDL_Surface * out, SDL_Surface * in)
* @param tmp_surf Destination surface
* @param surf_ptr Source surface
*/
static void tint_surface(SDL_Surface * tmp_surf, SDL_Surface * surf_ptr)
static void tint_surface(SDL_Surface *tmp_surf, SDL_Surface *surf_ptr)
{
unsigned width = surf_ptr->w;
unsigned height = surf_ptr->h;
@ -8367,11 +8368,10 @@ static unsigned compute_default_scale_factor(double ratio)
* @param i Counter
* @param locale UI's locale, for loading localized text (ignored)
*/
static void loadbrush_callback(SDL_Surface * screen,
__attribute__((unused)) SDL_Texture * texture,
__attribute__((unused)) SDL_Renderer *
renderer, const char *restrict const dir,
unsigned dirlen, tp_ftw_str * files, unsigned i, const char *restrict const locale)
static void loadbrush_callback(SDL_Surface *screen,
__attribute__((unused)) SDL_Texture *texture,
__attribute__((unused)) SDL_Renderer *renderer, const char *restrict const dir,
unsigned dirlen, tp_ftw_str *files, unsigned i, const char *restrict const locale)
{
FILE *fi;
char buf[64];
@ -8508,7 +8508,7 @@ static void loadbrush_callback(SDL_Surface * screen,
/**
* FIXME
*/
static void load_brush_dir(SDL_Surface * screen, const char *restrict const dir)
static void load_brush_dir(SDL_Surface *screen, const char *restrict const dir)
{
char buf[TP_FTW_PATHSIZE];
unsigned dirlen = strlen(dir);
@ -8520,7 +8520,7 @@ static void load_brush_dir(SDL_Surface * screen, const char *restrict const dir)
/**
* FIXME
*/
SDL_Surface *mirror_surface(SDL_Surface * s)
SDL_Surface *mirror_surface(SDL_Surface *s)
{
SDL_Surface *new_surf;
int x;
@ -8560,7 +8560,7 @@ SDL_Surface *mirror_surface(SDL_Surface * s)
/**
* FIXME
*/
SDL_Surface *flip_surface(SDL_Surface * s)
SDL_Surface *flip_surface(SDL_Surface *s)
{
SDL_Surface *new_surf;
int y;
@ -8602,7 +8602,7 @@ static unsigned default_stamp_size;
/**
* FIXME
*/
static void loadstamp_finisher(stamp_type * sd, unsigned w, unsigned h, double ratio)
static void loadstamp_finisher(stamp_type *sd, unsigned w, unsigned h, double ratio)
{
unsigned int upper = HARD_MAX_STAMP_SIZE;
unsigned int underscanned_upper = HARD_MAX_STAMP_SIZE;
@ -8958,7 +8958,7 @@ static void set_active_stamp(void)
/**
* FIXME
*/
static void get_stamp_thumb(stamp_type * sd, int process_sound)
static void get_stamp_thumb(stamp_type *sd, int process_sound)
{
SDL_Surface *bigimg = NULL;
unsigned len = strlen(sd->stampname);
@ -9281,11 +9281,10 @@ static void get_stamp_thumb(stamp_type * sd, int process_sound)
* @param i Counter
* @param locale UI's locale, for loading localized text (ignored)
*/
static void loadstamp_callback(SDL_Surface * screen,
__attribute__((unused)) SDL_Texture * texture,
__attribute__((unused)) SDL_Renderer *
renderer, const char *restrict const dir,
unsigned dirlen, tp_ftw_str * files, unsigned i, const char *restrict const locale)
static void loadstamp_callback(SDL_Surface *screen,
__attribute__((unused)) SDL_Texture *texture,
__attribute__((unused)) SDL_Renderer *renderer, const char *restrict const dir,
unsigned dirlen, tp_ftw_str *files, unsigned i, const char *restrict const locale)
{
(void)locale;
@ -9411,7 +9410,7 @@ static void loadstamp_callback(SDL_Surface * screen,
/**
* FIXME
*/
static void load_stamp_dir(SDL_Surface * screen, const char *const dir)
static void load_stamp_dir(SDL_Surface *screen, const char *const dir)
{
char buf[TP_FTW_PATHSIZE];
unsigned dirlen = strlen(dir);
@ -9424,7 +9423,7 @@ static void load_stamp_dir(SDL_Surface * screen, const char *const dir)
/**
* FIXME
*/
static void load_stamps(SDL_Surface * screen)
static void load_stamps(SDL_Surface *screen)
{
char *homedirdir = get_fname("stamps", DIR_DATA);
@ -9491,7 +9490,7 @@ volatile long fontconfig_thread_done = 0;
/**
* FIXME
*/
int generate_fontconfig_cache_spinner(SDL_Surface * screen)
int generate_fontconfig_cache_spinner(SDL_Surface *screen)
{
SDL_Event event;
@ -9810,7 +9809,7 @@ static SDL_Surface *do_render_button_label(const char *const label)
}
#if 0
static SDL_Surface *crop_surface(SDL_Surface * surf)
static SDL_Surface *crop_surface(SDL_Surface *surf)
{
int top, bottom, left, right, x, y, w, h;
Uint8 r, g, b, a, r1, g1, b1, a1;
@ -11813,7 +11812,7 @@ static void draw_fills(void)
* FIXME
*/
/* Create a thumbnail: */
static SDL_Surface *thumbnail(SDL_Surface * src, int max_x, int max_y, int keep_aspect)
static SDL_Surface *thumbnail(SDL_Surface *src, int max_x, int max_y, int keep_aspect)
{
return (thumbnail2(src, max_x, max_y, keep_aspect, 1));
}
@ -11821,7 +11820,7 @@ static SDL_Surface *thumbnail(SDL_Surface * src, int max_x, int max_y, int keep_
/**
* FIXME
*/
static SDL_Surface *thumbnail2(SDL_Surface * src, int max_x, int max_y, int keep_aspect, int keep_alpha)
static SDL_Surface *thumbnail2(SDL_Surface *src, int max_x, int max_y, int keep_aspect, int keep_alpha)
{
int x, y;
float src_x, src_y, off_x, off_y;
@ -11999,7 +11998,7 @@ static SDL_Surface *thumbnail2(SDL_Surface * src, int max_x, int max_y, int keep
*/
/* Based on code from: http://www.codeproject.com/cs/media/imageprocessing4.asp
copyright 2002 Christian Graus */
static SDL_Surface *zoom(SDL_Surface * src, int new_w, int new_h)
static SDL_Surface *zoom(SDL_Surface *src, int new_w, int new_h)
{
SDL_Surface *s;
void (*putpixel)(SDL_Surface *, int, int, Uint32);
@ -12159,7 +12158,7 @@ static SDL_Surface *zoom(SDL_Surface * src, int new_w, int new_h)
/* XOR must show up on black, white, 0x7f grey, and 0x80 grey.
XOR must be exactly 100% perfectly reversable. */
static void _xorpixel(SDL_Surface * surf, int x, int y)
static void _xorpixel(SDL_Surface *surf, int x, int y)
{
Uint8 *p;
int BytesPerPixel;
@ -13412,7 +13411,7 @@ static void strip_quotes(char *buf)
/**
* FIXME
*/
static char *loaddesc(const char *const fname, Uint8 * locale_text)
static char *loaddesc(const char *const fname, Uint8 *locale_text)
{
char *txt_fname, *extptr;
char buf[512], def_buf[512]; /* doubled to 512 per TOYAMA Shin-Ichi's requested; -bjk 2007.05.10 */
@ -13526,7 +13525,7 @@ static char *loaddesc(const char *const fname, Uint8 * locale_text)
* FIXME
*/
/* Load a *.dat file */
static double loadinfo(const char *const fname, stamp_type * inf)
static double loadinfo(const char *const fname, stamp_type *inf)
{
char buf[256];
FILE *fi;
@ -13638,7 +13637,7 @@ static double loadinfo(const char *const fname, stamp_type * inf)
/**
* FIXME
*/
static int SDLCALL NondefectiveBlit(SDL_Surface * src, const SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect)
static int SDLCALL NondefectiveBlit(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
{
int dstx = 0;
int dsty = 0;
@ -13708,10 +13707,9 @@ static int SDLCALL NondefectiveBlit(SDL_Surface * src, const SDL_Rect * srcrect,
* @param SDL_Surface * dst -- destination surface
* @param int SDCALL(*blit) -- function for blitting; "NondefectiveBlit" or "SDL_BlitSurface"
*/
static void autoscale_copy_smear_free(SDL_Surface * src, SDL_Surface * dst,
int SDLCALL(*blit) (SDL_Surface * src,
const SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect))
static void autoscale_copy_smear_free(SDL_Surface *src, SDL_Surface *dst,
int SDLCALL(*blit) (SDL_Surface *src,
const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect))
{
SDL_Surface *src1;
SDL_Rect dest;
@ -13795,11 +13793,11 @@ static void autoscale_copy_smear_free(SDL_Surface * src, SDL_Surface * dst,
* @param int SDCALL(*blit) -- function for blitting; "NondefectiveBlit" or "SDL_BlitSurface"
* @param starter_template_options_t opts -- options (loaded from ".dat" file) describing strategies to take
*/
static void autoscale_copy_scale_or_smear_free(SDL_Surface * src, SDL_Surface * dst,
int SDLCALL(*blit) (SDL_Surface * src,
const SDL_Rect * srcrect,
SDL_Surface * dst,
SDL_Rect * dstrect), starter_template_options_t opts)
static void autoscale_copy_scale_or_smear_free(SDL_Surface *src, SDL_Surface *dst,
int SDLCALL(*blit) (SDL_Surface *src,
const SDL_Rect *srcrect,
SDL_Surface *dst,
SDL_Rect *dstrect), starter_template_options_t opts)
{
int new_w, new_h;
float src_aspect, dst_aspect;
@ -13974,7 +13972,7 @@ static void autoscale_copy_scale_or_smear_free(SDL_Surface * src, SDL_Surface *
* @param char * img_id -- basename of image
* @param starter_template_options_t * opts -- pointer to options struct to fill
*/
static void get_starter_template_options(char *dirname, char *img_id, starter_template_options_t * opts)
static void get_starter_template_options(char *dirname, char *img_id, starter_template_options_t *opts)
{
char fname[256], buf[256];
char *arg;
@ -14181,7 +14179,7 @@ static void get_starter_template_options(char *dirname, char *img_id, starter_te
/**
* FIXME
*/
static void load_starter_id(char *saved_id, FILE * fil)
static void load_starter_id(char *saved_id, FILE *fil)
{
char *rname;
char fname[FILENAME_MAX];
@ -14274,7 +14272,7 @@ static void load_starter_id(char *saved_id, FILE * fil)
* FIXME
*/
static SDL_Surface *load_starter_helper(char *path_and_basename,
const char *extension, SDL_Surface * (*load_func) (const char *))
const char *extension, SDL_Surface *(*load_func) (const char *))
{
char *ext;
char fname[256];
@ -14805,8 +14803,8 @@ static int do_prompt_snd(const char *const text, const char *const btn_yes,
* FIXME
*/
static int do_prompt_image(const char *const text, const char *const btn_yes,
const char *const btn_no, SDL_Surface * img1,
SDL_Surface * img2, SDL_Surface * img3, int ox, int oy)
const char *const btn_no, SDL_Surface *img1,
SDL_Surface *img2, SDL_Surface *img3, int ox, int oy)
{
return (do_prompt_image_snd(text, btn_yes, btn_no, img1, img2, img3, SND_NONE, ox, oy));
}
@ -14816,8 +14814,8 @@ static int do_prompt_image(const char *const text, const char *const btn_yes,
*/
static int do_prompt_image_snd(const char *const text,
const char *const btn_yes,
const char *const btn_no, SDL_Surface * img1,
SDL_Surface * img2, SDL_Surface * img3, int snd, int ox, int oy)
const char *const btn_no, SDL_Surface *img1,
SDL_Surface *img2, SDL_Surface *img3, int snd, int ox, int oy)
{
return (do_prompt_image_flash_snd(text, btn_yes, btn_no, img1, img2, img3, 0, snd, ox, oy));
}
@ -14827,8 +14825,8 @@ static int do_prompt_image_snd(const char *const text,
*/
static int do_prompt_image_flash(const char *const text,
const char *const btn_yes,
const char *const btn_no, SDL_Surface * img1,
SDL_Surface * img2, SDL_Surface * img3, int animate, int ox, int oy)
const char *const btn_no, SDL_Surface *img1,
SDL_Surface *img2, SDL_Surface *img3, int animate, int ox, int oy)
{
return (do_prompt_image_flash_snd(text, btn_yes, btn_no, img1, img2, img3, animate, SND_NONE, ox, oy));
}
@ -14842,8 +14840,8 @@ static int do_prompt_image_flash(const char *const text,
static int do_prompt_image_flash_snd(const char *const text,
const char *const btn_yes,
const char *const btn_no,
SDL_Surface * img1, SDL_Surface * img2,
SDL_Surface * img3, int animate, int snd, int ox, int oy)
SDL_Surface *img1, SDL_Surface *img2,
SDL_Surface *img3, int animate, int snd, int ox, int oy)
{
int oox, ooy, nx, ny;
SDL_Event event;
@ -15704,7 +15702,7 @@ static void cleanup(void)
/**
* FIXME
*/
static void free_surface(SDL_Surface ** surface_array)
static void free_surface(SDL_Surface **surface_array)
{
if (surface_array) //EP added this line to avoid app crash
if (*surface_array)
@ -15718,7 +15716,7 @@ static void free_surface(SDL_Surface ** surface_array)
/**
* FIXME
*/
static void free_surface_array(SDL_Surface * surface_array[], int count)
static void free_surface_array(SDL_Surface *surface_array[], int count)
{
int i;
@ -16433,7 +16431,7 @@ static int do_save(int tool, int dont_show_success_results, int autosave)
* FIXME
*/
static void set_chunk_data(unsigned char **chunk_data, size_t *chunk_data_len,
size_t uncompressed_size, Bytef * data, size_t dataLen)
size_t uncompressed_size, Bytef *data, size_t dataLen)
{
int headersLen;
unsigned int i;
@ -16888,7 +16886,7 @@ static void do_png_embed_data(png_structp png_ptr)
* FIXME
*/
/* Actually save the PNG data to the file stream: */
static int do_png_save(FILE * fi, const char *const fname, SDL_Surface * surf, int embed)
static int do_png_save(FILE *fi, const char *const fname, SDL_Surface *surf, int embed)
{
png_structp png_ptr;
png_infop info_ptr;
@ -19971,7 +19969,7 @@ static void rgbtohsv(Uint8 r8, Uint8 g8, Uint8 b8, float *h, float *s, float *v)
/**
* FIXME
*/
static void hsvtorgb(float h, float s, float v, Uint8 * r8, Uint8 * g8, Uint8 * b8)
static void hsvtorgb(float h, float s, float v, Uint8 *r8, Uint8 *g8, Uint8 *b8)
{
int i;
float f, p, q, t, r, g, b;
@ -20654,7 +20652,7 @@ static void draw_image_title(int t, SDL_Rect dest)
/* Handle keyboard events to control the mouse: */
/* Move as many pixels as bigsteps outside the areas,
in the areas and 5 pixels around, move 1 pixel at a time */
static void handle_keymouse(SDLKey key, Uint32 updown, int steps, SDL_Rect * area1, SDL_Rect * area2)
static void handle_keymouse(SDLKey key, Uint32 updown, int steps, SDL_Rect *area1, SDL_Rect *area2)
{
int left, right, up, bottom;
SDL_Event event;
@ -20952,7 +20950,7 @@ static void handle_keymouse_buttons(SDLKey key, int *whicht, int *whichc, SDL_Re
* FIXME
*/
/* Unblank screen in fullscreen mode, if needed: */
static void handle_active(SDL_Event * event)
static void handle_active(SDL_Event *event)
{
if (event->window.event == SDL_WINDOWEVENT_EXPOSED || SDL_WINDOWEVENT_RESTORED)
{
@ -20980,7 +20978,7 @@ static void handle_active(SDL_Event * event)
/**
* FIXME
*/
static SDL_Surface *duplicate_surface(SDL_Surface * orig)
static SDL_Surface *duplicate_surface(SDL_Surface *orig)
{
/*
Uint32 amask;
@ -22046,8 +22044,9 @@ static void load_magic_plugins(void)
{
if (magics[group][j].order == magics[group][idx].order)
{
fprintf(stderr, "Warning: In group %d, tool %d (%s) has the same order (%d) as tool %d (%s)\n",
group, idx, magics[group][idx].name, magics[group][j].order, j, magics[group][j].name);
fprintf(stderr,
"Warning: In group %d, tool %d (%s) has the same order (%d) as tool %d (%s)\n", group,
idx, magics[group][idx].name, magics[group][j].order, j, magics[group][j].name);
}
}
@ -22246,8 +22245,8 @@ static void update_progress_bar(void)
* FIXME
*/
static void magic_line_func(void *mapi,
int which, SDL_Surface * canvas,
SDL_Surface * last, int x1, int y1, int x2,
int which, SDL_Surface *canvas,
SDL_Surface *last, int x1, int y1, int x2,
int y2, int step, void (*cb)(void *, int, SDL_Surface *, SDL_Surface *, int, int))
{
int dx, dy, y;
@ -22377,7 +22376,7 @@ static void magic_stopsound(void)
/**
* FIXME
*/
static void magic_playsound(Mix_Chunk * snd, int left_right, int up_down)
static void magic_playsound(Mix_Chunk *snd, int left_right, int up_down)
{
#ifndef NOSOUND
@ -22431,6 +22430,7 @@ static int magic_playingsound(void)
{
#ifndef NOSOUND
int is_playing;
is_playing = Mix_Playing(0);
return is_playing;
#endif
@ -22477,7 +22477,7 @@ static int magic_button_down(void)
/**
* FIXME
*/
static SDL_Surface *magic_scale(SDL_Surface * surf, int w, int h, int aspect)
static SDL_Surface *magic_scale(SDL_Surface *surf, int w, int h, int aspect)
{
return (thumbnail2(surf, w, h, aspect, 1));
}
@ -22485,7 +22485,7 @@ static SDL_Surface *magic_scale(SDL_Surface * surf, int w, int h, int aspect)
/**
* FIXME
*/
static SDL_Surface *magic_rotate_scale(SDL_Surface * surf, int r, int w)
static SDL_Surface *magic_rotate_scale(SDL_Surface *surf, int r, int w)
{
return (rotozoomSurface(surf, r, (float)w / surf->w, SMOOTHING_ON));
}
@ -23853,7 +23853,7 @@ static int do_new_dialog(void)
normally appears at the beginning (above Starts & Templates),
but may be placed at the end with the "--newcolorslast" option.
*/
static int do_new_dialog_add_colors(SDL_Surface * *thumbs, int num_files,
static int do_new_dialog_add_colors(SDL_Surface **thumbs, int num_files,
int *d_places, char * *d_names, char * *d_exts, int *white_in_palette)
{
int j;
@ -26286,7 +26286,7 @@ static void draw_color_mixer_tooltip(void)
* @param int the_color - the color within the palette (e.g., COLOR_PICKER) (its RGB values will be grabbed via global color_hexes[], and the new button will be rendered into the appropriate img_color_btns[])
* @param SDL_Surface * icon - a bitmap to be applied to the button (or NULL if none) (e.g., the pipette icon that appears over the color selector)
*/
static void render_color_button(int the_color, SDL_Surface * icon)
static void render_color_button(int the_color, SDL_Surface *icon)
{
SDL_Surface *tmp_btn_up, *tmp_btn_down;
SDL_Rect dest;
@ -26486,7 +26486,7 @@ static void magic_set_size()
/**
* FIXME
*/
static void magic_putpixel(SDL_Surface * surface, int x, int y, Uint32 pixel)
static void magic_putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel)
{
putpixels[surface->format->BytesPerPixel] (surface, x, y, pixel);
}
@ -26494,7 +26494,7 @@ static void magic_putpixel(SDL_Surface * surface, int x, int y, Uint32 pixel)
/**
* FIXME
*/
static Uint32 magic_getpixel(SDL_Surface * surface, int x, int y)
static Uint32 magic_getpixel(SDL_Surface *surface, int x, int y)
{
return (getpixels[surface->format->BytesPerPixel] (surface, x, y));
}
@ -26502,7 +26502,7 @@ static Uint32 magic_getpixel(SDL_Surface * surface, int x, int y)
/**
* FIXME
*/
static void magic_xorpixel(SDL_Surface * surface, int x, int y)
static void magic_xorpixel(SDL_Surface *surface, int x, int y)
{
_xorpixel(surface, x, y);
}
@ -26511,7 +26511,7 @@ static void magic_xorpixel(SDL_Surface * surface, int x, int y)
/**
* FIXME
*/
static void magic_switchout(SDL_Surface * last)
static void magic_switchout(SDL_Surface *last)
{
int was_clicking = 0;
@ -26550,7 +26550,7 @@ static void magic_switchout(SDL_Surface * last)
/**
* FIXME
*/
static void magic_switchin(SDL_Surface * last)
static void magic_switchin(SDL_Surface *last)
{
if (cur_tool == TOOL_MAGIC)
{
@ -26587,7 +26587,7 @@ static int magic_modeint(int mode)
/**
* FIXME
*/
static void add_label_node(int w, int h, Uint16 x, Uint16 y, SDL_Surface * label_node_surface)
static void add_label_node(int w, int h, Uint16 x, Uint16 y, SDL_Surface *label_node_surface)
{
struct label_node *new_node = malloc(sizeof(struct label_node));
struct label_node *aux_node;
@ -27006,7 +27006,7 @@ static void delete_label_list(struct label_node **ref_head)
*/
/* A custom bliter that allows to put two transparent layers toghether without having to deal with colorkeys or SDL_SRCALPHA
I am always reinventing the wheel. Hope this one is not squared. Pere */
static void myblit(SDL_Surface * src_surf, SDL_Rect * src_rect, SDL_Surface * dest_surf, SDL_Rect * dest_rect)
static void myblit(SDL_Surface *src_surf, SDL_Rect *src_rect, SDL_Surface *dest_surf, SDL_Rect *dest_rect)
{
int x, y;
Uint8 src_r, src_g, src_b, src_a;
@ -27054,7 +27054,7 @@ static void myblit(SDL_Surface * src_surf, SDL_Rect * src_rect, SDL_Surface * de
/**
* FIXME
*/
static void load_info_about_label_surface(FILE * lfi)
static void load_info_about_label_surface(FILE *lfi)
{
struct label_node *new_node;
int list_ctr;
@ -27674,7 +27674,7 @@ int chunk_is_valid(const char *chunk_name, png_unknown_chunk unknown)
/**
* FIXME
*/
Bytef *get_chunk_data(FILE * fp, char *fname, png_structp png_ptr,
Bytef *get_chunk_data(FILE *fp, char *fname, png_structp png_ptr,
png_infop info_ptr, const char *chunk_name, png_unknown_chunk unknown, int *unc_size)
{
unsigned int i;
@ -27778,7 +27778,7 @@ Bytef *get_chunk_data(FILE * fp, char *fname, png_structp png_ptr,
/**
* FIXME
*/
void load_embedded_data(char *fname, SDL_Surface * org_surf)
void load_embedded_data(char *fname, SDL_Surface *org_surf)
{
FILE *fi, *fp;
char *control;
@ -29502,7 +29502,7 @@ static void do_lock_file(void)
}
int TP_EventFilter( __attribute__((unused))
void *data, EVENT_FILTER_EVENT_TYPE * event)
void *data, EVENT_FILTER_EVENT_TYPE *event)
/**
* FIXME
*/
@ -29526,8 +29526,7 @@ int TP_EventFilter( __attribute__((unused))
event->type == SDL_APP_WILLENTERBACKGROUND ||
event->type == SDL_APP_WILLENTERFOREGROUND ||
event->type == SDL_APP_DIDENTERBACKGROUND ||
event->type == SDL_APP_DIDENTERFOREGROUND ||
event->type == TP_USEREVENT_PLAYDESCSOUND)
event->type == SDL_APP_DIDENTERFOREGROUND || event->type == TP_USEREVENT_PLAYDESCSOUND)
return 1;
return 0;
@ -31295,7 +31294,7 @@ static void handle_joyaxismotion(SDL_Event event, int *motioner, int *val_x, int
* FIXME
*/
static void handle_joyhatmotion(SDL_Event event, int oldpos_x, int oldpos_y,
int *valhat_x, int *valhat_y, int *hatmotioner, Uint32 * old_hat_ticks)
int *valhat_x, int *valhat_y, int *hatmotioner, Uint32 *old_hat_ticks)
{
*hatmotioner = 1;

View file

@ -66,7 +66,7 @@ DIR *opendir(const char *pSpec)
*
* @param pDir Opened directory to close.
*/
void closedir(DIR * pDir)
void closedir(DIR *pDir)
{
assert(pDir != NULL);
free(pDir);

View file

@ -40,7 +40,7 @@ static HDC hDCprinter = NULL;
/**
* FIXME
*/
static SDL_Surface *make24bitDIB(SDL_Surface * surf)
static SDL_Surface *make24bitDIB(SDL_Surface *surf)
{
SDL_PixelFormat pixfmt;
SDL_Surface *surf24;
@ -318,7 +318,7 @@ int IsPrinterAvailable(void)
/**
* FIXME
*/
const char *SurfacePrint(SDL_Window * window, SDL_Surface * surf, const char *printcfg, int showdialog)
const char *SurfacePrint(SDL_Window *window, SDL_Surface *surf, const char *printcfg, int showdialog)
{
const char *res = NULL;
HWND hWnd;

View file

@ -4,7 +4,7 @@
int MoveFileToRecycleBin(const TCHAR * fullPathName);
int win32_trash(const char *path);
int MoveFileToRecycleBin(const TCHAR * fullPathName)
int MoveFileToRecycleBin(const TCHAR *fullPathName)
{
SHFILEOPSTRUCT fileOp;
const TCHAR *src = fullPathName;