[Freeciv-Dev] Re: [Patch] moves_left
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, Feb 12, 2002 at 12:41:12PM +0000, Gregory Berkolaiko wrote:
> --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: >
> > I assume you guess it: moves_left is uses as a boolean comparison. Bla
> > bla bla.
> >
> > Raimar
>
> >
> > - if (!punit->moves_left) return 1;
> > + if (punit->moves_left == 0) return 1;
>
> to be even more fail safe, you can do
> if (punit->moves_left <= 0 ) return 1;
>
> BTW, this all is very nice, but you are fixing the code that is already
> quite ok. How about doing something more challenging / useful ?
As an outsider I would give my vote to Raimar here.
The patches are trivial, so there is little risk of introducing errors,
and they reduce the noise level in splint, allowing the small percentage
of real bugs hiding in such constructs to be detected automatically.
That makes it worthwhile.
--
Reinier
|
|