Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement
Home

[Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bh@xxxxxxxxxxxxxxxxxxx, brett.albertson@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 1 Sep 2004 21:53:04 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9899 >

Benoit Hudson wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9899 >
> 
>>[kauf - Thu Sep 02 03:54:04 2004]:
>>
>>On Wed, Sep 01, 2004 at 08:47:10PM -0700, Benoit Hudson wrote:
>>The client sets (or should set) the continent number at:
>>client/packhand.c:2013
> 
> OK; thanks.  Brett is right: it's related to byte order.  Basically, it's a 
> bug to cast a short* to an 
> int*.

I knew something like this was going to happen.  Fixing it is neither 
easy nor pretty...

We should never do casting.  dio_get_uint8 should take a uint8*, not an 
int*.

One question is how can we be guaranteed of uint8, sint16, etc., values? 
  Probably we should declare these types.  Using autoconf support we can 
often import them from the system headers.  On some platforms 
sizeof(short) != 2 (I'm told) so making things portable will require 
some autoconf work.

jason




[Prev in Thread] Current Thread [Next in Thread]