Reformat all C files.

I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.

To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!
This commit is contained in:
Sean Hunt
2015-05-09 13:43:16 -04:00
parent 167800afdf
commit 97d6fade74
270 changed files with 182649 additions and 173878 deletions
+37 -31
View File
@@ -1,6 +1,6 @@
/* NetHack 3.6 gnworn.c 2009/05/06 10:58:06 1.3 */
/*
* $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$
* $NHDT-Date: 1431192771 2015/05/09 17:32:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $
* $Date: 2012/01/10 17:47:38 $ $Revision: 1.4 $
*/
/* Copyright (C) 2002, Dylan Alex Simon */
@@ -11,17 +11,21 @@
#include "gnsignal.h"
#include "gnomeprv.h"
#define WORN_WIDTH 3
#define WORN_HEIGHT 6
#define WORN_WIDTH 3
#define WORN_HEIGHT 6
#define WORN_OBJECT_LIST /* struct obj *[WORN_HEIGHT][WORN_WIDTH] = */ { \
{ uquiver, uarmh, u.twoweap ? NULL : uswapwep }, \
{ u.twoweap ? uswapwep : NULL, ublindf, uwep }, \
{ uleft, uamul, uright }, \
{ uarms, uarmc, uarmg }, \
{ uarmu, uarm, uskin }, \
{ uball, uarmf, uchain } \
}
#define WORN_OBJECT_LIST /* struct obj *[WORN_HEIGHT][WORN_WIDTH] = */ \
{ \
{ \
uquiver, uarmh, u.twoweap ? NULL : uswapwep \
} \
, { u.twoweap ? uswapwep : NULL, ublindf, uwep }, \
{ uleft, uamul, uright }, { uarms, uarmc, uarmg }, \
{ uarmu, uarm, uskin }, \
{ \
uball, uarmf, uchain \
} \
}
static GtkWidget *worn_contents[WORN_HEIGHT][WORN_WIDTH];
static struct obj *last_worn_objects[WORN_HEIGHT][WORN_WIDTH];
@@ -29,26 +33,27 @@ static struct obj *last_worn_objects[WORN_HEIGHT][WORN_WIDTH];
GdkImlibImage *image_of_worn_object(struct obj *o);
void ghack_worn_display(GtkWidget *win, boolean block, gpointer data);
GtkWidget*
GtkWidget *
ghack_init_worn_window()
{
GtkWidget *top;
GtkWidget *table;
GtkWidget *tablealign;
GtkWidget *label;
int i,j;
int i, j;
top = gtk_vbox_new(FALSE, 2);
table = gtk_table_new(WORN_HEIGHT, WORN_WIDTH, TRUE);
for (i = 0; i < WORN_HEIGHT; i++) {
for (j = 0; j < WORN_WIDTH; j++) {
worn_contents[i][j] =
gnome_pixmap_new_from_imlib(image_of_worn_object(NULL));
last_worn_objects[i][j] = NULL; /* a pointer that will never be */
gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(worn_contents[i][j]),
j, j+1, i, i+1, 0, 0, 0, 0);
}
for (j = 0; j < WORN_WIDTH; j++) {
worn_contents[i][j] =
gnome_pixmap_new_from_imlib(image_of_worn_object(NULL));
last_worn_objects[i][j] = NULL; /* a pointer that will never be */
gtk_table_attach(GTK_TABLE(table),
GTK_WIDGET(worn_contents[i][j]), j, j + 1, i,
i + 1, 0, 0, 0, 0);
}
}
tablealign = gtk_alignment_new(0.5, 0.0, 0.0, 1.0);
gtk_box_pack_start(GTK_BOX(top), tablealign, FALSE, FALSE, 0);
@@ -59,21 +64,21 @@ ghack_init_worn_window()
gtk_box_pack_start(GTK_BOX(top), label, FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(top), "ghack_display",
GTK_SIGNAL_FUNC(ghack_worn_display), NULL);
GTK_SIGNAL_FUNC(ghack_worn_display), NULL);
return top;
}
GdkImlibImage*
GdkImlibImage *
image_of_worn_object(struct obj *o)
{
int glyph;
GdkImlibImage *im;
if (o)
glyph = obj_to_glyph(o);
glyph = obj_to_glyph(o);
else
glyph = cmap_to_glyph(S_stone);
glyph = cmap_to_glyph(S_stone);
im = ghack_image_from_glyph(glyph, FALSE);
@@ -87,12 +92,13 @@ ghack_worn_display(GtkWidget *win, boolean block, gpointer data)
struct obj *worn_objects[WORN_HEIGHT][WORN_WIDTH] = WORN_OBJECT_LIST;
for (i = 0; i < WORN_HEIGHT; i++) {
for (j = 0; j < WORN_WIDTH; j++) {
if (worn_objects[i][j] != last_worn_objects[i][j]) {
last_worn_objects[i][j] = worn_objects[i][j];
gnome_pixmap_load_imlib(GNOME_PIXMAP(worn_contents[i][j]),
image_of_worn_object(worn_objects[i][j]));
}
}
for (j = 0; j < WORN_WIDTH; j++) {
if (worn_objects[i][j] != last_worn_objects[i][j]) {
last_worn_objects[i][j] = worn_objects[i][j];
gnome_pixmap_load_imlib(
GNOME_PIXMAP(worn_contents[i][j]),
image_of_worn_object(worn_objects[i][j]));
}
}
}
}