Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] Re: (PR#6781) Cleanups
Home

[Freeciv-Dev] Re: (PR#6781) Cleanups

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#6781) Cleanups
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Thu, 13 Nov 2003 11:53:26 -0800
Reply-to: rt@xxxxxxxxxxx

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

On Thu, Nov 06, 2003 at 05:30:46AM -0800, rt@xxxxxxxxxxx wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=6781 >
> 
> 
> The attached patch:
>  - changes assert(p) to assert(p!=NULL). The old version gives
>  compiler warnings on 64bit systems.
>  - add some bool related cleanups
>  - rerun create_lsend.pl

I have applied the obvious cases.

> In addition there are some cases where I'm not sure what to do:
> 
> 1)
> ai/advdiplomacy.c: (in function greed)
> ai/advdiplomacy.c:107:22: Initializer block for band_incr has 5 elements, but 
> declared as int [6]: 5, 5, 10, 20, 30
> ai/advdiplomacy.c:108:25: Initializer block for band_rate has 6 elements, but 
> declared as int [7]: 10, 25, 50, 100, 250, 500

This one is still open.

Per please comment.

> 2)
> ai/aiunit.c:591:134: Expression has undefined behavior (left operand
> uses errno, modified by right operand): log(most_desirable / ((((100 *
> 5 * 81 + 100 * (9 - 5) * 51) + 1) + 1) + (100 * 5 * 81 + 100 * (9 - 5)
> * 51))) / log(0.6)
> Code has unspecified behavior. Order of evaluation of function
> parameters or subexpressions is not defined, so if a value is used and
> modi fied in different places not separated by a sequence point
> constraining evaluation order, then the result of the expression is
> unspecified.

After further thinking about I think the change isn't worth it.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "We've all heard that a million monkeys banging on a million typewriters
  will eventually reproduce the entire works of Shakespeare.
  Now, thanks to the Internet, we know this is not true."




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