Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2005:
[Freeciv-Dev] (PR#13875) gui-gtk-2 repodlgs cmp_func broken
Home

[Freeciv-Dev] (PR#13875) gui-gtk-2 repodlgs cmp_func broken

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#13875) gui-gtk-2 repodlgs cmp_func broken
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Sun, 2 Oct 2005 17:09:23 -0700
Reply-to: bugs@xxxxxxxxxxx

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

> [jdorje - Mon Sep 05 19:44:33 2005]:
> 
> The cmp_func function in gui-gtk-2 in repodlgs.c is broken.  It doesn't 
> handle future techs properly.  Future techs are handled by get_tech_name 
> so it should be sufficient just to drop the special case.

Here is a patch.



Index: client/gui-gtk-2.0/repodlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/repodlgs.c,v
retrieving revision 1.97
diff -u -r1.97 repodlgs.c
--- client/gui-gtk-2.0/repodlgs.c       16 Aug 2005 06:54:53 -0000      1.97
+++ client/gui-gtk-2.0/repodlgs.c       3 Oct 2005 00:08:31 -0000
@@ -397,26 +397,10 @@
 static gint cmp_func(gconstpointer a_p, gconstpointer b_p)
 {
   const gchar *a_str, *b_str;
-  gchar text_a[512], text_b[512];
   gint a = GPOINTER_TO_INT(a_p), b = GPOINTER_TO_INT(b_p);
 
-  /* FIXME: future techs aren't counted this way but are handled by
-   * get_tech_name() when given a player parameter. */
-  if (!is_future_tech(a)) {
-    a_str = get_tech_name(game.player_ptr, a);
-  } else {
-    my_snprintf(text_a,sizeof(text_a), _("Future Tech. %d"),
-               a - game.control.num_tech_types);
-    a_str=text_a;
-  }
-
-  if(!is_future_tech(b)) {
-    b_str = get_tech_name(game.player_ptr, b);
-  } else {
-    my_snprintf(text_b,sizeof(text_b), _("Future Tech. %d"),
-               b - game.control.num_tech_types);
-    b_str=text_b;
-  }
+  a_str = get_tech_name(game.player_ptr, a);
+  b_str = get_tech_name(game.player_ptr, b);
 
   return strcmp(a_str,b_str);
 }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13875) gui-gtk-2 repodlgs cmp_func broken, Vasco Alexandre da Silva Costa <=