[Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c,
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9899 >
> [per - Thu Sep 02 04:46:24 2004]:
>
> On Wed, 1 Sep 2004, Benoit Hudson wrote:
> > OK; thanks.Brett is right: it's related to byte order. Basically, it's
> > a bug to cast a short* to an int*.On a little-endian machine, everything
> > turns out fine because you just clobber the following field with a
> > zero.On a big-endian machine, you set your field to zero, and the
> > following field to the right value (but then it'll be read next).
> >
> > Patch attached for the bug we noticed; there's lots more casting to int*
> > though that I am not fixing.
>
> This patch does not help, since you fix an autogenerated file. We will
> need to fix common/generate_packets.py, which is a python script, so I
> cannot help out there.
I am not really strogn in this part of the code but it sort of feels as
if current code just cannot hadnle signed non-int variables.
Benoit, can you please check if the attached patch works?
G
? fix_cont.diff
Index: common/fc_types.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/fc_types.h,v
retrieving revision 1.4
diff -u -r1.4 fc_types.h
--- common/fc_types.h 1 Sep 2004 03:16:47 -0000 1.4
+++ common/fc_types.h 2 Sep 2004 05:21:41 -0000
@@ -18,7 +18,7 @@
* occurs when a type which is defined in one file is needed for a fuction
* definition in another file */
-typedef signed short Continent_id;
+typedef int Continent_id;
typedef enum tile_terrain_type Terrain_type_id;
/* TODO: Remove this enum and make this an integer when gen-eff is done. */
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, (continued)
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/01
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Per I. Mathisen, 2004/09/01
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/01
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Jason Short, 2004/09/01
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Jason Short, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Jason Short, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Jason Short, 2004/09/02
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289,
Gregory Berkolaiko <=
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Brett Albertson, 2004/09/02
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Brett Albertson, 2004/09/02
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Jason Short, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/02
|
|