Re-ran indent on all .c & .h source code files

Like so --
  find . -name "*.c" -or -name "*.h" -exec  indent -nbfda -npcs -npsl -bli0 --no-tabs {} \;

The `indent` invocation differs from the last one noted in
CHANGES.txt (from 2006!?), in that I've added "--no-tabs",
to ensure indents are all space-based.
This commit is contained in:
Bill Kendrick 2022-09-15 00:11:16 -07:00
parent 09f332367f
commit cc05925d9e
99 changed files with 31659 additions and 27102 deletions

View file

@ -76,23 +76,29 @@ SDL_Surface *rainbow_get_icon(magic_api * api, int which);
char *rainbow_get_name(magic_api * api, int which);
int rainbow_get_group(magic_api * api, int which);
char *rainbow_get_description(magic_api * api, int which, int mode);
static void rainbow_linecb(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y);
static void rainbow_linecb(void *ptr, int which, SDL_Surface * canvas,
SDL_Surface * last, int x, int y);
void rainbow_drag(magic_api * api, int which, SDL_Surface * canvas,
SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect);
SDL_Surface * last, int ox, int oy, int x, int y,
SDL_Rect * update_rect);
void rainbow_click(magic_api * api, int which, int mode,
SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
SDL_Surface * canvas, SDL_Surface * last, int x, int y,
SDL_Rect * update_rect);
void rainbow_release(magic_api * api, int which,
SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
SDL_Surface * canvas, SDL_Surface * last, int x, int y,
SDL_Rect * update_rect);
void rainbow_shutdown(magic_api * api);
void rainbow_set_color(magic_api * api, Uint8 r, Uint8 g, Uint8 b);
int rainbow_requires_colors(magic_api * api, int which);
void rainbow_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas);
void rainbow_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
void rainbow_switchin(magic_api * api, int which, int mode,
SDL_Surface * canvas);
void rainbow_switchout(magic_api * api, int which, int mode,
SDL_Surface * canvas);
int rainbow_modes(magic_api * api, int which);
Uint32 rainbow_api_version(void)
@ -109,7 +115,8 @@ int rainbow_init(magic_api * api)
rainbow_color = 0;
rainbow_mix = 0;
snprintf(fname, sizeof(fname), "%ssounds/magic/rainbow.wav", api->data_directory);
snprintf(fname, sizeof(fname), "%ssounds/magic/rainbow.wav",
api->data_directory);
rainbow_snd = Mix_LoadWAV(fname);
return (1);
@ -126,29 +133,37 @@ SDL_Surface *rainbow_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED)
{
char fname[1024];
snprintf(fname, sizeof(fname), "%simages/magic/rainbow.png", api->data_directory);
snprintf(fname, sizeof(fname), "%simages/magic/rainbow.png",
api->data_directory);
return (IMG_Load(fname));
}
// Return our names, localized:
char *rainbow_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
char *rainbow_get_name(magic_api * api ATTRIBUTE_UNUSED,
int which ATTRIBUTE_UNUSED)
{
if (which == 0) {
if (which == 0)
{
return (strdup(gettext_noop("Rainbow")));
} else {
}
else
{
return (strdup(gettext_noop("Smooth Rainbow")));
}
}
// Return our group:
int rainbow_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
int rainbow_get_group(magic_api * api ATTRIBUTE_UNUSED,
int which ATTRIBUTE_UNUSED)
{
return MAGIC_TYPE_PAINTING;
}
// Return our descriptions, localized:
char *rainbow_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
char *rainbow_get_description(magic_api * api ATTRIBUTE_UNUSED,
int which ATTRIBUTE_UNUSED,
int mode ATTRIBUTE_UNUSED)
{
return (strdup(gettext_noop("You can draw in rainbow colors!")));
}
@ -156,37 +171,43 @@ char *rainbow_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIB
// Do the effect:
static void rainbow_linecb(void *ptr, int which ATTRIBUTE_UNUSED,
SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y)
SDL_Surface * canvas,
SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y)
{
magic_api *api = (magic_api *) ptr;
int xx, yy;
for (yy = y - 16; yy < y + 16; yy++)
{
for (xx = x - 16; xx < x + 16; xx++)
{
for (xx = x - 16; xx < x + 16; xx++)
{
if (api->in_circle(xx - x, yy - y, 16))
{
api->putpixel(canvas, xx, yy, rainbow_rgb);
}
}
if (api->in_circle(xx - x, yy - y, 16))
{
api->putpixel(canvas, xx, yy, rainbow_rgb);
}
}
}
}
// Affect the canvas on drag:
void rainbow_drag(magic_api * api, int which, SDL_Surface * canvas,
SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect)
SDL_Surface * last, int ox, int oy, int x, int y,
SDL_Rect * update_rect)
{
Uint8 r1, g1, b1, r2, g2, b2;
int rc_tmp;
if (which == 1) {
if (which == 1)
{
rainbow_mix += 1;
if (rainbow_mix > MIX_MAX) {
if (rainbow_mix > MIX_MAX)
{
rainbow_mix = 0;
rainbow_color = (rainbow_color + 1) % NUM_RAINBOW_COLORS;
}
} else {
}
else
{
rainbow_mix = 0;
rainbow_color = (rainbow_color + 1) % NUM_RAINBOW_COLORS;
}
@ -201,26 +222,30 @@ void rainbow_drag(magic_api * api, int which, SDL_Surface * canvas,
b2 = rainbow_hexes[rc_tmp][2];
rainbow_rgb = SDL_MapRGB(canvas->format,
((r1 * (MIX_MAX - rainbow_mix)) + (r2 * rainbow_mix)) / MIX_MAX,
((g1 * (MIX_MAX - rainbow_mix)) + (g2 * rainbow_mix)) / MIX_MAX,
((b1 * (MIX_MAX - rainbow_mix)) + (b2 * rainbow_mix)) / MIX_MAX);
((r1 * (MIX_MAX - rainbow_mix)) +
(r2 * rainbow_mix)) / MIX_MAX,
((g1 * (MIX_MAX - rainbow_mix)) +
(g2 * rainbow_mix)) / MIX_MAX,
((b1 * (MIX_MAX - rainbow_mix)) +
(b2 * rainbow_mix)) / MIX_MAX);
api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, rainbow_linecb);
api->line((void *) api, which, canvas, last, ox, oy, x, y, 1,
rainbow_linecb);
if (ox > x)
{
int tmp = ox;
{
int tmp = ox;
ox = x;
x = tmp;
}
ox = x;
x = tmp;
}
if (oy > y)
{
int tmp = oy;
{
int tmp = oy;
oy = y;
y = tmp;
}
oy = y;
y = tmp;
}
update_rect->x = ox - 16;
update_rect->y = oy - 16;
@ -232,14 +257,18 @@ void rainbow_drag(magic_api * api, int which, SDL_Surface * canvas,
// Affect the canvas on click:
void rainbow_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED,
SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect)
SDL_Surface * canvas, SDL_Surface * last, int x, int y,
SDL_Rect * update_rect)
{
rainbow_drag(api, which, canvas, last, x, y, x, y, update_rect);
}
void rainbow_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED,
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED)
void rainbow_release(magic_api * api ATTRIBUTE_UNUSED,
int which ATTRIBUTE_UNUSED,
SDL_Surface * canvas ATTRIBUTE_UNUSED,
SDL_Surface * last ATTRIBUTE_UNUSED,
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED,
SDL_Rect * update_rect ATTRIBUTE_UNUSED)
{
}
@ -251,28 +280,33 @@ void rainbow_shutdown(magic_api * api ATTRIBUTE_UNUSED)
}
// Record the color from Tux Paint:
void rainbow_set_color(magic_api * api ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED,
void rainbow_set_color(magic_api * api ATTRIBUTE_UNUSED,
Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED,
Uint8 b ATTRIBUTE_UNUSED)
{
}
// Use colors:
int rainbow_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
int rainbow_requires_colors(magic_api * api ATTRIBUTE_UNUSED,
int which ATTRIBUTE_UNUSED)
{
return 0;
}
void rainbow_switchin(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
void rainbow_switchin(magic_api * api ATTRIBUTE_UNUSED,
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
SDL_Surface * canvas ATTRIBUTE_UNUSED)
{
}
void rainbow_switchout(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
void rainbow_switchout(magic_api * api ATTRIBUTE_UNUSED,
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
SDL_Surface * canvas ATTRIBUTE_UNUSED)
{
}
int rainbow_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
int rainbow_modes(magic_api * api ATTRIBUTE_UNUSED,
int which ATTRIBUTE_UNUSED)
{
return (MODE_PAINT);
}