Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] (PR#2448) help gui-stub to compile
Home

[Freeciv-Dev] (PR#2448) help gui-stub to compile

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2448) help gui-stub to compile
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Thu, 28 Nov 2002 16:46:21 -0800
Reply-to: rt@xxxxxxxxxxxxxx

This patch provides some fixes for gui-stub so that it almost compiles. 
Compiling gui-stub is helpful in finding mismatched prototyes, missing
functions, wrongly named variables, etc., which can affect newly
develped GUIs.

Some demo code has had #if 0...#endif put around it so that it
compiles.  This is only really of use since compilation is helpful in
finding errors.

The larger issues of improper style and lack of function comments have
not yet been addressed, but can probably be handled en masse later.

There is still a problem in the linking stage; some of the timer
functions end up undefined.  I don't know why this happens, but it is
more likely an automake issue and so not as crucial.

jason


Index: client/gui-stub/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/citydlg.c,v
retrieving revision 1.3
diff -u -r1.3 citydlg.c
--- client/gui-stub/citydlg.c   2002/11/14 09:14:58     1.3
+++ client/gui-stub/citydlg.c   2002/11/29 00:37:48
@@ -36,3 +36,12 @@
 {
        /* PORTME */
 }
+
+/********************************************************************** 
+  Return whether the dialog for the given city is open.
+**********************************************************************/
+bool city_dialog_is_open(struct city *pcity)
+{
+  /* PORTME */
+  return FALSE;
+}
Index: client/gui-stub/connectdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/connectdlg.c,v
retrieving revision 1.5
diff -u -r1.5 connectdlg.c
--- client/gui-stub/connectdlg.c        2002/11/14 09:14:58     1.5
+++ client/gui-stub/connectdlg.c        2002/11/29 00:37:49
@@ -6,8 +6,14 @@
 
 #include <errno.h>
 
+#include "fcintl.h"
 #include "log.h"
+#include "support.h"
 
+#include "chatline_common.h"   /* for append_output_window */
+#include "civclient.h"
+#include "clinet.h"            /* for get_server_address */
+
 #include "connectdlg.h"
 
 static void try_to_autoconnect(void);
@@ -34,14 +40,14 @@
 
   my_snprintf(buf, sizeof(buf),
              _("Auto-connecting to server \"%s\" at port %d as \"%s\""),
-             server_host, server_port, connect_name);
+             server_host, server_port, player_name);
   append_output_window(buf);
   outcome = get_server_address(server_host, server_port, buf, sizeof(buf));
   if (outcome < 0) {
     freelog(LOG_FATAL,
            _("Error contacting server \"%s\" at port %d "
              "as \"%s\":\n %s\n"),
-           server_host, server_port, connect_name, buf);
+           server_host, server_port, player_name, buf);
     exit(EXIT_FAILURE);
   }
   try_to_autoconnect();
@@ -52,8 +58,10 @@
   there yet, arrange for this routine to be called again in about
   AUTOCONNECT_INTERVAL milliseconds.  If anything else goes wrong, log
   a fatal error.
+
+  Return FALSE iff autoconnect succeeds.
 **************************************************************************/
-static int try_to_autoconnect()
+static void try_to_autoconnect(void)
 {
   char errbuf[512];
   static int count = 0;
@@ -66,21 +74,24 @@
     freelog(LOG_FATAL,
            _("Failed to contact server \"%s\" at port "
              "%d as \"%s\" after %d attempts"),
-           server_host, server_port, connect_name, count);
-    gtk_exit(EXIT_FAILURE);
+           server_host, server_port, player_name, count);
+    exit(EXIT_FAILURE);
   }
 
-  switch (try_to_connect(connect_name, errbuf, sizeof(errbuf))) {
+  switch (try_to_connect(player_name, errbuf, sizeof(errbuf))) {
   case 0:                      /* Success! */
     return;
   case ECONNREFUSED:           /* Server not available (yet) - wait & retry */
-     /*PORTME*/ schedule_timer
-       (AUTOCONNECT_INTERVAL, try_to_autoconnect, NULL);
+#if 0
+    /* PORTME */
+    schedule_timer(AUTOCONNECT_INTERVAL, try_to_autoconnect, NULL);
+#endif
+    return;
   default:                     /* All other errors are fatal */
     freelog(LOG_FATAL,
            _("Error contacting server \"%s\" at port %d "
              "as \"%s\":\n %s\n"),
-           server_host, server_port, connect_name, errbuf);
-     /*PORTME*/ exit_application(error code);
+           server_host, server_port, player_name, errbuf);
+    exit(EXIT_FAILURE);
   }
 }
Index: client/gui-stub/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/dialogs.c,v
retrieving revision 1.8
diff -u -r1.8 dialogs.c
--- client/gui-stub/dialogs.c   2002/11/28 19:09:57     1.8
+++ client/gui-stub/dialogs.c   2002/11/29 00:37:49
@@ -37,8 +37,7 @@
        /* PORTME */
 }
 
-void
-races_toggles_set_sensitive(int bits1, int bits2)
+void races_toggles_set_sensitive(struct packet_nations_used *packet)
 {
        /* PORTME */
 }
Index: client/gui-stub/helpdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/helpdlg.c,v
retrieving revision 1.2
diff -u -r1.2 helpdlg.c
--- client/gui-stub/helpdlg.c   2002/11/14 09:14:58     1.2
+++ client/gui-stub/helpdlg.c   2002/11/29 00:37:49
@@ -13,14 +13,12 @@
        /* PORTME */
 }
 
-void
-popup_help_dialog_string(char *item)
+void popup_help_dialog_string(const char *item)
 {
        /* PORTME */
 }
 
-void
-popup_help_dialog_typed(char *item, enum help_page_type htype)
+void popup_help_dialog_typed(const char *item, enum help_page_type htype)
 {
        /* PORTME */
 }
Index: client/gui-stub/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/mapview.c,v
retrieving revision 1.19
diff -u -r1.19 mapview.c
--- client/gui-stub/mapview.c   2002/11/24 11:43:40     1.19
+++ client/gui-stub/mapview.c   2002/11/29 00:37:49
@@ -6,6 +6,10 @@
 
 #include "mapview.h"
 
+/* Mapview dimensions. */
+int map_view_x0, map_view_y0;
+int canvas_width, canvas_height;
+
 /***********************************************************************
   This function can be used by mapview_common code to determine the
   location and dimensions of the mapview canvas.
Index: client/gui-stub/messagewin.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/messagewin.c,v
retrieving revision 1.3
diff -u -r1.3 messagewin.c
--- client/gui-stub/messagewin.c        2002/11/14 09:14:58     1.3
+++ client/gui-stub/messagewin.c        2002/11/29 00:37:49
@@ -16,22 +16,11 @@
 bool is_meswin_open(void)
 {
        /* PORTME */
+  return FALSE;
 }
 
 void
 real_update_meswin_dialog(void)
-{
-       /* PORTME */
-}
-
-void
-real_clear_notify_window(void)
-{
-       /* PORTME */
-}
-
-void
-real_add_notify_window(struct packet_generic_message *packet)
 {
        /* PORTME */
 }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#2448) help gui-stub to compile, Jason Short via RT <=