Reformat .h files.

I did my best to exempt some of the bigger aligned blocks from the reformatting
using the /* clang-format off */ and /* clang-format on */ tags. Probably some
that shouldn't have been formatted were anyway; if you encounter them, please
fix.

The clang-format tags were left in on the basis that it's much easier to prune
those out later than to put them back in, and it means that, modulo my custom
version of clang-format, I should be able to run clang-format on the source tree
again without changing anything, now that Pat has fixed the VA_DECL issues.
This commit is contained in:
Sean Hunt
2015-05-25 09:03:10 +09:00
parent 26ee7dc370
commit 8b57d96fd2
156 changed files with 10712 additions and 10701 deletions

View File

@@ -4,7 +4,7 @@
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
/* NetHack may be freely redistributed. See license for details. */
/* These XPMs are the artwork of Warwick Allison
* <warwick@troll.no>. They have been borrowed from
* <warwick@troll.no>. They have been borrowed from
* the most excellent NetHackQt, until such time as
* we can come up with something better.
*
@@ -12,6 +12,7 @@
* http://www.troll.no/~warwick/nethack/
*/
/* clang-format off */
/* XPM */
static char *blind_xpm[] = {
/* width height ncolors chars_per_pixel */
@@ -1449,4 +1450,4 @@ static char *nothing_xpm[] = {
"oooooooooooooooooooooooooooooooooooooooo",
"oooooooooooooooooooooooooooooooooooooooo"
};
/* clang-format on */

View File

@@ -7,10 +7,8 @@
#ifndef GnomeHackAskStringDialog_h
#define GnomeHackAskStringDialog_h
int ghack_ask_string_dialog(const char *szMessageStr,
const char *szDefaultStr, const char *szTitleStr,
char *buffer);
const char *szDefaultStr, const char *szTitleStr,
char *buffer);
#endif /* GnomeHackAskStringDialog_h */

View File

@@ -9,7 +9,7 @@
/*
* This header files defines the interface between the window port specific
* code in the Gnome port and the rest of the nethack game engine.
* code in the Gnome port and the rest of the nethack game engine.
*/
#include <gnome.h>
@@ -28,7 +28,6 @@
#include "gnglyph.h"
#include "gnworn.h"
/* Create an array to keep track of the various windows */
#ifndef MAXWINDOWS
@@ -36,13 +35,12 @@
#endif
typedef struct gnome_nhwindow_data {
GtkWidget* win;
int type;
GtkWidget *win;
int type;
} GNHWinData;
/* Some prototypes */
void gnome_init_nhwindows(int* argc, char** argv);
void gnome_init_nhwindows(int *argc, char **argv);
void gnome_player_selection(void);
void gnome_askname(void);
void gnome_get_nh_event(void);
@@ -56,14 +54,14 @@ void gnome_display_nhwindow(winid wid, BOOLEAN_P block);
void gnome_destroy_nhwindow(winid wid);
void gnome_curs(winid wid, int x, int y);
void gnome_putstr(winid wid, int attr, const char *text);
void gnome_display_file(const char *filename,BOOLEAN_P must_exist);
void gnome_display_file(const char *filename, BOOLEAN_P must_exist);
void gnome_start_menu(winid wid);
void gnome_add_menu(winid wid, int glyph, const ANY_P * identifier,
CHAR_P accelerator, CHAR_P group_accel, int attr,
const char *str, BOOLEAN_P presel);
void gnome_add_menu(winid wid, int glyph, const ANY_P *identifier,
CHAR_P accelerator, CHAR_P group_accel, int attr,
const char *str, BOOLEAN_P presel);
void gnome_end_menu(winid wid, const char *prompt);
int gnome_select_menu(winid wid, int how, MENU_ITEM_P **selected);
/* No need for message_menu -- we'll use genl_message_menu instead */
int gnome_select_menu(winid wid, int how, MENU_ITEM_P **selected);
/* No need for message_menu -- we'll use genl_message_menu instead */
void gnome_update_inventory(void);
void gnome_mark_synch(void);
void gnome_wait_synch(void);
@@ -72,25 +70,21 @@ void gnome_cliparound(int x, int y);
* gnome_cliparound (which lacks the winid) simply calls this funtion.
*/
void gnome_cliparound_proper(winid wid, int x, int y);
void gnome_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph);
void gnome_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph);
void gnome_raw_print(const char *str);
void gnome_raw_print_bold(const char *str);
int gnome_nhgetch(void);
int gnome_nh_poskey(int *x, int *y, int *mod);
int gnome_nhgetch(void);
int gnome_nh_poskey(int *x, int *y, int *mod);
void gnome_nhbell(void);
int gnome_doprev_message(void);
char gnome_yn_function(const char *question, const char *choices,
CHAR_P def);
int gnome_doprev_message(void);
char gnome_yn_function(const char *question, const char *choices, CHAR_P def);
void gnome_getlin(const char *question, char *input);
int gnome_get_ext_cmd(void);
int gnome_get_ext_cmd(void);
void gnome_number_pad(int state);
void gnome_delay_output(void);
void gnome_start_screen(void);
void gnome_end_screen(void);
void gnome_outrip(winid wid, int how, time_t when);
void gnome_delete_nhwindow_by_reference( GtkWidget *menuWin);
void gnome_delete_nhwindow_by_reference(GtkWidget *menuWin);
#endif /* GnomeHackBind_h */

