[Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, 20 Aug 2001, xyzzy@xxxxxxxxxxxxx wrote:
>> int get_player_by_id(struct player *pplayer)
>> {
>> assert(pplayer->player_no >= 0 && pplayer->player_no <
>> game.max_players); return pplayer->player_no;
>> }
>
> This function really makes no sense. What is that assert checking?
> That the player structure pointed to really points to a player
> structure? It's acceptable to de-reference a player pointer to get
> at the fields, no need to create accessor functions for everything.
I think the idea is to get an immediate core dump when pplayer is bad,
rather than funny errors further down because pplayer->player_no does
not make sense.
But I agree that this is not necessary.
--
Big Gaute http://www.srcf.ucam.org/~gs234/
Did YOU find a DIGITAL WATCH in YOUR box of VELVEETA?
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, (continued)
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Kevin Brown, 2001/08/22
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Erik Sigra, 2001/08/22
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Raimar Falke, 2001/08/22
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Gaute B Strokkenes, 2001/08/24
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Raimar Falke, 2001/08/24
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Vasco Alexandre Da Silva Costa, 2001/08/24
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Alan Schmitt, 2001/08/25
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Falk Hueffner, 2001/08/25
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Vasco Alexandre Da Silva Costa, 2001/08/24
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Trent Piepho, 2001/08/20
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand,
Gaute B Strokkenes <=
|
|