[group] avoid double evaluation of arguments in clutter_group_add

clutter_group_add would evaluate the actor argument twice, which is
bad if this is a function call creating a new actor and not a variable.
This commit is contained in:
Øyvind Kolås 2009-04-08 18:18:31 +01:00
parent a9f24351e9
commit 269598a2cf

View File

@ -106,10 +106,10 @@ void clutter_group_remove_all (ClutterGroup *group);
/* for Mr. Mallum */
#define clutter_group_add(group,actor) G_STMT_START { \
if (CLUTTER_IS_GROUP ((group)) && CLUTTER_IS_ACTOR ((actor))) \
ClutterActor *_actor = (ClutterActor *) (actor); \
if (CLUTTER_IS_GROUP ((group)) && CLUTTER_IS_ACTOR ((_actor))) \
{ \
ClutterContainer *_container = (ClutterContainer *) (group); \
ClutterActor *_actor = (ClutterActor *) (actor); \
clutter_container_add_actor (_container, _actor); \
} } G_STMT_END