View File

@@ -14,7 +14,7 @@
that trigger spurious warnings if gcc's `-Wshadow' option is used */
#undef index
#define index _hide_index_
#define time _hide_time_
#define time _hide_time_
#include <gdk_imlib.h>
#include <gdk/gdk.h>
@@ -23,22 +23,21 @@
#define index strchr
#undef time
extern short glyph2tile[]; /* From tile.c */
extern short glyph2tile[]; /* From tile.c */
typedef struct {
GdkImlibImage* im;
int count;
int width;
int height;
GdkImlibImage *im;
int count;
int width;
int height;
} GHackGlyphs;
extern int ghack_init_glyphs( const char *);
extern void ghack_free_glyphs( void);
extern void ghack_dispose_glyphs( void);
extern int ghack_glyph_count( void);
extern GdkImlibImage* ghack_image_from_glyph( int, gboolean);
extern int ghack_glyph_height( void);
extern int ghack_glyph_width( void);
extern int ghack_init_glyphs(const char *);
extern void ghack_free_glyphs(void);
extern void ghack_dispose_glyphs(void);
extern int ghack_glyph_count(void);
extern GdkImlibImage *ghack_image_from_glyph(int, gboolean);
extern int ghack_glyph_height(void);
extern int ghack_glyph_width(void);
#endif /* GnomeHackGlyph_h */
#endif /* GnomeHackGlyph_h */

View File

@@ -10,19 +10,15 @@
#include <gnome.h>
#include <gtk/gtk.h>
void ghack_init_main_window( int argc, char** argv);
void ghack_main_window_add_map_window(GtkWidget* win);
void ghack_main_window_add_message_window(GtkWidget* win);
void ghack_main_window_add_status_window(GtkWidget* win);
void ghack_init_main_window(int argc, char **argv);
void ghack_main_window_add_map_window(GtkWidget *win);
void ghack_main_window_add_message_window(GtkWidget *win);
void ghack_main_window_add_status_window(GtkWidget *win);
void ghack_main_window_add_text_window(GtkWidget *);
void ghack_main_window_add_worn_window(GtkWidget* win);
void ghack_main_window_add_worn_window(GtkWidget *win);
void ghack_main_window_remove_window(GtkWidget *);
void ghack_main_window_update_inventory();
void ghack_save_game_cb(GtkWidget *widget, gpointer data);
GtkWidget* ghack_get_main_window();
GtkWidget *ghack_get_main_window();
#endif /* GnomeHackMainWindow_h */

View File

@@ -12,23 +12,22 @@
#include "global.h"
#include "gnomeprv.h"
GtkWidget* ghack_init_menu_window( void );
GtkWidget *ghack_init_menu_window(void);
struct _GHackMenuItem
{
int glyph;
const ANY_P *identifier;
CHAR_P accelerator;
CHAR_P group_accel;
int attr;
const char* str;
BOOLEAN_P presel;
struct _GHackMenuItem {
int glyph;
const ANY_P *identifier;
CHAR_P accelerator;
CHAR_P group_accel;
int attr;
const char *str;
BOOLEAN_P presel;
};
typedef struct _GHackMenuItem GHackMenuItem;
int ghack_menu_window_select_menu (GtkWidget *menuWin,
MENU_ITEM_P **_selected, gint how);
int ghack_menu_window_select_menu(GtkWidget *menuWin, MENU_ITEM_P **_selected,
gint how);
int ghack_menu_ext_cmd(void);
#endif /* GnomeHackMenuWindow_h */
#endif /* GnomeHackMenuWindow_h */

View File

@@ -10,16 +10,15 @@
#include <gnome.h>
#include "config.h"
GtkWidget* ghack_init_message_window ( /* GnomeHackKeyBuffer g_keybuffer,
GnomeHackClickBuffer g_clickbuffer */ );
GtkWidget *ghack_init_message_window(/* GnomeHackKeyBuffer g_keybuffer,
GnomeHackClickBuffer g_clickbuffer */);
void ghack_message_window_clear(GtkWidget *widget, gpointer data);
void ghack_message_window_destroy();
void ghack_message_window_display(GtkWidget *widget, boolean block,
gpointer data);
void ghack_message_window_put_string(GtkWidget *widget, int attr,
const char* text, gpointer data);
const char *text, gpointer data);
void ghack_message_window_use_RIP(int how);
void ghack_message_window_scroll(int dx, int dy);
#endif /* GnomeHackMessageWindow_h */

