Author: cazfi
Date: Sat Jun 11 21:13:53 2016
New Revision: 32834

URL: http://svn.gna.org/viewcvs/freeciv?rev=32834&view=rev
Log:
Added i_am_tool() function. It's just a wrapper around i_am_server(), but makes
API (and callers) more clear about what is going on.

See patch #7232

Modified:
    trunk/common/game.h
    trunk/tools/civmanual.c
    trunk/tools/ruledit/ruledit.cpp
    trunk/tools/ruleup.c

Modified: trunk/common/game.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/game.h?rev=32834&r1=32833&r2=32834&view=diff
==============================================================================
--- trunk/common/game.h (original)
+++ trunk/common/game.h Sat Jun 11 21:13:53 2016
@@ -1,4 +1,4 @@
-/**********************************************************************
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -285,6 +285,10 @@
 bool is_server(void);
 void i_am_server(void);
 void i_am_client(void);
+static inline void i_am_tool(void)
+{
+  i_am_server(); /* No difference between a tool and server at the moment */
+}
 
 void game_init(void);
 void game_map_init(void);

Modified: trunk/tools/civmanual.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/civmanual.c?rev=32834&r1=32833&r2=32834&view=diff
==============================================================================
--- trunk/tools/civmanual.c     (original)
+++ trunk/tools/civmanual.c     Sat Jun 11 21:13:53 2016
@@ -652,9 +652,8 @@
                srvarg.fatal_assertions);
   /* logging available after this point */
 
-  /* Imitate a server - this is needed for as some function only work if this
-   * is set. */
-  i_am_server();
+  /* Get common code to treat us as a tool. */
+  i_am_tool();
 
   /* Initialize game with default values */
   game_init();

Modified: trunk/tools/ruledit/ruledit.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruledit/ruledit.cpp?rev=32834&r1=32833&r2=32834&view=diff
==============================================================================
--- trunk/tools/ruledit/ruledit.cpp     (original)
+++ trunk/tools/ruledit/ruledit.cpp     Sat Jun 11 21:13:53 2016
@@ -1,4 +1,4 @@
-/**********************************************************************
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
 /* ANSI */
 #include <stdlib.h>
 
-#ifdef WIN32_NATIVE
+#ifdef FREECIV_MS_WINDOWS
 #include <windows.h>
 #endif
 
@@ -97,7 +97,7 @@
     game.info.aifill = 0;
 
     game_init();
-    i_am_server();
+    i_am_tool();
 
     if (comments_load()) {
 

Modified: trunk/tools/ruleup.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruleup.c?rev=32834&r1=32833&r2=32834&view=diff
==============================================================================
--- trunk/tools/ruleup.c        (original)
+++ trunk/tools/ruleup.c        Sat Jun 11 21:13:53 2016
@@ -112,7 +112,7 @@
   settings_init(FALSE);
 
   game_init();
-  i_am_server();
+  i_am_tool();
 
   rup_parse_cmdline(argc, argv);
 


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

Reply via email to