Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: (PR#8720) Dynamtext
Home

[Freeciv-Dev] Re: (PR#8720) Dynamtext

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8720) Dynamtext
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Wed, 12 May 2004 11:01:05 -0700
Reply-to: rt@xxxxxxxxxxx

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

On Wed, May 12, 2004 at 10:23:51AM -0700, Jason Short wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8720 >
> 
> Raimar Falke wrote:
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=8720 >
> > 
> > 
> > The attached patch extracts the basic functions from client/text.c and
> > moves them to utility/support.c. There are renamed to dynam(ic)text.
> > 
> > While the reason for client/text.c was mainly concentrating the
> > functions in one place the main reason for this patch is that you
> > don't have to guess anylonger how much buffer you need to specify.
> > 
> > The patch also adds a string_join function, removes some redundancy
> > and adds some consts.
> 
> We should be using an astring here.

For what? Dynamstring? For the string_join function?

astring is a thing wrapper around realloc. I only see that with
astring the following code can be removed:

  if (new_len > *buffer_size) {
    size_t new_size = MAX(new_len, *buffer_size * 2);
    *buffer_size = new_size;
    *buffer = fc_realloc(*buffer, *buffer_size);
  }

Or is there something I'm missing here?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  reality.sys corrupt. Reboot Universe? (y,n,q)




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