[freeciv-ai] Re: (PR#10203) Greedy CM algorithm
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10203 >
On Tue, Nov 16, 2004 at 09:49:58PM -0800, Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=10203 >
> Using a cast is unnecessary with a void value, and may disguise an error
> if you accidentally cast the wrong thing (since generally you can cast
> anything). Casts are to be avoided. However not using a cast here is a
> bit ugly, as you see.
Three ideas:
- we can make a special-case in the coding conventions here
- or we can use an extra temporary:
const foo *const *pa = va;
const foo *a = *pa;
- or we can write wrappers around qsort with specvec-like macros so
everything's type-safe.
Probably the last option's the best, but that's future work.
> > I thought this was a gcc extension:
> > + bool marked[lattice->size];
>
> Not anymore. It is part of C99, we have a configure check for it, and
> it's used elsewhere in the code.
Rock on! I'll have to start using that :)
> Here is a new patch. I would like more comments, but I don't think I'm
> up for writing them. If we are to use this in 2.0 this needs to be
> tested out and put into the code ASAP.
I don't have time to look this over right now; if it's down to comments,
I say commit and we can all propose fixes later.
-- Benoît
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, Benoit Hudson, 2004/11/13
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, Vasco Alexandre da Silva Costa, 2004/11/13
- [freeciv-ai] (PR#10203) Greedy CM algorithm, Vasco Alexandre da Silva Costa, 2004/11/13
- [freeciv-ai] (PR#10203) Greedy CM algorithm, Jason Short, 2004/11/16
- [freeciv-ai] (PR#10203) Greedy CM algorithm, Jason Short, 2004/11/17
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, Benoit Hudson, 2004/11/17
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm,
Benoit Hudson <=
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, ue80@xxxxxxxxxxxxxxxxxxxxx, 2004/11/17
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, Jason Short, 2004/11/18
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, Benoit Hudson, 2004/11/18
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, Jason Short, 2004/11/18
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, Jason Short, 2004/11/19
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, Jason Short, 2004/11/18
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, Benoit Hudson, 2004/11/18
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, ue80@xxxxxxxxxxxxxxxxxxxxx, 2004/11/19
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, Benoit Hudson, 2004/11/19
- [freeciv-ai] Re: (PR#10203) Greedy CM algorithm, Gregory Berkolaiko, 2004/11/19
|
|