[Freeciv-Dev] (PR#36441) Bug appear when simply press key "F1"

2007-02-20 Thread ZaG

http://bugs.freeciv.org/Ticket/Display.html?id=36441 >

The game simply fall in windows without any messages.

This bug reproduced in Freeciv-2.0.9-win32-gtk2-setup.exe and  
Freeciv-2.1.0-beta3-win32-gtk2-setup.exe.

Win XP + SP2



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


[Freeciv-Dev] (PR#36441) Bug appear when simply press key "F1"

2007-02-20 Thread Christian Prochaska

http://bugs.freeciv.org/Ticket/Display.html?id=36441 >

> [EMAIL PROTECTED] - Di 20. Feb 2007, 09:08:35]:
> 
> The game simply fall in windows without any messages.
> 
> This bug reproduced in Freeciv-2.0.9-win32-gtk2-setup.exe and  
> Freeciv-2.1.0-beta3-win32-gtk2-setup.exe.
> 
> Win XP + SP2
> 

I couldn't reproduce the crash. Did it happen after starting a new game
or did you load a saved game?


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


[Freeciv-Dev] Re: (PR#36441) Bug appear when simply press key "F1"

2007-02-20 Thread ZaG

http://bugs.freeciv.org/Ticket/Display.html?id=36441 >

It happens right after start of new game. I have reproduced it on two  
computers (on work and houses)

20.02.07 в 12:18 Christian Prochaska в своём письме писал(а):

>
> http://bugs.freeciv.org/Ticket/Display.html?id=36441 >
>
>> [EMAIL PROTECTED] - Di 20. Feb 2007, 09:08:35]:
>>
>> The game simply fall in windows without any messages.
>>
>> This bug reproduced in Freeciv-2.0.9-win32-gtk2-setup.exe and
>> Freeciv-2.1.0-beta3-win32-gtk2-setup.exe.
>>
>> Win XP + SP2
>>
>
> I couldn't reproduce the crash. Did it happen after starting a new game
> or did you load a saved game?
>
>




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


[Freeciv-Dev] (PR#36441) Bug appear when simply press key "F1"

2007-02-20 Thread Christian Prochaska

http://bugs.freeciv.org/Ticket/Display.html?id=36441 >

> [EMAIL PROTECTED] - Di 20. Feb 2007, 10:47:47]:
> 
> It happens right after start of new game. I have reproduced it on two  
> computers (on work and houses)
> 
> 20.02.07 в 12:18 Christian Prochaska в своём письме писал(а):
> 
> >
> > http://bugs.freeciv.org/Ticket/Display.html?id=36441 >
> >
> >> [EMAIL PROTECTED] - Di 20. Feb 2007, 09:08:35]:
> >>
> >> The game simply fall in windows without any messages.
> >>
> >> This bug reproduced in Freeciv-2.0.9-win32-gtk2-setup.exe and
> >> Freeciv-2.1.0-beta3-win32-gtk2-setup.exe.
> >>
> >> Win XP + SP2
> >>
> >
> > I couldn't reproduce the crash. Did it happen after starting a new game
> > or did you load a saved game?
> >
> >
> 

Ok, found the bug. The crash occurs when playing with the russian locale
and the reason is that the text of the last column header needs 77 bytes
of memory while only 64 bytes are allocated for the buffer. The attached
patch increases the size of this particular buffer to 128 bytes. 

Index: client/gui-gtk-2.0/cityrep.c
===
--- client/gui-gtk-2.0/cityrep.c	(revision 12680)
+++ client/gui-gtk-2.0/cityrep.c	(working copy)
@@ -772,7 +772,7 @@
 static void create_city_report_dialog(bool make_modal)
 {
   static char *titles [NUM_CREPORT_COLS];
-  static char  buf[NUM_CREPORT_COLS][64];
+  static char  buf[NUM_CREPORT_COLS][128];
   struct city_report_spec *spec;
 
   GtkWidget *w, *sw, *menubar;

Index: client/gui-gtk-2.0/cityrep.c
===
--- client/gui-gtk-2.0/cityrep.c	(revision 12680)
+++ client/gui-gtk-2.0/cityrep.c	(working copy)
@@ -777,7 +777,7 @@
 static void create_city_report_dialog(bool make_modal)
 {
   static char **titles;
-  static char (*buf)[64];
+  static char (*buf)[128];
   struct city_report_spec *spec;
 
   GtkWidget *w, *sw, *menubar;
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#36441) Bug appear when simply press key "F1"

2007-02-20 Thread Christian Prochaska

http://bugs.freeciv.org/Ticket/Display.html?id=36441 >

Remark: the real bug seems to be in libutf8's snprintf() function which
should normally cut the string down to fit into the buffer. But
increasing the buffer also avoids the crash and should be done anyway to
make the complete string visible.


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


[Freeciv-Dev] (PR#36491) Re: [art] civicon & cityicon

2007-02-20 Thread Daniel Markstedt

http://bugs.freeciv.org/Ticket/Display.html?id=36491 >

On 2/14/07, Daniel Markstedt <[EMAIL PROTECTED]> wrote:
> Right now, Amplio uses a different civicon (amplio/civicon.png) and
> cityicon (amplio/cityicon.png) than all the other tilesets in SVN.
>
> It IMO is especially crucial that civicon is standardized, since it
> shows up in for example winxp's taskbar and while alt-tabbing. The
> result is that under Windows, Freeciv running Amplio and Freeciv
> running Trident appear to be two different programs.
>
> I don't mind third party tilesets using custom icons, but all tilesets
> in the official package should IMO use one and the same style to avoid
> confusion.
>
> I suggest using Amplio's cityicon and a civicon derived from jimbo's
> 'golden globe' logo (attached).
>
>  ~Daniel
>

As for 2.1 we should use the icon for that version. Attached.

BTW, any way of forcing the win32 builds to use the executable's ICO
instead of civicon.png as window manager icon? The Windows window
manager can scale its native format with anti-aliasing, while the
Linux-style window manager icon looks craptacular (no anti-aliasing at
all) whatever you do. You can tell the difference very well, since the
ICO shows up in the taskbar for a second or so while starting up,
before the Freeciv code changes it to the PNG.

 ~Daniel


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


[Freeciv-Dev] (PR#36496) libutf8 troubles

2007-02-20 Thread Christian Prochaska

http://bugs.freeciv.org/Ticket/Display.html?id=36496 >

Besides potential crashes like the one reported in PR#36441 there's the
problem that libutf8's vsnprintf() function doesn't work on Windows
Vista, as was reported on the forums a while ago:
http://forum.freeciv.org/viewtopic.php?t=2642

While searching for the cause of the crash of PR#36441 I noticed the
vsnprintf() replacement code in support.c for platforms where a native
vsnprintf() does not exist or is broken. I tried to activate it by
undefining HAVE_VSNPRINTF and HAVE_WORKING_VSNPRINTF in config.h and
compiled without using libutf8 and it seems to work fine even with
reordered arguments (PR#12932). Then I wrote a little test:

char buf1[100], buf2[100], buf3[100];
printf("printf: %2$s %1$s\n", "arg1", "arg2");
sprintf(buf1, "sprintf: %2$s %1$s\n", "arg1", "arg2");
snprintf(buf2, 100, "snprintf: %2$s %1$s\n", "arg1", "arg2");
my_snprintf(buf3, 100, "my_snprintf: %2$s %1$s\n", "arg1", "arg2");
printf("%s%s%s", buf1, buf2, buf3);

which resulted in:

printf: arg2 arg1
sprintf: arg2 arg1
snprintf: $s $s
my_snprintf: arg2 arg1

So it turns out that only the native snprintf() and vsnprintf()
functions are broken on Windows. My suggestion is now to replace any
remaining calls to snprintf() in S2_0 and S2_1 by calls to my_snprintf()
or cat_snprintf() and to skip the vsnprintf() tests in the configure
script on Windows, so the replacement code is being used. Then we
wouldn't need to use libutf8 anymore. Patches are attached. 

Index: configure.ac
===
--- configure.ac	(revision 12680)
+++ configure.ac	(working copy)
@@ -356,18 +356,6 @@
   AC_DEFINE_UNQUOTED(LOCALEDIR, "./share/locale", [Locale directory (windows)])
 fi  
 
-dnl Check libUTF8
-AC_ARG_WITH(libutf8,
-AC_HELP_STRING([--with-libutf8],
-   [Use the libutf8 library (needed for some systems)]),
-[with_libutf8=$withval], [with_libutf8=no])
-if test "$MINGW32" = yes || test "$with_libutf8" = yes; then
-  AC_CHECK_HEADER(libutf8.h, [],
-  AC_MSG_ERROR([Could not find libutf8 library (libutf8.h)]))
-  AC_DEFINE(HAVE_LIBUTF8_H, 1, [Use libutf8's stdio functions])
-  LIBS="$LIBS -lutf8"
-fi
-
 dnl Check for zlib (needed for libpng)
 AC_CHECK_LIB(z, gzgets, , 
   AC_MSG_ERROR([Could not find zlib library.]), )
@@ -553,11 +541,16 @@
 AC_FUNC_FORK
 AC_FUNC_STRCOLL
 AC_FUNC_VPRINTF
+
+dnl Windows vsnprintf doesn't support argument reordering (see PR#12932)
+if test "x$MINGW32" != "xyes"; then
 AC_FUNC_VSNPRINTF
+AC_CHECK_FUNCS([vsnprintf])
+fi
 
 AC_CHECK_FUNCS([fileno ftime gethostname getpwuid inet_aton \
 		select snooze strerror strcasecmp strncasecmp \
-		strlcat strlcpy strstr usleep vsnprintf uname flock \
+		strlcat strlcpy strstr usleep uname flock \
 		gethostbyname connect bind])
 
 AC_MSG_CHECKING(for working gettimeofday)
Index: utility/support.h
===
--- utility/support.h	(revision 12680)
+++ utility/support.h	(working copy)
@@ -26,9 +26,6 @@
 #ifdef HAVE_SYS_TYPES_H
 #include 
 #endif
-#ifdef HAVE_LIBUTF8_H
-#include 
-#endif
 
 #ifdef TRUE
 #undef TRUE
Index: server/savegame.c
===
--- server/savegame.c	(revision 12680)
+++ server/savegame.c	(working copy)
@@ -1055,7 +1055,7 @@
 if (ptile->owner == NULL) {
   strcpy(token, "-");
 } else {
-  snprintf(token, sizeof(token), "%d", ptile->owner->player_no);
+  my_snprintf(token, sizeof(token), "%d", ptile->owner->player_no);
 }
 strcat(line, token);
 if (x + 1 < map.xsize) {
@@ -1075,7 +1075,7 @@
 if (ptile->owner_source == NULL) {
   strcpy(token, "-");
 } else {
-  snprintf(token, sizeof(token), "%d", ptile->owner_source->index);
+  my_snprintf(token, sizeof(token), "%d", ptile->owner_source->index);
 }
 strcat(line, token);
 if (x + 1 < map.xsize) {
Index: utility/support.h
===
--- utility/support.h	(revision 12680)
+++ utility/support.h	(working copy)
@@ -26,9 +26,6 @@
 #ifdef HAVE_SYS_TYPES_H
 #include 
 #endif
-#ifdef HAVE_LIBUTF8_H
-#include 
-#endif
 
 #ifdef TRUE
 #undef TRUE
Index: configure.ac
===
--- configure.ac	(revision 12680)
+++ configure.ac	(working copy)
@@ -355,18 +356,6 @@
   AC_DEFINE_UNQUOTED(LOCALEDIR, "./share/locale", [Locale directory (windows)])
 fi  
 
-dnl Check libUTF8
-AC_ARG_WITH(libutf8,
-AC_HELP_STRING([--with-libutf8],
-   [Use the libutf8 library (needed for some systems)]),
-[with_libutf8=$withval], [with_libutf8=no])
-if test "$MINGW32" = yes || test "$with_libutf8" = yes; then
-  AC_CHECK_HEADER(libutf8.h, [],
-  AC_MSG_ERROR([Could not find libutf8 library (libut

[Freeciv-Dev] (PR#36441) Bug appear when simply press key "F1"

2007-02-20 Thread Christian Prochaska

http://bugs.freeciv.org/Ticket/Display.html?id=36441 >

ZaG: I uploaded new installer packages where the crash shouldn't happen
anymore

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