Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9642) TYPED_LIST_ITERATE and macro parameter evaluatio
Home

[Freeciv-Dev] (PR#9642) TYPED_LIST_ITERATE and macro parameter evaluatio

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9642) TYPED_LIST_ITERATE and macro parameter evaluation
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 8 Aug 2004 22:56:38 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9642 >

TYPED_LIST_ITERATE takes a list, not a pointer to a list.  I'm not quite 
sure why that is.  It only evaluates this value once.  However if it 
were to evaluate more than once we'd have a problem.  We don't want to 
copy the whole value just to avoid multiple evaluation.  But neither do 
we want to evaluate it more than once.

This is a problem in unit_list_iterate_safe.  This iterator also takes a 
list.  However it has to evaluate it multiple times.  This is 
theoretically bad.

IMO these iterators should all take a pointer to a list.  That's what 
all the functions take.  I always get confused when using them because I 
write the code to pass a pointer to a list, and of course it doesn't work.

jason




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#9642) TYPED_LIST_ITERATE and macro parameter evaluation, Jason Short <=