X11 missing prototypes

Add some prototypes and add a new include to a couple of files that
use config.h instead of hack.h.  So sys/unix/Makefile.src has been
changed slightly.
This commit is contained in:
PatR
2020-04-24 02:40:22 -07:00
parent 6677003c8f
commit 6b2fcd7d73
5 changed files with 51 additions and 18 deletions
+18 -2
View File
@@ -9,6 +9,13 @@
#ifndef WINX_H #ifndef WINX_H
#define WINX_H #define WINX_H
#ifndef COLOR_H
#include "color.h" /* CLR_MAX */
#endif
#ifndef WINTYPE_H
#include "wintype.h" /* winid */
#endif
#ifndef E #ifndef E
#define E extern #define E extern
#endif #endif
@@ -300,9 +307,12 @@ extern struct window_procs X11_procs;
window, __FILE__, __LINE__); \ window, __FILE__, __LINE__); \
} while (0) } while (0)
/* ### Window.c ### */
E Font FDECL(WindowFont, (Widget));
E XFontStruct *FDECL(WindowFontStruct, (Widget));
/* ### dialogs.c ### */ /* ### dialogs.c ### */
E Widget E Widget FDECL(CreateDialog, (Widget, String, XtCallbackProc, XtCallbackProc));
FDECL(CreateDialog, (Widget, String, XtCallbackProc, XtCallbackProc));
E void FDECL(SetDialogPrompt, (Widget, String)); E void FDECL(SetDialogPrompt, (Widget, String));
E String FDECL(GetDialogResponse, (Widget)); E String FDECL(GetDialogResponse, (Widget));
E void FDECL(SetDialogResponse, (Widget, String, unsigned)); E void FDECL(SetDialogResponse, (Widget, String, unsigned));
@@ -314,6 +324,10 @@ E XColor FDECL(get_nhcolor, (struct xwindow *, int));
E void FDECL(init_menu_nhcolors, (struct xwindow *)); E void FDECL(init_menu_nhcolors, (struct xwindow *));
E void FDECL(load_boldfont, (struct xwindow *, Widget)); E void FDECL(load_boldfont, (struct xwindow *, Widget));
E Boolean FDECL(nhApproxColor, (Screen *, Colormap, char *, XColor *)); E Boolean FDECL(nhApproxColor, (Screen *, Colormap, char *, XColor *));
E Boolean FDECL(nhCvtStringToPixel, (Display *, XrmValuePtr, Cardinal *,
XrmValuePtr, XrmValuePtr, XtPointer *));
E void FDECL(get_window_frame_extents, (Widget,
long *, long *, long *, long *));
E void FDECL(get_widget_window_geometry, (Widget, int *, int *, int *, int *)); E void FDECL(get_widget_window_geometry, (Widget, int *, int *, int *, int *));
E char *FDECL(fontname_boldify, (const char *)); E char *FDECL(fontname_boldify, (const char *));
E Dimension FDECL(nhFontHeight, (Widget)); E Dimension FDECL(nhFontHeight, (Widget));
@@ -352,6 +366,8 @@ E void FDECL(create_menu_window, (struct xwindow *));
E void FDECL(destroy_menu_window, (struct xwindow *)); E void FDECL(destroy_menu_window, (struct xwindow *));
/* ### winmisc.c ### */ /* ### winmisc.c ### */
E XtPointer FDECL(i2xtp, (int));
E int FDECL(xtp2i, (XtPointer));
E void FDECL(ps_key, (Widget, XEvent *, String *, E void FDECL(ps_key, (Widget, XEvent *, String *,
Cardinal *)); /* player selection action */ Cardinal *)); /* player selection action */
E void FDECL(race_key, (Widget, XEvent *, String *, E void FDECL(race_key, (Widget, XEvent *, String *,
+4 -2
View File
@@ -817,9 +817,11 @@ cursinvt.o: ../win/curses/cursinvt.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursinvt.h ../win/curses/cursinvt.h
$(CC) $(CFLAGS) -c -o $@ ../win/curses/cursinvt.c $(CC) $(CFLAGS) -c -o $@ ../win/curses/cursinvt.c
Window.o: ../win/X11/Window.c ../include/xwindowp.h ../include/xwindow.h \ Window.o: ../win/X11/Window.c ../include/xwindowp.h ../include/xwindow.h \
$(CONFIG_H) ../include/lint.h $(CONFIG_H) ../include/lint.h ../include/winX.h \
../include/color.h ../include/wintype.h
$(CC) $(CFLAGS) $(X11CFLAGS) -c -o $@ ../win/X11/Window.c $(CC) $(CFLAGS) $(X11CFLAGS) -c -o $@ ../win/X11/Window.c
dialogs.o: ../win/X11/dialogs.c $(CONFIG_H) ../include/lint.h dialogs.o: ../win/X11/dialogs.c $(CONFIG_H) ../include/lint.h \
../include/winX.h ../include/color.h ../include/wintype.h
$(CC) $(CFLAGS) $(X11CFLAGS) -c -o $@ ../win/X11/dialogs.c $(CC) $(CFLAGS) $(X11CFLAGS) -c -o $@ ../win/X11/dialogs.c
winX.o: ../win/X11/winX.c $(HACK_H) ../include/winX.h ../include/dlb.h \ winX.o: ../win/X11/winX.c $(HACK_H) ../include/winX.h ../include/dlb.h \
../include/xwindow.h ../win/X11/nh72icon ../win/X11/nh56icon \ ../include/xwindow.h ../win/X11/nh72icon ../win/X11/nh56icon \
+3 -2
View File
@@ -31,8 +31,9 @@
#include "xwindowp.h" #include "xwindowp.h"
#include "config.h" #include "config.h" /* #define for const for non __STDC__ compilers */
#include "lint.h" #include "lint.h" /* for nethack's nhStr() macro */
#include "winX.h" /* to make sure protoypes match corresponding functions */
static XtResource resources[] = { static XtResource resources[] = {
#define offset(field) XtOffset(WindowWidget, window.field) #define offset(field) XtOffset(WindowWidget, window.field)
+1
View File
@@ -79,6 +79,7 @@
#include "config.h" /* #define for const for non __STDC__ compilers */ #include "config.h" /* #define for const for non __STDC__ compilers */
#include "lint.h" /* for nethack's nhStr() macro */ #include "lint.h" /* for nethack's nhStr() macro */
#include "winX.h" /* to make sure protoypes match corresponding functions */
/* ":" added to both translations below to allow limited redefining of /* ":" added to both translations below to allow limited redefining of
* keysyms before testing for keysym values -- dlc */ * keysyms before testing for keysym values -- dlc */
+25 -12
View File
@@ -91,6 +91,21 @@ static const char popup_entry_translations[] = "#override\n\
<Btn4Down>: scroll(8)\n\ <Btn4Down>: scroll(8)\n\
<Btn5Down>: scroll(2)"; <Btn5Down>: scroll(2)";
static void NDECL(plsel_dialog_acceptvalues);
static void FDECL(plsel_set_play_button, (BOOLEAN_P));
static void FDECL(plsel_set_sensitivities, (BOOLEAN_P));
static void NDECL(X11_player_selection_randomize);
static void NDECL(X11_player_selection_setupOthers);
static void FDECL(racetoggleCallback, (Widget, XtPointer, XtPointer));
static void FDECL(roletoggleCallback, (Widget, XtPointer, XtPointer));
static void FDECL(gendertoggleCallback, (Widget, XtPointer, XtPointer));
static void FDECL(aligntoggleCallback, (Widget, XtPointer, XtPointer));
static void FDECL(plsel_random_btn_callback, (Widget, XtPointer, XtPointer));
static void FDECL(plsel_play_btn_callback, (Widget, XtPointer, XtPointer));
static void FDECL(plsel_quit_btn_callback, (Widget, XtPointer, XtPointer));
static Widget FDECL(X11_create_player_selection_name, (Widget));
static void NDECL(X11_player_selection_dialog);
static void NDECL(X11_player_selection_prompts);
static void FDECL(ps_quit, (Widget, XtPointer, XtPointer)); static void FDECL(ps_quit, (Widget, XtPointer, XtPointer));
static void FDECL(ps_random, (Widget, XtPointer, XtPointer)); static void FDECL(ps_random, (Widget, XtPointer, XtPointer));
static void FDECL(ps_select, (Widget, XtPointer, XtPointer)); static void FDECL(ps_select, (Widget, XtPointer, XtPointer));
@@ -106,9 +121,6 @@ static Widget FDECL(make_menu, (const char *, const char *, const char *,
XtCallbackProc, int, const char **, XtCallbackProc, int, const char **,
Widget **, XtCallbackProc, Widget *)); Widget **, XtCallbackProc, Widget *));
void NDECL(X11_player_selection_setupOthers);
void NDECL(X11_player_selection_randomize);
/* Bad Hack alert. Using integers instead of XtPointers */ /* Bad Hack alert. Using integers instead of XtPointers */
XtPointer XtPointer
i2xtp(i) i2xtp(i)
@@ -348,7 +360,7 @@ Widget plsel_name_input;
Widget plsel_btn_play; Widget plsel_btn_play;
void static void
plsel_dialog_acceptvalues() plsel_dialog_acceptvalues()
{ {
Arg args[2]; Arg args[2];
@@ -431,7 +443,7 @@ Cardinal *num_params;
} }
/* enable or disable the Play button */ /* enable or disable the Play button */
void static void
plsel_set_play_button(state) plsel_set_play_button(state)
boolean state; boolean state;
{ {
@@ -441,7 +453,7 @@ boolean state;
XtSetValues(plsel_btn_play, args, ONE); XtSetValues(plsel_btn_play, args, ONE);
} }
void static void
plsel_set_sensitivities(setcurr) plsel_set_sensitivities(setcurr)
boolean setcurr; boolean setcurr;
{ {
@@ -495,7 +507,7 @@ boolean setcurr;
X11_player_selection_setupOthers(); X11_player_selection_setupOthers();
} }
void static void
X11_player_selection_randomize() X11_player_selection_randomize()
{ {
int nrole = plsel_n_roles; int nrole = plsel_n_roles;
@@ -582,7 +594,7 @@ X11_player_selection_randomize()
plsel_set_sensitivities(FALSE); plsel_set_sensitivities(FALSE);
} }
void static void
X11_player_selection_setupOthers() X11_player_selection_setupOthers()
{ {
Arg args[2]; Arg args[2];
@@ -789,7 +801,7 @@ XtPointer call;
exit_x_event = TRUE; /* leave event loop */ exit_x_event = TRUE; /* leave event loop */
} }
Widget static Widget
X11_create_player_selection_name(form) X11_create_player_selection_name(form)
Widget form; Widget form;
{ {
@@ -852,7 +864,7 @@ Widget form;
return name_vp; return name_vp;
} }
void static void
X11_player_selection_dialog() X11_player_selection_dialog()
{ {
Widget popup, popup_vp; Widget popup, popup_vp;
@@ -1277,8 +1289,7 @@ X11_player_selection_dialog()
} }
} }
/* Global functions ======================================================== */ static void
void
X11_player_selection_prompts() X11_player_selection_prompts()
{ {
int num_roles, num_races, num_gends, num_algns, i, availcount, availindex; int num_roles, num_races, num_gends, num_algns, i, availcount, availindex;
@@ -1564,6 +1575,8 @@ X11_player_selection_prompts()
} }
} }
/* Global functions ======================================================== */
void void
X11_player_selection() X11_player_selection()
{ {