Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: (PR#8664) gettext and const char *'s
Home

[Freeciv-Dev] Re: (PR#8664) gettext and const char *'s

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8664) gettext and const char *'s
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 May 2004 01:24:12 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8664 >

Jason Short wrote:

> We should probably treat every gettext-returned string as a const char * 
>   rather than a char *.  (This may or may not relate to PR#8661.)

This patch makes the necessary changes for gui-xaw.

There is one problem case which I ignored.

jason

? eff
Index: client/gui-xaw/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/dialogs.c,v
retrieving revision 1.95
diff -u -r1.95 dialogs.c
--- client/gui-xaw/dialogs.c    8 May 2004 00:00:23 -0000       1.95
+++ client/gui-xaw/dialogs.c    11 May 2004 18:52:10 -0000
@@ -1114,9 +1114,9 @@
     if((ptunit=unit_list_get(&map_get_tile(dest_x, dest_y)->units, 0))){
       /* Spy/Diplomat acting against a unit */
       
-      char *message = (!unit_flag(punit, F_SPY))?
-       _("Sir, the diplomat is waiting for your command"):
-       _("Sir, the spy is waiting for your command");
+      const char *message = !unit_flag(punit, F_SPY)
+       ? _("Sir, the diplomat is waiting for your command")
+       : _("Sir, the spy is waiting for your command");
       
       diplomat_target_id=ptunit->id;
 
Index: client/gui-xaw/inputdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/inputdlg.c,v
retrieving revision 1.10
diff -u -r1.10 inputdlg.c
--- client/gui-xaw/inputdlg.c   14 Nov 2002 09:15:00 -0000      1.10
+++ client/gui-xaw/inputdlg.c   11 May 2004 18:52:10 -0000
@@ -69,8 +69,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-Widget input_dialog_create(Widget parent, char *dialogname, 
-                          char *text, char *postinputtest,
+Widget input_dialog_create(Widget parent, const char *dialogname, 
+                          const char *text, const char *postinputtest,
                           XtCallbackProc ok_callback,
                           XtPointer ok_cli_data, 
                           XtCallbackProc cancel_callback,
Index: client/gui-xaw/inputdlg.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/inputdlg.h,v
retrieving revision 1.5
diff -u -r1.5 inputdlg.h
--- client/gui-xaw/inputdlg.h   25 Sep 2000 01:29:28 -0000      1.5
+++ client/gui-xaw/inputdlg.h   11 May 2004 18:52:10 -0000
@@ -17,8 +17,8 @@
 #include <X11/StringDefs.h>
 
 
-Widget input_dialog_create(Widget parent, char *dialogname, 
-                          char *text, char *postinputtest,
+Widget input_dialog_create(Widget parent, const char *dialogname, 
+                          const char *text, const char *postinputtest,
                           XtCallbackProc ok_callback,
                           XtPointer ok_cli_data, 
                           XtCallbackProc cancel_callback,
Index: client/gui-xaw/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/menu.c,v
retrieving revision 1.61
diff -u -r1.61 menu.c
--- client/gui-xaw/menu.c       16 Apr 2004 17:24:54 -0000      1.61
+++ client/gui-xaw/menu.c       11 May 2004 18:52:11 -0000
@@ -858,7 +858,7 @@
 {
   int i, j;
   struct Menu *mymenu;
-  char *xlt;
+  const char *xlt;
   int lstr;
   int litem;
   int lacel;
@@ -961,7 +961,7 @@
   struct Menu *pmenu = menus[menu];
   static char retbuf[256];
   char tmp[256];
-  char *xlt;
+  const char *xlt;
 
   xlt=_(pmenu->entries[ent].text[var]);
 
Index: client/gui-xaw/repodlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/repodlgs.c,v
retrieving revision 1.59
diff -u -r1.59 repodlgs.c
--- client/gui-xaw/repodlgs.c   23 Apr 2004 22:58:06 -0000      1.59
+++ client/gui-xaw/repodlgs.c   11 May 2004 18:52:11 -0000
@@ -127,7 +127,7 @@
 /****************************************************************
 ...
 ****************************************************************/
-const char *get_centered_report_title(char *report_name)
+const char *get_centered_report_title(const char *report_name)
 {
   return create_centered_string(get_report_title(report_name));
 }
Index: client/gui-xaw/repodlgs.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/repodlgs.h,v
retrieving revision 1.10
diff -u -r1.10 repodlgs.h
--- client/gui-xaw/repodlgs.h   23 Apr 2004 22:58:06 -0000      1.10
+++ client/gui-xaw/repodlgs.h   11 May 2004 18:52:11 -0000
@@ -24,6 +24,6 @@
 void activeunits_msg_close(Widget w);
 void sciencereport_msg_close(Widget w);
 void economyreport_msg_close(Widget w);
-const char *get_centered_report_title(char *report_name);
+const char *get_centered_report_title(const char *report_name);
 
 #endif  /* FC__REPODLGS_H */

[Prev in Thread] Current Thread [Next in Thread]