Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2000:
[Freeciv-Dev] Re: Inconsistent function names and arguments
Home

[Freeciv-Dev] Re: Inconsistent function names and arguments

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Inconsistent function names and arguments
From: Jeff Mallatt <jjm@xxxxxxxxxxxx>
Date: Thu, 27 Jul 2000 09:01:34 -0400

At 2000/07/24 09:37 , Raimar Falke wrote:
>On Mon, Jul 24, 2000 at 06:56:44AM -0400, Jeff Mallatt wrote:
>> How about replacing the tech and unit functions with:
>> 
>> tech.h
>> ------
>> 
>> /* same as current tech_flag() */
>> int tech_type_has_flag(Tech_Type_id tech_type, enum tech_flag_id flag);
>> 
>> unit.h
>> ------
>> 
>> /* same as current unit_flag() */
>> int unit_type_has_flag(Unit_Type_id unit_type, enum unit_flag_id flag);
>> 
>> /* this takes a pointer to a unit, not to a unit type */
>> int unit_has_flag(struct unit *punit, enum unit_flag_id flag);
>> 
>> Many calls currently look like:
>>    unit_flag(punit->type, ...)
>> replace them with:
>>    unit_has_flag(punit, ...)
>> 
>> And, replace all the rest of the unit_flag() calls with
unit_type_has_flag().
>
>This were the changes I had in mind. I thing is IMHO missing: the difference
>between poiners and ids:
>
>int unit_has_flag(Unit_Type_id unit_id, enum unit_flag_id flag);
>int punit_has_flag(struct unit *punit, enum unit_flag_id flag);

This difference is the difference between ????_has_flag and
????_type_has_flag in my proposal.  It's just subjective, but I don't like
the name punit_has_flag.

jjm




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