[Freeciv-Dev] (PR#39677) freeciv crashes while updating unit

2007-10-19 Thread Christian Prochaska

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39677 

 [EMAIL PROTECTED] - Fr 19. Okt 2007, 19:59:56]:
 
 Thanks a lot. Will these make it into SVN soon? If so, I can wait for
 that.
 

Yes, they are both in SVN now.


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39677) freeciv crashes while updating unit

2007-10-19 Thread [EMAIL PROTECTED]

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39677 

I just tried it... It worked well. Thanks for fixing it.

On Fri, 2007-10-19 at 13:05 -0700, Christian Prochaska wrote:

 URL: http://bugs.freeciv.org/Ticket/Display.html?id=39677 
 
  [EMAIL PROTECTED] - Fr 19. Okt 2007, 19:59:56]:
  
  Thanks a lot. Will these make it into SVN soon? If so, I can wait for
  that.
  
 
 Yes, they are both in SVN now.
 


David Walling





I just tried it... It worked well. Thanks for fixing it.

On Fri, 2007-10-19 at 13:05 -0700, Christian Prochaska wrote:


URL: http://bugs.freeciv.org/Ticket/Display.html?id=39677 

 [[EMAIL PROTECTED] - Fr 19. Okt 2007, 19:59:56]:
 
 Thanks a lot. Will these make it into SVN soon? If so, I can wait for
 that.
 

Yes, they are both in SVN now.







David Walling





___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39677) freeciv crashes while updating unit

2007-10-19 Thread Christian Prochaska

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39677 

 [cproc - Fr 19. Okt 2007, 12:20:26]:
 
  [EMAIL PROTECTED] - Do 06. Sep 2007, 21:08:48]:
  
  I am running Freeciv version 2.1.0-beta6 (beta version) gui-sdl
  
  I got the following error when trying to upgrade a unit:
  
   civclient 
  2: Using Video Output: x11
  2: 480, 27, 0
  2: area.h = 410
  2: 768, 27, 0
  2: area.h = 614
  2: 768, 27, 0
  2: area.h = 614
  2: 768, 27, 0
  2: area.h = 614
  2: 768, 27, 0
  2: area.h = 614
  civclient: repodlgs.c:171: popup_upgrade_unit_callback: Assertion
  `(ut1) != ((void *)0)  (utype_by_number((ut1)-index) == (ut1))'
  failed.
  Aborted
  
  The game died :(
  
 
 The attached patch fixes the failed assertion in S2_1 (already fixed in
 S2_2/trunk) and removes the forgotten debug output. The segmentation
 fault still remains at the moment.
 
 

And here's the crash fix.

Index: client/gui-sdl/repodlgs.c
===
--- client/gui-sdl/repodlgs.c	(revision 13801)
+++ client/gui-sdl/repodlgs.c	(working copy)
@@ -457,7 +457,7 @@
   upgrade = (can_upgrade_unittype(game.player_ptr, i) != NULL);
   pUnit = i;
 	
-  /* --- */
+  /* unit type icon */
   pBuf = create_iconlabel(adj_surf(get_unittype_surface(i)), pWindow-dst, NULL,
 			WF_RESTORE_BACKGROUND | WF_FREE_THEME);
   if(count  adj_size(72)) {
@@ -466,7 +466,7 @@
   hh = pBuf-size.h;
   add_to_gui_list(MAX_ID - utype_number(i), pBuf);
   
-  /* --- */
+  /* unit type name */
   pStr = create_str16_from_char(utype_name_translation(i), adj_font(12));
   pStr-style |= (TTF_STYLE_BOLD|SF_CENTER);
   pBuf = create_iconlabel(NULL, pWindow-dst, pStr,
@@ -486,7 +486,7 @@
   name_w = MAX(pBuf-size.w, name_w);
   add_to_gui_list(MAX_ID - utype_number(i), pBuf);
   
-  /* --- */	
+  /* active */	
   my_snprintf(cBuf, sizeof(cBuf), %d, units[utype_index(i)].active_count);
   pStr = create_str16_from_char(cBuf, adj_font(10));
   pStr-style |= SF_CENTER;
@@ -499,7 +499,7 @@
   pBuf-size.w = pText1-w + adj_size(6);
   add_to_gui_list(MAX_ID - utype_number(i), pBuf);
   
-  /* --- */	
+  /* shield upkeep */	
   my_snprintf(cBuf, sizeof(cBuf), %d, units[utype_index(i)].upkeep_shield);
   pStr = create_str16_from_char(cBuf, adj_font(10));
   pStr-style |= SF_CENTER;
@@ -512,7 +512,7 @@
   pBuf-size.w = pText1-w;
   add_to_gui_list(MAX_ID - utype_number(i), pBuf);
 	
-  /* --- */
+  /* food upkeep */
   my_snprintf(cBuf, sizeof(cBuf), %d, units[utype_index(i)].upkeep_food);
   pStr = create_str16_from_char(cBuf, adj_font(10));
   pStr-style |= SF_CENTER;
@@ -526,7 +526,7 @@
   pBuf-size.w = pText1-w;
   add_to_gui_list(MAX_ID - utype_number(i), pBuf);
 
-  /* --- */
+  /* gold upkeep */
   my_snprintf(cBuf, sizeof(cBuf), %d, units[utype_index(i)].upkeep_gold);
   pStr = create_str16_from_char(cBuf, adj_font(10));
   pStr-style |= SF_CENTER;
@@ -539,7 +539,8 @@
   hh = MAX(hh, pBuf-size.h);
   pBuf-size.w = pText1-w;
   add_to_gui_list(MAX_ID - utype_number(i), pBuf);  
-  /* --- */
+  
+  /* building */
   if(units[utype_index(i)].building_count  0) {
 	my_snprintf(cBuf, sizeof(cBuf), %d, units[utype_index(i)].building_count);
   } else {
@@ -556,7 +557,7 @@
   pBuf-size.w = pText2-w + adj_size(6);
   add_to_gui_list(MAX_ID - utype_number(i), pBuf);
   
-  /* --- */
+  /* soonest completion */
   if(units[utype_index(i)].building_count  0) {
 	my_snprintf(cBuf, sizeof(cBuf), %d %s, units[utype_index(i)].soonest_completions,
 			PL_(turn, turns, units[utype_index(i)].soonest_completions));
@@ -852,28 +853,33 @@
 struct widget *pWidget, *pBuf;
 bool is_in_list = FALSE;
 char cBuf[32];
-bool upgrade;  
+bool upgrade;
+bool search_finished;
 
 get_units_report_data(units, units_total);
 
 /* find if there are new units entry (if not then rebuild all) */
-pWidget = pUnitsDlg-pEndActiveWidgetList;/* icon of first unit */
+pWidget = pUnitsDlg-pEndActiveWidgetList; /* icon of first list entry */
 unit_type_iterate(i) {
   if ((units[utype_index(i)].active_count  0) || (units[utype_index(i)].building_count  0)) {
 is_in_list = FALSE;
-pBuf = pWidget;
+
+pBuf = pWidget; /* unit type icon */
 while(pBuf) {
-	  if(utype_number(i) == MAX_ID - pBuf-ID) {
+	  if((MAX_ID - pBuf-ID) == utype_number(i)) {
 	is_in_list = TRUE;
 	pWidget = pBuf;
 	break;
 	  }
-	  if(pBuf-prev-prev-prev-prev-prev-prev ==
+	  if(pBuf-prev-prev-prev-prev-prev-prev-prev ==
 			  pUnitsDlg-pBeginActiveWidgetList) {
 	break;
 	  }
-	  pBuf = pBuf-prev-prev-prev-prev-prev-prev-prev;/* add 7 widgets */
+
+  /* first widget of next list entry */
+	  

[Freeciv-Dev] (PR#6835) Bug: SDL compile problem on Solaris

2007-10-19 Thread Christian Prochaska

URL: http://bugs.freeciv.org/Ticket/Display.html?id=6835 

 [bretta - Di 11. Nov 2003, 21:37:31]:
 
 I get the following compilation error when I try to make the SDL client
 on Solaris 9:
 
 make[3]: Entering directory `/var/tmp/freeciv/client'
 gcc  -O3 -fomit-frame-pointer -Wall -Wpointer-arith -Wcast-align
 -Wmissing-prototypes -Wmissing-declarations -I/usr/local/include/SDL
 -D_REENTRANT   -o civclient attribute.o citydlg_common.o
 cityrepdata.o civclient.o chatline_common.o climisc.o climap.o clinet.o
 control.o goto.o helpdata.o mapctrl_common.o mapview_common.o
 messagewin_common.o packhand.o plrdlg_common.o options.o
 repodlgs_common.o tilespec.o audio.o audio_none.o gui-sdl/libguiclient.a
 ../common/aicore/libaicore.a ../common/libcivcommon.a agents/libagents.a
 -lsocket  -L/usr/local/lib -R/usr/local/lib -lSDL -lpthread -lposix4 -lX
 -lSDL_image -L/usr/sfw/lib -lfreetype  -lz -lnls  -L/usr/local/lib
 -R/usr/local/lib -lSDL -lpthread -lposix4 -lX
 Undefined   first referenced
  symbol in file
 cos gui-sdl/libguiclient.a(plrdlg.o) 
 (symbol belongs to implicit dependency /usr/lib/libm.so.1)
 ceilgui-sdl/libguiclient.a(SDL_ttf.o) 
 (symbol belongs to implicit dependency /usr/lib/libm.so.1)
 pow ../common/libcivcommon.a(combat.o) 
 (symbol belongs to implicit dependency /usr/lib/libm.so.1)
 inet_addr   ../common/libcivcommon.a(netintf.o)
  (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
 sin gui-sdl/libguiclient.a(plrdlg.o) 
 (symbol belongs to implicit dependency /usr/lib/libm.so.1)
 gethostbyname   ../common/libcivcommon.a(netintf.o)
  (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
 ld: fatal: Symbol referencing errors. No output written to civclient
 collect2: ld returned 1 exit status
 make[3]: *** [civclient] Error 1
 
 If I add -lm -lnsl to the CLIENT_LIBS or LIBS in the Makefile, it will
 successfully compile.
 
 

Does this still happen with a current version?


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev