Re: [Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-11-26 Thread Castanier Carl

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

2007/11/26, Jason Dorje Short <[EMAIL PROTECTED]>:
>
>
> http://bugs.freeciv.org/Ticket/Display.html?id=39722 >
>
> Castanier Carl wrote:
> > http://bugs.freeciv.org/Ticket/Display.html?id=39722 >
> >
> > 2007/11/26, Jason Short <[EMAIL PROTECTED]>:
> >>
> >> http://bugs.freeciv.org/Ticket/Display.html?id=39722 >
> >
> > I can't view that ticket as guest since trackers not allow me to display
> > them since many days :(
>
> The guest account was temporarily broken.


I have read it :( and it's not easy to talk about a post without know what I
wrote bcs it's old


> What platform are you using?
> >
> > I'm using Debian/GNU Linux testing on I386 (centrino dual core and K7
> > athlon ). Problem appears only with gcc-4.2. But gcc-4.1 don't have this
> > problem.
>
> It isn't perhaps a 64-bit system?

no it's i396 not ia64. But, a friend had same problem with ia64 and gcc-4.2

> Are you really saying that GINT_TO_POINTER is not reversible for
> > negative numbers on your platform?  If that's the case we need to
> audit
> > a lot more users I think...and would need to complain to the glib
> people
> > to get the macro to barf when given a negative.
> >
> > Yep. Optimisation -02 cause this problem. If GINT_TO_POINTER=-1 then
> > it's constant like variable (never take other value). Problem is prehaps
> > more due to the GCC than GLIB.

Yep. Optimisation -02 cause this problem ?? If it's not written in my bug
report, I have tell a big mistake. I use allways this option for packaging
freeciv in .deb than to debian maintainer, but if there are no mentions of
it, then -O2 was not the problem, was only gcc-4.2.



Really sounds to me like this is a glib bug.
>


Really, I can't answer since it's working with other compiler (3.4 on msys
and 4.2 on linux). Bug still remains if you change version of glib (tested
with 2.8 and 2.10). I had same problem long time ago with g77 (fortran
code). Community of 250 people cannot find in library where we are wrong.
Just changing compiler closed the problem.
When GINT_TO_POINTER take -1 value it can't be changed. Variable still exist
but execution of changing value no or pointer point on NULL variable of type
GINT_TO_POINTER (FF FF). It can be also du to differents compilation options
between glib and freeciv ; but I thougth that I had checked it.
Anyway, this is lonely problem with gcc'-4.2 and can be solve easy. I have
thougth about send a bug report to gcc but I don't have authority for
freeciv to do it. It can also be send to glib.
I forget to tell you. I'm not friendly with freeciv interface trancking bug
and I have posted 2 or 3 reports for same bug. I cannot erase previous but
only last one have good patch. As Mr Simpson focus, the behaviour mustn't be
changed so my last patch include solution to don't change order into menu.




-jason
>
>
>
Cheers


-- 
Carl

2007/11/26, Jason Dorje Short <[EMAIL PROTECTED]>:
http://bugs.freeciv.org/Ticket/Display.html?id=39722 >Castanier Carl wrote:> 
http://bugs.freeciv.org/Ticket/Display.html?id=39722 >>> 2007/11/26, Jason Short <[EMAIL PROTECTED]>: http://bugs.freeciv.org/Ticket/Display.html?id=39722 >>> I can't view that ticket as guest since trackers not allow me to display
> them since many days :(The guest account was temporarily broken.I have read it :( and it's not easy to talk about a post without know what I wrote bcs it's old 
> What platform are you using?>> I'm using Debian/GNU Linux testing on I386 (centrino dual core and K7> athlon ). Problem appears only with gcc-4.2. But gcc-4.1 don't have this> problem.
It isn't perhaps a 64-bit system?no it's i396 not ia64. But, a friend had same problem with ia64 and gcc-4.2
> Are you really saying that GINT_TO_POINTER is not reversible for> negative numbers on your platform?  If that's the case we need to audit> a lot more users I think...and would need to complain to the glib people
> to get the macro to barf when given a negative.>> Yep. Optimisation -02 cause this problem. If GINT_TO_POINTER=-1 then> it's constant like variable (never take other value). Problem is prehaps
> more due to the GCC than GLIB.Yep. Optimisation -02 cause this problem ?? If it's not written in my bug report, I have tell a big mistake. I use allways this option for packaging freeciv in .deb than to debian maintainer, but if there are no mentions of it, then -O2 was not the problem, was only 
gcc-4.2.  Really sounds to me like this is a glib bug.
 Really, I can't answer since it's working with other compiler (3.4 on msys and 4.2 on linux). Bug still remains if you change version of glib (tested with 2.8 and 2.10). I had same problem long time ago with g77 (fortran code). Community of 250 people cannot find in library where we are wrong. Just changing compiler closed the problem.
When GINT_TO_POINTER take -1 value it can't be changed. Variable still exist but execution of changing value no or pointer point on 

Re: [Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-11-26 Thread Jason Dorje Short

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

Castanier Carl wrote:
> http://bugs.freeciv.org/Ticket/Display.html?id=39722 >
> 
> 2007/11/26, Jason Short <[EMAIL PROTECTED]>:
>>
>> http://bugs.freeciv.org/Ticket/Display.html?id=39722 >
> 
> I can't view that ticket as guest since trackers not allow me to display
> them since many days :(

The guest account was temporarily broken.

> What platform are you using?
> 
> I'm using Debian/GNU Linux testing on I386 (centrino dual core and K7 
> athlon ). Problem appears only with gcc-4.2. But gcc-4.1 don't have this 
> problem.

It isn't perhaps a 64-bit system?

> Are you really saying that GINT_TO_POINTER is not reversible for
> negative numbers on your platform?  If that's the case we need to audit
> a lot more users I think...and would need to complain to the glib people
> to get the macro to barf when given a negative.
> 
> Yep. Optimisation -02 cause this problem. If GINT_TO_POINTER=-1 then 
> it's constant like variable (never take other value). Problem is prehaps 
> more due to the GCC than GLIB.

Really sounds to me like this is a glib bug.

-jason



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


Re: [Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-11-26 Thread Castanier Carl

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

2007/11/26, William Allen Simpson <[EMAIL PROTECTED]>:
>
>
> http://bugs.freeciv.org/Ticket/Display.html?id=39722 >
>
> Castanier Carl wrote:
> > ... A
> > program who miscompile is NOT cleanly written and I had make an effort
> to
> > post patch to clean up this code. You can leave this patch as many
> others...
>
> The patch changes the order of the menu, and adds a special case for the
> -1 you changed to be the last item instead.

hehe there are 2 patchs :) someone had focus me on that point and the second
one close your mouth
ho, sorry was a pepeto comment :) you can't read them :)
Anyway, I can't talk about it since I can't read any tickets and I can't see
what I wrote.

A compiler that mis-compiles without error messages is not well written.
>
> A project that doesn't compile with a buggy compiler optimization option
> is
> not a problem in and of itself.  It's called an "option" for a reason.

yep, but options must be tested in configure.ac  :))


> I had never seen a project who dont compile with -02 or they solv
> > immediately the problem.
>
> I suggest you Google this issue.  I know that there were problems at
> netbsd,
> gimp, ghostscript,   Some of the best in the business!

You need to put -02 option explicitly by CFLAGS.

I think that after we've told you "WARNING" and you do it anyway, you are
> not being helpful to us.  We really appreciate helpful bug reports.


So, do reply to me.


And we don't appreciate even lousy attempts at crude language.
>
>
> Then, you have to don't tell me too bad 2 times without reading tiles of
my submitted bug. -02 is an option into configure.ac and you can test
version of gcc to remove this option ; that's close the bug. My purpose was
to keep enable -02.
You are not center of the world. That all for me. I have answer to previous
message from Mr Short who seems have some education. So what your problem
with me? Why you simply don't ask? Why you talk of this patch many month
after I posted it in such term? Why I'm too bad?

DON'T REPLY, I think you and me is over. I will never more post anything. If
you see patch from me, it's too bad so close it quick quick quick tks.

-- 
Carl

2007/11/26, William Allen Simpson <[EMAIL PROTECTED]>:
http://bugs.freeciv.org/Ticket/Display.html?id=39722 >Castanier Carl wrote:> ... A> program who miscompile is NOT cleanly written and I had make an effort to
> post patch to clean up this code. You can leave this patch as many others...The patch changes the order of the menu, and adds a special case for the-1 you changed to be the last item instead.
hehe there are 2 patchs :) someone had focus me on that point and the second one close your mouthho, sorry was a pepeto comment :) you can't read them :)Anyway, I can't talk about it since I can't read any tickets and I can't see what I wrote.
A compiler that mis-compiles without error messages is not well written.
A project that doesn't compile with a buggy compiler optimization option isnot a problem in and of itself.  It's called an "option" for a reason.yep, but options must be tested in 
configure.ac  :)) > I had never seen a project who dont compile with -02 or they solv
> immediately the problem.I suggest you Google this issue.  I know that there were problems at netbsd,gimp, ghostscript,   Some of the best in the business!You need to put -02 option explicitly by CFLAGS.
I think that after we've told you "WARNING" and you do it anyway, you are
not being helpful to us.  We really appreciate helpful bug reports.So, do reply to me. 
And we don't appreciate even lousy attempts at crude language.Then, you have to don't tell me too bad 2 times without reading tiles of my submitted bug. -02 is an option into 
configure.ac and you can test version of gcc to remove this option ; that's close the bug. My purpose was to keep enable -02.You are not center of the world. That all for me. I have answer to previous message from Mr Short who seems have some education. So what your problem with me? Why you simply don't ask? Why you talk of this patch many month after I posted it in such term? Why I'm too bad?
DON'T REPLY, I think you and me is over. I will never more post anything. If you see patch from me, it's too bad so close it quick quick quick tks.-- Carl
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-11-26 Thread William Allen Simpson

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

Castanier Carl wrote:
> ... A
> program who miscompile is NOT cleanly written and I had make an effort to
> post patch to clean up this code. You can leave this patch as many others...

The patch changes the order of the menu, and adds a special case for the
-1 you changed to be the last item instead.

A compiler that mis-compiles without error messages is not well written.

A project that doesn't compile with a buggy compiler optimization option is
not a problem in and of itself.  It's called an "option" for a reason.


> I had never seen a project who dont compile with -02 or they solve
> immediately the problem. 

I suggest you Google this issue.  I know that there were problems at netbsd,
gimp, ghostscript,   Some of the best in the business!

I think that after we've told you "WARNING" and you do it anyway, you are
not being helpful to us.  We really appreciate helpful bug reports.

And we don't appreciate even lousy attempts at crude language.



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


Re: [Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-11-26 Thread Castanier Carl

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

2007/11/26, William Allen Simpson <[EMAIL PROTECTED]>:
>
>
> http://bugs.freeciv.org/Ticket/Display.html?id=39722 >
>
> Castanier Carl wrote:
> > Yep. Optimisation -02 cause this problem.
>
> Too bad you didn't include this little detail in your original report.



Too bad you didn't read the documentation on compiling:
>
>gcc 4.2.1 and 4.2.2 miscompile Freeciv, if level -O2 (or above)
>optimization is used!
>
> Don't use -O2.  Tell us whether this can be closed with -O1?
>
Sorry, I don't understand what you are doing into freeciv. I dream! A
program who miscompile is NOT cleanly written and I had make an effort to
post patch to clean up this code. You can leave this patch as many others...
I had never seen a project who dont compile with -02 or they solve
immediately the problem. I can't access to this tickets and I don't remember
the content but I explained cause of problem.
Really, too bad?? I can't tell you what I think about your reply. You say
gcc 4.2.1 and 4.2.2 miscompile Freeciv, if level -O2 as everybody know and I
give you a patch to solve it and TOO BAD :) How about masturbate?

If you see a previous post for me, please leave it. It can improve your
project.


Cheers

-- 
Carl

2007/11/26, William Allen Simpson <[EMAIL PROTECTED]>:
http://bugs.freeciv.org/Ticket/Display.html?id=39722 >Castanier Carl wrote:> Yep. Optimisation -02 cause this problem.
Too bad you didn't include this little detail in your original report. 
Too bad you didn't read the documentation on compiling:   gcc 4.2.1 and 4.2.2 miscompile Freeciv, if level -O2 (or above)   optimization is used!Don't use -O2.  Tell us whether this can be closed with -O1?
Sorry, I don't understand what you are doing into freeciv. I dream! A program who miscompile is NOT cleanly written and I had make an effort to post patch to clean up this code. You can leave this patch as many others... I had never seen a project who dont compile with -02 or they solve immediately the problem. I can't access to this tickets and I don't remember the content but I explained cause of problem.
Really, too bad?? I can't tell you what I think about your reply. You say gcc 4.2.1 and 4.2.2 miscompile Freeciv, if level -O2 as everybody know and I give you a patch to solve it and TOO BAD :) How about masturbate?
If you see a previous post for me, please leave it. It can improve your project.Cheers-- Carl
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-11-26 Thread William Allen Simpson

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

Castanier Carl wrote:
> Yep. Optimisation -02 cause this problem. 

Too bad you didn't include this little detail in your original report.

Too bad you didn't read the documentation on compiling:

   gcc 4.2.1 and 4.2.2 miscompile Freeciv, if level -O2 (or above)
   optimization is used!

Don't use -O2.  Tell us whether this can be closed with -O1?



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


Re: [Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-11-26 Thread Castanier Carl

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

2007/11/26, Jason Short <[EMAIL PROTECTED]>:
>
>
> http://bugs.freeciv.org/Ticket/Display.html?id=39722 >

I can't view that ticket as guest since trackers not allow me to display
them since many days :(


I'm going to commit a fix for this (why not) but I'd like more details.

Hurray, I have posted some ticket, I'm thought that nobody read them :)


What platform are you using?

I'm using Debian/GNU Linux testing on I386 (centrino dual core and K7 athlon
). Problem appears only with gcc-4.2. But gcc-4.1 don't have this problem.



Are you really saying that GINT_TO_POINTER is not reversible for
> negative numbers on your platform?  If that's the case we need to audit
> a lot more users I think...and would need to complain to the glib people
> to get the macro to barf when given a negative.

Yep. Optimisation -02 cause this problem. If GINT_TO_POINTER=-1 then it's
constant like variable (never take other value). Problem is prehaps more due
to the GCC than GLIB.


-jason
>
>
Cheers

-- 
Carl

2007/11/26, Jason Short <[EMAIL PROTECTED]>:
http://bugs.freeciv.org/Ticket/Display.html?id=39722 >I can't view that ticket as guest since trackers not allow me to display them since many days :(
 I'm going to commit a fix for this (why not) but I'd like more details.
Hurray, I have posted some ticket, I'm thought that nobody read them :) 
What platform are you using?I'm using Debian/GNU Linux testing on I386 (centrino dual core and K7 athlon ). Problem appears only with gcc-4.2. But gcc-4.1 don't have this problem. 
Are you really saying that GINT_TO_POINTER is not reversible fornegative numbers on your platform?  If that's the case we need to audit
a lot more users I think...and would need to complain to the glib peopleto get the macro to barf when given a negative.Yep. Optimisation -02 cause this problem. If GINT_TO_POINTER=-1 then it's constant like variable (never take other value). Problem is prehaps more due to the GCC than GLIB.
 -jasonCheers-- Carl
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-11-25 Thread Jason Short

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

I'm going to commit a fix for this (why not) but I'd like more details.

What platform are you using?

Are you really saying that GINT_TO_POINTER is not reversible for
negative numbers on your platform?  If that's the case we need to audit
a lot more users I think...and would need to complain to the glib people
to get the macro to barf when given a negative.

-jason


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


[Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-09-26 Thread woodswolf

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

> [guest - Mer. Sep. 26 11:58:18 2007]:
> 
> Use this patch. Probably more clean and keep old behaviours.
> 
hmmm, I have made patch in wrong side so please ue it.
How can I delete my old messages.
diff -urNa freeciv-2.0.orig/client/gui-gtk-2.0/cityrep.c freeciv-2.0/client/gui-gtk-2.0/cityrep.c
--- freeciv-2.0.orig/client/gui-gtk-2.0/cityrep.c	2007-09-26 11:27:21.0 +0200
+++ freeciv-2.0/client/gui-gtk-2.0/cityrep.c	2007-09-26 14:47:05.0 +0200
@@ -52,7 +52,7 @@
 #include "cityrep.h"
 
 #define NEG_VAL(x)  ((x)<0 ? (x) : (-x))
-#define CMA_NONE	(-1)
+#define CMA_NONE	(cmafec_preset_num())
 #define CMA_CUSTOM	(-2)
 
 enum city_operation_type {
@@ -548,10 +548,14 @@
   gtk_menu_item_set_submenu(parent_item, menu);
 
   if (change_cma) {
-for (i = -1; i < cmafec_preset_num(); i++) {
-  w = (i == -1 ? gtk_menu_item_new_with_label(_("none"))
-	   : gtk_menu_item_new_with_label(cmafec_preset_get_descr(i)));
-  gtk_menu_shell_append(GTK_MENU_SHELL(menu), w);
+for (i = 0; i <= cmafec_preset_num(); i++) {
+  if ( i == CMA_NONE) {
+	w = gtk_menu_item_new_with_label(_("none"));
+	gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), w);	
+  } else {
+	w = gtk_menu_item_new_with_label(cmafec_preset_get_descr(i));
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu), w);
+  }
   g_signal_connect(w, "activate", G_CALLBACK(select_cma_callback),
 		   GINT_TO_POINTER(i));
 }
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-09-26 Thread woodswolf

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

Use this patch. Probably more clean and keep old behaviours.
diff -urNa freeciv-2.0.orig/client/gui-gtk-2.0/cityrep.c freeciv-2.0/client/gui-gtk-2.0/cityrep.c
--- freeciv-2.0.orig/client/gui-gtk-2.0/cityrep.c	2007-09-26 14:19:42.0 +0200
+++ freeciv-2.0/client/gui-gtk-2.0/cityrep.c	2007-09-26 11:27:21.0 +0200
@@ -52,7 +52,7 @@
 #include "cityrep.h"
 
 #define NEG_VAL(x)  ((x)<0 ? (x) : (-x))
-#define CMA_NONE	(cmafec_preset_num())
+#define CMA_NONE	(-1)
 #define CMA_CUSTOM	(-2)
 
 enum city_operation_type {
@@ -548,19 +548,13 @@
   gtk_menu_item_set_submenu(parent_item, menu);
 
   if (change_cma) {
-for (i = 0; i <= cmafec_preset_num(); i++) {
-  if ( i == CMA_NONE) {
-	w = gtk_menu_item_new_with_label(_("none"));
-	gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), w);	
-  } else {
-	w = gtk_menu_item_new_with_label(cmafec_preset_get_descr(i));
-	gtk_menu_shell_append(GTK_MENU_SHELL(menu), w);
-  }
+for (i = -1; i < cmafec_preset_num(); i++) {
+  w = (i == -1 ? gtk_menu_item_new_with_label(_("none"))
+	   : gtk_menu_item_new_with_label(cmafec_preset_get_descr(i)));
+  gtk_menu_shell_append(GTK_MENU_SHELL(menu), w);
   g_signal_connect(w, "activate", G_CALLBACK(select_cma_callback),
 		   GINT_TO_POINTER(i));
-
 }
-
   } else {
 /* search for a "none" */
 int found;
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-09-26 Thread woodswolf

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

> [pepeto - Mer. Sep. 26 10:17:55 2007]:
> 
> Could the 'none' CMA could be on the top of the menu?
> 
> 
Yes, use this patch

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


[Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-09-26 Thread Pepeto _

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

Could the 'none' CMA could be on the top of the menu?


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


[Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)

2007-09-25 Thread Castanier Carl

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

This transaction appears to have no content
Sorry erase previous PR#39721, I submit wrong patch file :(


With gcc-4.2, I have bug.
How to reproduce :
- Start game
- Build a city
- Press F1 (open city panel management)
- select city(ies)
- menu "Change" -> "CMA" -> "Food Max" (anyone except none)
- nothing append

- Open city panel by click on city on map, apply CMA
- Go to F1 panel
- menu "Change" -> "CMA" -> "Food Max" (anyone except none)
- CMA of city is set to none

It's not happend with gcc4.1 and seems due to
when you ask once GINT_TO_POINTER(-1) and after call to
GINT_TO_POINTER(x) is :
GINT_TO_POINTER(x) = GINT_TO_POINTER(-1).

Patch, put CMA called 'none' at the end of list of preset CMA.

Cheers

-- 
Carl
Sorry erase previous PR#39721, I submit wrong patch file :(With gcc-4.2, I have bug. How to reproduce : - Start game- Build a city- Press F1 (open city panel management)- select city(ies)
- menu "Change" -> "CMA" -> "Food Max" (anyone except none)
- nothing append- Open city panel by click on city on map, apply CMA- Go to F1 panel- menu "Change" -> "CMA" -> "Food Max" (anyone except none)- CMA of city is set to none

It's not happend with gcc4.1 and seems due to  when you ask once GINT_TO_POINTER(-1) and after call toGINT_TO_POINTER(x) is :GINT_TO_POINTER(x) = GINT_TO_POINTER(-1).Patch, put CMA called 'none' at the end of list of preset CMA.
Cheers-- Carl
diff -urda client/gui-gtk-2.0/cityrep.c.orig client/gui-gtk-2.0/cityrep.c
--- client/gui-gtk-2.0/cityrep.c.orig	2007-07-09 11:59:02.0 +0200
+++ client/gui-gtk-2.0/cityrep.c	2007-09-25 18:26:47.0 +0200
@@ -470,7 +470,7 @@
   gtk_tree_model_get(GTK_TREE_MODEL(city_model), it, 0, &res, -1);
   pcity = res;
 
-   if (idx == CMA_NONE) {
+   if (idx == cmafec_preset_num()) {
  cma_release_city(pcity);
} else {
  cma_put_city_under_agent(pcity, cmafec_preset_get_parameter(idx));
@@ -548,8 +548,8 @@
   gtk_menu_item_set_submenu(parent_item, menu);
 
   if (change_cma) {
-for (i = -1; i < cmafec_preset_num(); i++) {
-  w = (i == -1 ? gtk_menu_item_new_with_label(_("none"))
+for (i = 0; i <= cmafec_preset_num(); i++) {
+  w = (i == cmafec_preset_num() ? gtk_menu_item_new_with_label(_("none"))
 	   : gtk_menu_item_new_with_label(cmafec_preset_get_descr(i)));
   gtk_menu_shell_append(GTK_MENU_SHELL(menu), w);
   g_signal_connect(w, "activate", G_CALLBACK(select_cma_callback),
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev