Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] Re: (PR#3446) Report at endgame
Home

[Freeciv-Dev] Re: (PR#3446) Report at endgame

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#3446) Report at endgame
From: "andrearo@xxxxxxxxxxxx" <andrearo@xxxxxxxxxxxx>
Date: Fri, 12 Sep 2003 04:05:29 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, 11 Sep 2003, Remi Bonnet wrote:
> >the code assumes that the player id is the rank of the player in the
> >packet. But it is wrong! the packet is not sort by id but by score!
> >Fixed.
> >
> Sorry, i forgot: the same issue happens in others gui

Fixed again.

> In these gui, each player adds a really short string (31 +
> strlen(nation) + strlen(ruler) + strlen(score) ). With
> strlen(nation) = 40; strlen(ruler) = 60 and strlen(score) = 19 (these
> values are *really* high), you have only 150 char by player. So i would
> suggest  150 * MAX_NUM_PLAYERS (actually it is 4500 but keep the
> constant so the code will not break when this define grows).

Ok, I see this now. Set to the value you suggested here.

> >>in the gui-gtk:
> >>row is useless: it is created with stat:
> >>
> >>+  gchar *row[NUM_SCORE_COLS];
> >>+  char stat[NUM_SCORE_COLS][64];
> >>
> >>then points to the same memory:
> >>
> >>+  for (i = 0; i < ARRAY_SIZE(row); i++) {
> >>+    row[i] = stat[i];
> >>+  }
> >>....
> >>So you can replace all row by stat
> >>
> >This is an array of arrays. It's done just like this many other places
> >in repodlgs.c, eg. economy_report_dialog_update().
> >
> This is not the same. in this function row is used to put the four
> arrays in the same array because gtk_clist_append needs a gchar** in his
> second parameter and the buf? are only four *separate* arrays. But in
> your function, stat is already a char** == gchar**.

Take a look at get_meta_list() in connectdlg.c, it does the _exact_ same
thing. I don't see why this should be done differently. If you do, feal
free to add it to the patch.

Andreas Røsdal

Attachment: endgame_report4.diff.gz
Description: endgame_report4.diff.gz


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