Author: cazfi
Date: Tue Nov 18 20:27:32 2014
New Revision: 27080

URL: http://svn.gna.org/viewcvs/freeciv?rev=27080&view=rev
Log:
Removed unused 'arg0' parameter for print_usage() in all guis.

See patch #5428

Modified:
    trunk/client/gui-gtk-2.0/gui_main.c
    trunk/client/gui-gtk-3.0/gui_main.c
    trunk/client/gui-sdl/gui_main.c
    trunk/client/gui-sdl2/gui_main.c
    trunk/client/gui-xaw/gui_main.c

Modified: trunk/client/gui-gtk-2.0/gui_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-2.0/gui_main.c?rev=27080&r1=27079&r2=27080&view=diff
==============================================================================
--- trunk/client/gui-gtk-2.0/gui_main.c (original)
+++ trunk/client/gui-gtk-2.0/gui_main.c Tue Nov 18 20:27:32 2014
@@ -202,7 +202,7 @@
 static void set_wait_for_writable_socket(struct connection *pc,
                                          bool socket_writable);
 
-static void print_usage(const char *argv0);
+static void print_usage(void);
 static void parse_options(int argc, char **argv);
 static gboolean toplevel_key_press_handler(GtkWidget *w, GdkEventKey *ev, 
gpointer data);
 static gboolean toplevel_key_release_handler(GtkWidget *w, GdkEventKey *ev, 
gpointer data);
@@ -270,7 +270,7 @@
   Print extra usage information, including one line help on each option,
   to stderr. 
 **************************************************************************/
-static void print_usage(const char *argv0)
+static void print_usage(void)
 {
   /* add client-specific usage information here */
   fc_fprintf(stderr,
@@ -282,8 +282,8 @@
 }
 
 /**************************************************************************
- search for command line options. right now, it's just help
- semi-useless until we have options that aren't the same across all clients.
+  Search for command line options. right now, it's just help
+  semi-useless until we have options that aren't the same across all clients.
 **************************************************************************/
 static void parse_options(int argc, char **argv)
 {
@@ -291,7 +291,7 @@
 
   while (i < argc) {
     if (is_option("--help", argv[i])) {
-      print_usage(argv[0]);
+      print_usage();
       exit(EXIT_SUCCESS);
     }
     i++;

Modified: trunk/client/gui-gtk-3.0/gui_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/gui_main.c?rev=27080&r1=27079&r2=27080&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/gui_main.c (original)
+++ trunk/client/gui-gtk-3.0/gui_main.c Tue Nov 18 20:27:32 2014
@@ -187,7 +187,7 @@
 static void set_wait_for_writable_socket(struct connection *pc,
                                          bool socket_writable);
 
-static void print_usage(const char *argv0);
+static void print_usage(void);
 static void parse_options(int argc, char **argv);
 static gboolean toplevel_key_press_handler(GtkWidget *w, GdkEventKey *ev, 
gpointer data);
 static gboolean toplevel_key_release_handler(GtkWidget *w, GdkEventKey *ev, 
gpointer data);
@@ -255,7 +255,7 @@
   Print extra usage information, including one line help on each option,
   to stderr. 
 **************************************************************************/
-static void print_usage(const char *argv0)
+static void print_usage(void)
 {
   /* add client-specific usage information here */
   fc_fprintf(stderr,
@@ -267,8 +267,8 @@
 }
 
 /**************************************************************************
- search for command line options. right now, it's just help
- semi-useless until we have options that aren't the same across all clients.
+  Search for command line options. right now, it's just help
+  semi-useless until we have options that aren't the same across all clients.
 **************************************************************************/
 static void parse_options(int argc, char **argv)
 {
@@ -276,7 +276,7 @@
 
   while (i < argc) {
     if (is_option("--help", argv[i])) {
-      print_usage(argv[0]);
+      print_usage();
       exit(EXIT_SUCCESS);
     }
     i++;

Modified: trunk/client/gui-sdl/gui_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl/gui_main.c?rev=27080&r1=27079&r2=27080&view=diff
==============================================================================
--- trunk/client/gui-sdl/gui_main.c     (original)
+++ trunk/client/gui-sdl/gui_main.c     Tue Nov 18 20:27:32 2014
@@ -118,7 +118,7 @@
 static SDL_Event *pInfo_User_Event = NULL;
 static SDL_Event *pMap_Scroll_User_Event = NULL;
 
-static void print_usage(const char *argv0);
+static void print_usage(void);
 static void parse_options(int argc, char **argv);
 static int check_scroll_area(int x, int y);
       
@@ -161,7 +161,7 @@
   Print extra usage information, including one line help on each option,
   to stderr. 
 **************************************************************************/
-static void print_usage(const char *argv0)
+static void print_usage(void)
 {
   /* add client-specific usage information here */
   fc_fprintf(stderr,
@@ -175,8 +175,8 @@
 }
 
 /**************************************************************************
- search for command line options. right now, it's just help
- semi-useless until we have options that aren't the same across all clients.
+  Search for command line options. right now, it's just help
+  semi-useless until we have options that aren't the same across all clients.
 **************************************************************************/
 static void parse_options(int argc, char **argv)
 {
@@ -185,7 +185,7 @@
     
   while (i < argc) {
     if (is_option("--help", argv[i])) {
-      print_usage(argv[0]);
+      print_usage();
       exit(EXIT_SUCCESS);
     } else if (is_option("--fullscreen",argv[i])) {
       options.gui_sdl_fullscreen = TRUE;

Modified: trunk/client/gui-sdl2/gui_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl2/gui_main.c?rev=27080&r1=27079&r2=27080&view=diff
==============================================================================
--- trunk/client/gui-sdl2/gui_main.c    (original)
+++ trunk/client/gui-sdl2/gui_main.c    Tue Nov 18 20:27:32 2014
@@ -118,7 +118,7 @@
 static SDL_Event *pInfo_User_Event = NULL;
 static SDL_Event *pMap_Scroll_User_Event = NULL;
 
-static void print_usage(const char *argv0);
+static void print_usage(void);
 static void parse_options(int argc, char **argv);
 static int check_scroll_area(int x, int y);
       
@@ -161,7 +161,7 @@
   Print extra usage information, including one line help on each option,
   to stderr. 
 **************************************************************************/
-static void print_usage(const char *argv0)
+static void print_usage(void)
 {
   /* add client-specific usage information here */
   fc_fprintf(stderr,
@@ -175,31 +175,31 @@
 }
 
 /**************************************************************************
- search for command line options. right now, it's just help
- semi-useless until we have options that aren't the same across all clients.
+  Search for command line options. right now, it's just help
+  semi-useless until we have options that aren't the same across all clients.
 **************************************************************************/
 static void parse_options(int argc, char **argv)
 {
   int i = 1;
   char *option = NULL;
-    
+
   while (i < argc) {
     if (is_option("--help", argv[i])) {
-      print_usage(argv[0]);
+      print_usage();
       exit(EXIT_SUCCESS);
     } else if (is_option("--fullscreen",argv[i])) {
       options.gui_sdl2_fullscreen = TRUE;
 #if 0
     } else if (is_option("--eventthread",argv[i])) {
-      /* init events in other thread ( only linux and BeOS ) */  
+      /* init events in other thread ( only linux and BeOS ) */
       SDL_InitSubSystem(SDL_INIT_EVENTTHREAD);
 #endif
     } else if ((option = get_option_malloc("--theme", argv, &i, argc))) {
       sz_strlcpy(options.gui_sdl2_default_theme_name, option);
     }
+
     i++;
   }
-  
 }
 
 /**************************************************************************

Modified: trunk/client/gui-xaw/gui_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-xaw/gui_main.c?rev=27080&r1=27079&r2=27080&view=diff
==============================================================================
--- trunk/client/gui-xaw/gui_main.c     (original)
+++ trunk/client/gui-xaw/gui_main.c     Tue Nov 18 20:27:32 2014
@@ -246,7 +246,7 @@
   Print extra usage information, including one line help on each option,
   to stderr.
 **************************************************************************/
-static void print_usage(const char *argv0)
+static void print_usage(void)
 {
   /* add client-specific usage information here */
   fc_fprintf(stderr,
@@ -259,18 +259,16 @@
 }
 
 /**************************************************************************
-...
+  Handle commandline options specific to this gui
 **************************************************************************/
 static void parse_options(int argc, char **argv)
 {
   int i;
 
   i = 1;
-  while (i < argc)
-  {
-    if (is_option("--help", argv[i]))
-    {
-      print_usage(argv[0]);
+  while (i < argc) {
+    if (is_option("--help", argv[i])) {
+      print_usage();
       exit(EXIT_SUCCESS);
     }
     i += 1;


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to