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

[Freeciv-Dev] (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] (PR#8664) gettext and const char *'s
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 6 May 2004 15:18:34 -0700
Reply-to: rt@xxxxxxxxxxx

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

> [jdorje - Tue May 04 04:56:57 2004]:
> 
> 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.)

And here's a patch for client/ (but not the GUI subdirs).

jason

Index: client/helpdata.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/helpdata.c,v
retrieving revision 1.69
diff -u -r1.69 helpdata.c
--- client/helpdata.c   5 May 2004 20:39:15 -0000       1.69
+++ client/helpdata.c   6 May 2004 22:18:03 -0000
@@ -741,7 +741,7 @@
     }
 
     for (j = 0; j < num_allowed_units; j++) {
-      char *deli_str = NULL;
+      const char *deli_str = NULL;
 
       /* there should be something like astr_append() */
       astr_minsize(&astr, astr.n + strlen(allowed_units[j]));
Index: client/gui-gtk/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/dialogs.c,v
retrieving revision 1.139
diff -u -r1.139 dialogs.c
--- client/gui-gtk/dialogs.c    8 Apr 2004 18:19:08 -0000       1.139
+++ client/gui-gtk/dialogs.c    6 May 2004 22:18:03 -0000
@@ -259,7 +259,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-void popup_notify_dialog(char *caption, char *headline, char *lines)
+void popup_notify_dialog(const char *caption, const char *headline,
+                        const char *lines)
 {
   if (!notify_dialog_shell) {
     create_notify_dialog();
@@ -366,7 +367,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-void popup_notify_goto_dialog(char *headline, char *lines,int x, int y)
+void popup_notify_goto_dialog(const char *headline, const char *lines,
+                             int x, int y)
 {
   GtkWidget *notify_dialog_shell, *notify_command, *notify_goto_command;
   GtkWidget *notify_label;
Index: client/gui-gtk-2.0/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/dialogs.c,v
retrieving revision 1.64
diff -u -r1.64 dialogs.c
--- client/gui-gtk-2.0/dialogs.c        1 May 2004 18:01:10 -0000       1.64
+++ client/gui-gtk-2.0/dialogs.c        6 May 2004 22:18:03 -0000
@@ -127,7 +127,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-void popup_notify_dialog(char *caption, char *headline, char *lines)
+void popup_notify_dialog(const char *caption, const char *headline,
+                        const char *lines)
 {
   GtkWidget *shell, *label, *headline_label, *sw;
 
@@ -207,7 +208,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-void popup_notify_goto_dialog(char *headline, char *lines, int x, int y)
+void popup_notify_goto_dialog(const char *headline, const char *lines,
+                             int x, int y)
 {
   GtkWidget *shell, *label, *goto_command, *popcity_command;
   
Index: client/gui-mui/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/dialogs.c,v
retrieving revision 1.54
diff -u -r1.54 dialogs.c
--- client/gui-mui/dialogs.c    8 Feb 2004 21:56:51 -0000       1.54
+++ client/gui-mui/dialogs.c    6 May 2004 22:18:04 -0000
@@ -108,7 +108,8 @@
 /****************************************************************
  Popup the notify window
 *****************************************************************/
-void popup_notify_dialog(char *caption, char *headline, char *lines)
+void popup_notify_dialog(const char *caption, const char *headline,
+                        const char *lines)
 {
   Object *wnd;
   Object *listview;
@@ -165,7 +166,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-void popup_notify_goto_dialog(char *headline, char *lines,int x, int y)
+void popup_notify_goto_dialog(const char *headline, const char *lines,
+                             int x, int y)
 {
   Object *wnd;
   Object *close_button;
Index: client/gui-sdl/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/dialogs.c,v
retrieving revision 1.44
diff -u -r1.44 dialogs.c
--- client/gui-sdl/dialogs.c    8 Feb 2004 21:56:51 -0000       1.44
+++ client/gui-sdl/dialogs.c    6 May 2004 22:18:04 -0000
@@ -216,7 +216,8 @@
   specific location.  The user should be given the option to goto that
   location.
 **************************************************************************/
-void popup_notify_goto_dialog(char *headline, char *lines, int x, int y)
+void popup_notify_goto_dialog(const char *headline, const char *lines,
+                             int x, int y)
 {
   freelog(LOG_NORMAL, "popup_notify_goto_dialog : PORT ME\n \
                        a: %s\nb: %s",headline, lines );
@@ -252,7 +253,8 @@
 /**************************************************************************
   Popup a generic dialog to display some generic information.
 **************************************************************************/
-void popup_notify_dialog(char *caption, char *headline, char *lines)
+void popup_notify_dialog(const char *caption, const char *headline,
+                        const char *lines)
 {
   struct GUI *pBuf, *pWindow;
   SDL_String16 *pStr;
Index: client/gui-stub/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/dialogs.c,v
retrieving revision 1.11
diff -u -r1.11 dialogs.c
--- client/gui-stub/dialogs.c   23 Feb 2004 20:03:56 -0000      1.11
+++ client/gui-stub/dialogs.c   6 May 2004 22:18:04 -0000
@@ -25,7 +25,7 @@
   specific location.  The user should be given the option to goto that
   location.
 **************************************************************************/
-void popup_notify_goto_dialog(char *headline, char *lines,
+void popup_notify_goto_dialog(const char *headline, const char *lines,
                              int map_x, int map_y)
 {
   /* PORTME */
@@ -34,7 +34,8 @@
 /**************************************************************************
   Popup a generic dialog to display some generic information.
 **************************************************************************/
-void popup_notify_dialog(char *caption, char *headline, char *lines)
+void popup_notify_dialog(const char *caption, const char *headline,
+                        const char *lines)
 {
   /* PORTME */
 }
Index: client/gui-win32/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/dialogs.c,v
retrieving revision 1.44
diff -u -r1.44 dialogs.c
--- client/gui-win32/dialogs.c  31 Mar 2004 15:09:10 -0000      1.44
+++ client/gui-win32/dialogs.c  6 May 2004 22:18:05 -0000
@@ -164,8 +164,8 @@
 /**************************************************************************
 
 **************************************************************************/
-void
-popup_notify_goto_dialog(char *headline, char *lines, int x, int y)
+void popup_notify_goto_dialog(const char *headline, const char *lines,
+                             int x, int y)
 {
   POINT *pt;
   struct fcwin_box *hbox;
@@ -226,8 +226,8 @@
 /**************************************************************************
 
 **************************************************************************/
-void
-popup_notify_dialog(char *caption, char *headline, char *lines)
+void popup_notify_dialog(const char *caption, const char *headline,
+                        const char *lines)
 {
   HWND dlg;
   dlg=fcwin_create_layouted_window(notify_proc,caption,WS_OVERLAPPEDWINDOW,
Index: client/gui-xaw/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/dialogs.c,v
retrieving revision 1.94
diff -u -r1.94 dialogs.c
--- client/gui-xaw/dialogs.c    8 Apr 2004 18:19:09 -0000       1.94
+++ client/gui-xaw/dialogs.c    6 May 2004 22:18:05 -0000
@@ -208,7 +208,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-void popup_notify_dialog(char *caption, char *headline, char *lines)
+void popup_notify_dialog(const char *caption, const char *headline,
+                        const char *lines)
 {
   Widget notify_form, notify_command;
   Widget notify_headline, notify_label;
@@ -342,7 +343,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-void popup_notify_goto_dialog(char *headline, char *lines,int x, int y)
+void popup_notify_goto_dialog(const char *headline, const char *lines,
+                             int x, int y)
 {
   Widget notify_dialog_shell, notify_form, notify_command, notify_goto_command;
   Widget notify_headline, notify_label;
Index: client/include/dialogs_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/dialogs_g.h,v
retrieving revision 1.15
diff -u -r1.15 dialogs_g.h
--- client/include/dialogs_g.h  2 Feb 2004 07:23:45 -0000       1.15
+++ client/include/dialogs_g.h  6 May 2004 22:18:05 -0000
@@ -23,8 +23,10 @@
 struct tile;
 struct unit;
 
-void popup_notify_goto_dialog(char *headline, char *lines, int x, int y);
-void popup_notify_dialog(char *caption, char *headline, char *lines);
+void popup_notify_goto_dialog(const char *headline, const char *lines,
+                             int map_x, int map_y);
+void popup_notify_dialog(const char *caption, const char *headline,
+                        const char *lines);
 
 void popup_races_dialog(void);
 void popdown_races_dialog(void);

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