View File

@@ -14,7 +14,4 @@
#include "winGnome.h"
#endif /* GnomeHack_h */
#endif /* GnomeHack_h */

View File

@@ -7,9 +7,6 @@
#ifndef GnomeHackSettings_h
#define GnomeHackSettings_h
void ghack_settings_dialog( void);
void ghack_settings_dialog(void);
#endif /* GnomeHackSettings.h */

View File

@@ -7,6 +7,6 @@
#ifndef GnomeHackPlayerSelDialog_h
#define GnomeHackPlayerSelDialog_h
int ghack_player_sel_dialog(const char **, const gchar*, const gchar*);
int ghack_player_sel_dialog(const char **, const gchar *, const gchar *);
#endif /* GnomeHackPlayerSelDialog_h */

View File

@@ -15,33 +15,32 @@
/* The list of custom signals */
enum {
GHSIG_CURS,
GHSIG_PUTSTR,
GHSIG_PRINT_GLYPH,
GHSIG_CLEAR,
GHSIG_DISPLAY,
GHSIG_START_MENU,
GHSIG_ADD_MENU,
GHSIG_END_MENU,
GHSIG_SELECT_MENU,
GHSIG_CLIPAROUND,
GHSIG_FADE_HIGHLIGHT,
GHSIG_DELAY,
GHSIG_LAST_SIG
GHSIG_CURS,
GHSIG_PUTSTR,
GHSIG_PRINT_GLYPH,
GHSIG_CLEAR,
GHSIG_DISPLAY,
GHSIG_START_MENU,
GHSIG_ADD_MENU,
GHSIG_END_MENU,
GHSIG_SELECT_MENU,
GHSIG_CLIPAROUND,
GHSIG_FADE_HIGHLIGHT,
GHSIG_DELAY,
GHSIG_LAST_SIG
};
guint ghack_signals[GHSIG_LAST_SIG];
extern void ghack_init_signals( void);
extern void ghack_init_signals(void);
void ghack_handle_key_press(GtkWidget *widget, GdkEventKey *event,
gpointer data);
void ghack_handle_button_press(GtkWidget *widget, GdkEventButton *event,
gpointer data);
void ghack_handle_key_press(GtkWidget *widget, GdkEventKey *event,
gpointer data);
void ghack_handle_button_press(GtkWidget *widget, GdkEventButton *event,
gpointer data);
typedef struct {
int x, y, mod;
int x, y, mod;
} GHClick;
extern GList *g_keyBuffer;
@@ -51,8 +50,6 @@ extern int g_numClicks;
extern int g_askingQuestion;
void ghack_delay( GtkWidget *win, int numMillisecs, gpointer data);
#endif /* GnomeHackSignals_h */
void ghack_delay(GtkWidget *win, int numMillisecs, gpointer data);
#endif /* GnomeHackSignals_h */

View File

@@ -11,6 +11,6 @@
#include "config.h"
#include "global.h"
GtkWidget* ghack_init_status_window ();
GtkWidget *ghack_init_status_window();
#endif /* GnomeHackStatusWindow_h */

View File

@@ -11,14 +11,13 @@
#include "config.h"
#include "global.h"
GtkWidget* ghack_init_text_window ( );
GtkWidget *ghack_init_text_window();
void ghack_text_window_clear(GtkWidget *widget, gpointer data);
void ghack_text_window_destroy();
void ghack_text_window_display(GtkWidget *widget, boolean block,
gpointer data);
gpointer data);
void ghack_text_window_put_string(GtkWidget *widget, int attr,
const char* text, gpointer data);
void ghack_text_window_rip_string( const char* ripString);
const char *text, gpointer data);
void ghack_text_window_rip_string(const char *ripString);
#endif /* GnomeHackTextWindow_h */

View File

@@ -13,6 +13,6 @@
#include "config.h"
#include "global.h"
GtkWidget* ghack_init_worn_window();
GtkWidget *ghack_init_worn_window();
#endif /* GnomeHackWornWindow_h */

View File

@@ -7,8 +7,7 @@
#ifndef GnomeHackYesNoDialog_h
#define GnomeHackYesNoDialog_h
int ghack_yes_no_dialog( const char* szQuestionStr,
const char* szChoicesStr, int nDefault);
int ghack_yes_no_dialog(const char *szQuestionStr, const char *szChoicesStr,
int nDefault);
#endif