]> granicus.if.org Git - nethack/commitdiff
X11 missing prototypes
authorPatR <rankin@nethack.org>
Fri, 24 Apr 2020 09:40:22 +0000 (02:40 -0700)
committerPatR <rankin@nethack.org>
Fri, 24 Apr 2020 09:40:22 +0000 (02:40 -0700)
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.

include/winX.h
sys/unix/Makefile.src
win/X11/Window.c
win/X11/dialogs.c
win/X11/winmisc.c

index fe7f63b56ff27a6e09580946db0631d803522ef3..60c4e8d587528c9706bc9db6166c35a59e6ba30d 100644 (file)
@@ -9,6 +9,13 @@
 #ifndef WINX_H
 #define WINX_H
 
+#ifndef COLOR_H
+#include "color.h"      /* CLR_MAX */
+#endif
+#ifndef WINTYPE_H
+#include "wintype.h"    /* winid */
+#endif
+
 #ifndef E
 #define E extern
 #endif
@@ -300,9 +307,12 @@ extern struct window_procs X11_procs;
                   window, __FILE__, __LINE__);                  \
     } while (0)
 
+/* ### Window.c ### */
+E Font FDECL(WindowFont, (Widget));
+E XFontStruct *FDECL(WindowFontStruct, (Widget));
+
 /* ### dialogs.c ### */
-E Widget
-FDECL(CreateDialog, (Widget, String, XtCallbackProc, XtCallbackProc));
+E Widget FDECL(CreateDialog, (Widget, String, XtCallbackProc, XtCallbackProc));
 E void FDECL(SetDialogPrompt, (Widget, String));
 E String FDECL(GetDialogResponse, (Widget));
 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(load_boldfont, (struct xwindow *, Widget));
 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 char *FDECL(fontname_boldify, (const char *));
 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 *));
 
 /* ### winmisc.c ### */
+E XtPointer FDECL(i2xtp, (int));
+E int FDECL(xtp2i, (XtPointer));
 E void FDECL(ps_key, (Widget, XEvent *, String *,
                       Cardinal *)); /* player selection action */
 E void FDECL(race_key, (Widget, XEvent *, String *,
index 3620043d098b89faaf13aa3539dac98570b6817a..94402728848515dbc48aed6a9a1b4e0c0e4f6875 100644 (file)
@@ -817,9 +817,11 @@ cursinvt.o: ../win/curses/cursinvt.c $(HACK_H) ../include/wincurs.h \
                ../win/curses/cursinvt.h
        $(CC) $(CFLAGS) -c -o $@ ../win/curses/cursinvt.c
 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
-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
 winX.o: ../win/X11/winX.c $(HACK_H) ../include/winX.h ../include/dlb.h \
                ../include/xwindow.h ../win/X11/nh72icon ../win/X11/nh56icon \
index 09c753f33103cb3e4db1e3c0bbfdd732fe471aa8..37e5ef0d65f119617ec4fcd5860140778e8a405e 100644 (file)
@@ -31,8 +31,9 @@
 
 #include "xwindowp.h"
 
-#include "config.h"
-#include "lint.h"
+#include "config.h" /* #define for const for non __STDC__ compilers */
+#include "lint.h"   /* for nethack's nhStr() macro */
+#include "winX.h"   /* to make sure protoypes match corresponding functions */
 
 static XtResource resources[] = {
 #define offset(field) XtOffset(WindowWidget, window.field)
index 988f6edbbddbb2930797487357fbefcb83f66894..607b8f5c27b009274040292914b252e566a7637b 100644 (file)
@@ -79,6 +79,7 @@
 
 #include "config.h" /* #define for const for non __STDC__ compilers */
 #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
  * keysyms before testing for keysym values -- dlc */
index c1c32ca8e1d8df1e932bddbd2692414de7216e5d..2f2c7684c713a406afcc46c268656efd51d091ff 100644 (file)
@@ -91,6 +91,21 @@ static const char popup_entry_translations[] = "#override\n\
      <Btn4Down>: scroll(8)\n\
      <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_random, (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 **,
                                 Widget **, XtCallbackProc, Widget *));
 
-void NDECL(X11_player_selection_setupOthers);
-void NDECL(X11_player_selection_randomize);
-
 /* Bad Hack alert. Using integers instead of XtPointers */
 XtPointer
 i2xtp(i)
@@ -348,7 +360,7 @@ Widget plsel_name_input;
 
 Widget plsel_btn_play;
 
-void
+static void
 plsel_dialog_acceptvalues()
 {
     Arg args[2];
@@ -431,7 +443,7 @@ Cardinal *num_params;
 }
 
 /* enable or disable the Play button */
-void
+static void
 plsel_set_play_button(state)
 boolean state;
 {
@@ -441,7 +453,7 @@ boolean state;
     XtSetValues(plsel_btn_play, args, ONE);
 }
 
-void
+static void
 plsel_set_sensitivities(setcurr)
 boolean setcurr;
 {
@@ -495,7 +507,7 @@ boolean setcurr;
     X11_player_selection_setupOthers();
 }
 
-void
+static void
 X11_player_selection_randomize()
 {
     int nrole = plsel_n_roles;
@@ -582,7 +594,7 @@ X11_player_selection_randomize()
     plsel_set_sensitivities(FALSE);
 }
 
-void
+static void
 X11_player_selection_setupOthers()
 {
     Arg args[2];
@@ -789,7 +801,7 @@ XtPointer call;
     exit_x_event = TRUE; /* leave event loop */
 }
 
-Widget
+static Widget
 X11_create_player_selection_name(form)
 Widget form;
 {
@@ -852,7 +864,7 @@ Widget form;
     return name_vp;
 }
 
-void
+static void
 X11_player_selection_dialog()
 {
     Widget popup, popup_vp;
@@ -1277,8 +1289,7 @@ X11_player_selection_dialog()
     }
 }
 
-/* Global functions ======================================================== */
-void
+static void
 X11_player_selection_prompts()
 {
     int num_roles, num_races, num_gends, num_algns, i, availcount, availindex;
@@ -1564,6 +1575,8 @@ X11_player_selection_prompts()
     }
 }
 
+/* Global functions ======================================================== */
+
 void
 X11_player_selection()
 {