Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2005:
[Freeciv-Dev] Re: Strange commit
Home

[Freeciv-Dev] Re: Strange commit

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Strange commit
From: Per Inge Mathisen <per@xxxxxxxxxxx>
Date: Thu, 11 Aug 2005 06:56:43 +0000 (GMT)

On Thu, 11 Aug 2005, Raimar Falke wrote:
> > +case S_HUT:
> > +case S_FORTRESS:
> > +case S_SPECIAL_2:
> > +case S_RIVER:
> > +case S_FARMLAND:
> > +case S_AIRBASE:
> > +case S_FALLOUT:
> > +case S_LAST:
> > +  break;
>
> I think there should be a default branch with an assert.

I prefer it like this, because gcc will give a warning when there is a new
enum that the switch does not catch. It is much easier to find missing
treatments of a new enum this way rather than rely on eyeballs/grep or to
run the game until it asserts (if it ever does during testing).

  - Per




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