Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2006:
[Freeciv-Dev] (PR#15580) remove long_buffer
Home

[Freeciv-Dev] (PR#15580) remove long_buffer

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#15580) remove long_buffer
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 16 Feb 2006 00:50:23 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=15580 >

This patch removes the long_buffer static array from gui-gtk-2.0.  This 
is now rather trivial.

-jason

Index: client/gui-gtk-2.0/helpdlg.c
===================================================================
--- client/gui-gtk-2.0/helpdlg.c        (revision 11597)
+++ client/gui-gtk-2.0/helpdlg.c        (working copy)
@@ -110,8 +110,7 @@
 #define REQ_NONE _("None")
 #define REQ_NEVER _("(Never)")
 
-/* HACK: we use a static string for convenience. */
-static char long_buffer[64000];
+static const int bufsz = 8192;
 
 
 static void create_help_dialog(void);
@@ -688,7 +687,7 @@
 static void help_update_improvement(const struct help_item *pitem,
                                    char *title, int which)
 {
-  char buf[64000];
+  char buf[bufsz];
   
   create_help_page(HELP_IMPROVEMENT);
   
@@ -732,7 +731,7 @@
 static void help_update_wonder(const struct help_item *pitem,
                               char *title, int which)
 {
-  char buf[64000];
+  char buf[bufsz];
 
   create_help_page(HELP_WONDER);
 
@@ -784,7 +783,7 @@
 static void help_update_unit_type(const struct help_item *pitem,
                                  char *title, struct unit_type *utype)
 {
-  char *buf = &long_buffer[0];
+  char buf[bufsz];
 
   create_help_page(HELP_UNIT);
 
@@ -882,7 +881,7 @@
 {
   int j;
   GtkWidget *w, *hbox;
-  char buf[4096];
+  char buf[bufsz];
 
   create_help_page(HELP_TECH);
 
@@ -1028,7 +1027,7 @@
 static void help_update_terrain(const struct help_item *pitem,
                                char *title, struct terrain *pterrain)
 {
-  char buf[4096];
+  char buf[bufsz];
 
   create_help_page(HELP_TERRAIN);
 
@@ -1123,7 +1122,7 @@
 static void help_update_government(const struct help_item *pitem,
                                   char *title, struct government *gov)
 {
-  char buf[4096];
+  char buf[bufsz];
 
   if (!gov) {
     strcat(buf, pitem->text);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#15580) remove long_buffer, Jason Short <=