More ISO C90 warning fixes in Clutter

This time, in Clutter core.

The ObjC standard library provides a type called 'id', which obviously
requires any library to either drop the useful shadowed variable warning
or stop using 'id' as a variable name.

Yes, it's almost unbearably stupid. Well, at least it's not 'index' in
string.h, or 'y2' in math.h.
This commit is contained in:
Emmanuele Bassi 2011-02-15 11:50:26 +00:00
parent 54a4511247
commit 5c398c18ad
16 changed files with 144 additions and 141 deletions

View File

@ -8600,13 +8600,13 @@ parse_actor_metas (ClutterScript *script,
for (l = elements; l != NULL; l = l->next) for (l = elements; l != NULL; l = l->next)
{ {
JsonNode *element = l->data; JsonNode *element = l->data;
const gchar *id = _clutter_script_get_id_from_node (element); const gchar *id_ = _clutter_script_get_id_from_node (element);
GObject *meta; GObject *meta;
if (id == NULL || *id == '\0') if (id_ == NULL || *id_ == '\0')
continue; continue;
meta = clutter_script_get_object (script, id); meta = clutter_script_get_object (script, id_);
if (meta == NULL) if (meta == NULL)
continue; continue;
@ -8634,13 +8634,13 @@ parse_behaviours (ClutterScript *script,
for (l = elements; l != NULL; l = l->next) for (l = elements; l != NULL; l = l->next)
{ {
JsonNode *element = l->data; JsonNode *element = l->data;
const gchar *id = _clutter_script_get_id_from_node (element); const gchar *id_ = _clutter_script_get_id_from_node (element);
GObject *behaviour; GObject *behaviour;
if (id == NULL || *id == '\0') if (id_ == NULL || *id_ == '\0')
continue; continue;
behaviour = clutter_script_get_object (script, id); behaviour = clutter_script_get_object (script, id_);
if (behaviour == NULL) if (behaviour == NULL)
continue; continue;

View File

@ -497,7 +497,7 @@ gboolean clutter_actor_event (ClutterActor
ClutterEvent *event, ClutterEvent *event,
gboolean capture); gboolean capture);
ClutterActor * clutter_get_actor_by_gid (guint32 id); ClutterActor * clutter_get_actor_by_gid (guint32 id_);
gboolean clutter_actor_set_shader (ClutterActor *self, gboolean clutter_actor_set_shader (ClutterActor *self,
ClutterShader *shader); ClutterShader *shader);

View File

@ -1533,7 +1533,7 @@ parse_animator_property (JsonArray *array,
JsonObject *object; JsonObject *object;
JsonArray *keys; JsonArray *keys;
GObject *gobject; GObject *gobject;
const gchar *id, *pname; const gchar *id_, *pname;
GObjectClass *klass; GObjectClass *klass;
GParamSpec *pspec; GParamSpec *pspec;
GSList *valid_keys = NULL; GSList *valid_keys = NULL;
@ -1563,11 +1563,11 @@ parse_animator_property (JsonArray *array,
return; return;
} }
id = json_object_get_string_member (object, "object"); id_ = json_object_get_string_member (object, "object");
gobject = clutter_script_get_object (clos->script, id); gobject = clutter_script_get_object (clos->script, id_);
if (gobject == NULL) if (gobject == NULL)
{ {
g_warning ("No object with id '%s' has been defined.", id); g_warning ("No object with id '%s' has been defined.", id_);
return; return;
} }
@ -1579,7 +1579,7 @@ parse_animator_property (JsonArray *array,
g_warning ("The object of type '%s' and name '%s' has no " g_warning ("The object of type '%s' and name '%s' has no "
"property named '%s'", "property named '%s'",
G_OBJECT_TYPE_NAME (gobject), G_OBJECT_TYPE_NAME (gobject),
id, id_,
pname); pname);
return; return;
} }

View File

@ -69,46 +69,48 @@ clutter_id_pool_add (ClutterIDPool *id_pool,
gpointer ptr) gpointer ptr)
{ {
gpointer *array; gpointer *array;
guint32 id; guint32 retval;
g_return_val_if_fail (id_pool != NULL, 0); g_return_val_if_fail (id_pool != NULL, 0);
if (id_pool->free_ids) /* There are items on our freelist, reuse one */ if (id_pool->free_ids) /* There are items on our freelist, reuse one */
{ {
array = (void*) id_pool->array->data; array = (void*) id_pool->array->data;
id = GPOINTER_TO_UINT (id_pool->free_ids->data); retval = GPOINTER_TO_UINT (id_pool->free_ids->data);
id_pool->free_ids = g_slist_remove (id_pool->free_ids, id_pool->free_ids = g_slist_remove (id_pool->free_ids,
id_pool->free_ids->data); id_pool->free_ids->data);
array[id] = ptr; array[retval] = ptr;
return id; return retval;
} }
/* Allocate new id */ /* Allocate new id */
id = id_pool->array->len; retval = id_pool->array->len;
g_array_append_val (id_pool->array, ptr); g_array_append_val (id_pool->array, ptr);
return id;
return retval;
} }
void void
clutter_id_pool_remove (ClutterIDPool *id_pool, clutter_id_pool_remove (ClutterIDPool *id_pool,
guint32 id) guint32 id_)
{ {
gpointer *array; gpointer *array;
g_return_if_fail (id_pool != NULL); g_return_if_fail (id_pool != NULL);
array = (void*) id_pool->array->data; array = (void*) id_pool->array->data;
array[id] = (void*)0xdecafbad; /* set pointer to a recognizably voided /* set pointer to a recognizably voided value */
value */ array[id_] = (void*)0xdecafbad;
id_pool->free_ids = g_slist_prepend (id_pool->free_ids, id_pool->free_ids = g_slist_prepend (id_pool->free_ids,
GUINT_TO_POINTER (id)); GUINT_TO_POINTER (id_));
} }
gpointer gpointer
clutter_id_pool_lookup (ClutterIDPool *id_pool, clutter_id_pool_lookup (ClutterIDPool *id_pool,
guint32 id) guint32 id_)
{ {
gpointer *array; gpointer *array;
@ -117,14 +119,14 @@ clutter_id_pool_lookup (ClutterIDPool *id_pool,
array = (void*) id_pool->array->data; array = (void*) id_pool->array->data;
if (id >= id_pool->array->len || array[id] == NULL) if (id_ >= id_pool->array->len || array[id_] == NULL)
{ {
g_warning ("The required ID of %u does not refer to an existing actor; " g_warning ("The required ID of %u does not refer to an existing actor; "
"this usually implies that the pick() of an actor is not " "this usually implies that the pick() of an actor is not "
"correctly implemented or that there is an error in the " "correctly implemented or that there is an error in the "
"glReadPixels() implementation of the GL driver.", id); "glReadPixels() implementation of the GL driver.", id_);
return NULL; return NULL;
} }
return array[id]; return array[id_];
} }

View File

@ -34,15 +34,15 @@ G_BEGIN_DECLS
typedef struct _ClutterIDPool ClutterIDPool; typedef struct _ClutterIDPool ClutterIDPool;
ClutterIDPool *clutter_id_pool_new (guint initial_size); ClutterIDPool *clutter_id_pool_new (guint initial_size);
void clutter_id_pool_free (ClutterIDPool *id_pool); void clutter_id_pool_free (ClutterIDPool *id_pool);
guint32 clutter_id_pool_add (ClutterIDPool *id_pool, guint32 clutter_id_pool_add (ClutterIDPool *id_pool,
gpointer ptr); gpointer ptr);
void clutter_id_pool_remove (ClutterIDPool *id_pool, void clutter_id_pool_remove (ClutterIDPool *id_pool,
guint32 id); guint32 id_);
gpointer clutter_id_pool_lookup (ClutterIDPool *id_pool, gpointer clutter_id_pool_lookup (ClutterIDPool *id_pool,
guint32 id); guint32 id_);
G_END_DECLS G_END_DECLS

View File

@ -335,17 +335,18 @@ clutter_get_motion_events_enabled (void)
} }
static inline ClutterActor * static inline ClutterActor *
_clutter_actor_get_by_id (guint32 id) _clutter_actor_get_by_id (guint32 actor_id)
{ {
ClutterMainContext *context = _clutter_context_get_default (); ClutterMainContext *context = _clutter_context_get_default ();
g_assert (context->id_pool != NULL); g_assert (context->id_pool != NULL);
return clutter_id_pool_lookup (context->id_pool, id); return clutter_id_pool_lookup (context->id_pool, actor_id);
} }
void void
_clutter_id_to_color (guint id, ClutterColor *col) _clutter_id_to_color (guint id_,
ClutterColor *col)
{ {
ClutterMainContext *ctx; ClutterMainContext *ctx;
gint red, green, blue; gint red, green, blue;
@ -373,11 +374,11 @@ _clutter_id_to_color (guint id, ClutterColor *col)
} }
/* compute the numbers we'll store in the components */ /* compute the numbers we'll store in the components */
red = (id >> (ctx->fb_g_mask_used+ctx->fb_b_mask_used)) red = (id_ >> (ctx->fb_g_mask_used+ctx->fb_b_mask_used))
& (0xff >> (8-ctx->fb_r_mask_used)); & (0xff >> (8-ctx->fb_r_mask_used));
green = (id >> ctx->fb_b_mask_used) green = (id_ >> ctx->fb_b_mask_used)
& (0xff >> (8-ctx->fb_g_mask_used)); & (0xff >> (8-ctx->fb_g_mask_used));
blue = (id) blue = (id_)
& (0xff >> (8-ctx->fb_b_mask_used)); & (0xff >> (8-ctx->fb_b_mask_used));
/* shift left bits a bit and add one, this circumvents /* shift left bits a bit and add one, this circumvents
@ -419,7 +420,7 @@ _clutter_pixel_to_id (guchar pixel[4])
{ {
ClutterMainContext *ctx; ClutterMainContext *ctx;
gint red, green, blue; gint red, green, blue;
guint id; guint retval;
ctx = _clutter_context_get_default (); ctx = _clutter_context_get_default ();
@ -455,16 +456,17 @@ _clutter_pixel_to_id (guchar pixel[4])
blue = blue >> (ctx->fb_b_mask - ctx->fb_b_mask_used); blue = blue >> (ctx->fb_b_mask - ctx->fb_b_mask_used);
/* combine the correct per component values into the final id */ /* combine the correct per component values into the final id */
id = blue retval = blue
+ (green << ctx->fb_b_mask_used) + (green << ctx->fb_b_mask_used)
+ (red << (ctx->fb_b_mask_used + ctx->fb_g_mask_used)); + (red << (ctx->fb_b_mask_used + ctx->fb_g_mask_used));
return id; return retval;
} }
#ifdef USE_GDKPIXBUF #ifdef USE_GDKPIXBUF
static void static void
pixbuf_free (guchar *pixels, gpointer data) pixbuf_free (guchar *pixels,
gpointer data)
{ {
g_free (pixels); g_free (pixels);
} }
@ -537,7 +539,7 @@ _clutter_do_pick (ClutterStage *stage,
ClutterMainContext *context; ClutterMainContext *context;
guchar pixel[4] = { 0xff, 0xff, 0xff, 0xff }; guchar pixel[4] = { 0xff, 0xff, 0xff, 0xff };
CoglColor stage_pick_id; CoglColor stage_pick_id;
guint32 id; guint32 id_;
GLboolean dither_was_on; GLboolean dither_was_on;
ClutterActor *actor; ClutterActor *actor;
gboolean is_clipped; gboolean is_clipped;
@ -606,8 +608,8 @@ _clutter_do_pick (ClutterStage *stage,
goto result; goto result;
} }
id = _clutter_pixel_to_id (pixel); id_ = _clutter_pixel_to_id (pixel);
actor = _clutter_actor_get_by_id (id); actor = _clutter_actor_get_by_id (id_);
goto result; goto result;
} }
@ -698,8 +700,8 @@ _clutter_do_pick (ClutterStage *stage,
goto result; goto result;
} }
id = _clutter_pixel_to_id (pixel); id_ = _clutter_pixel_to_id (pixel);
actor = _clutter_actor_get_by_id (id); actor = _clutter_actor_get_by_id (id_);
result: result:
@ -2565,9 +2567,9 @@ _clutter_process_event (ClutterEvent *event)
/** /**
* clutter_get_actor_by_gid: * clutter_get_actor_by_gid:
* @id: a #ClutterActor ID. * @id_: a #ClutterActor unique id.
* *
* Retrieves the #ClutterActor with @id. * Retrieves the #ClutterActor with @id_.
* *
* Return value: (transfer none): the actor with the passed id or %NULL. * Return value: (transfer none): the actor with the passed id or %NULL.
* The returned actor does not have its reference count increased. * The returned actor does not have its reference count increased.
@ -2575,9 +2577,9 @@ _clutter_process_event (ClutterEvent *event)
* Since: 0.6 * Since: 0.6
*/ */
ClutterActor * ClutterActor *
clutter_get_actor_by_gid (guint32 id) clutter_get_actor_by_gid (guint32 id_)
{ {
return _clutter_actor_get_by_id (id); return _clutter_actor_get_by_id (id_);
} }
void void
@ -2713,7 +2715,7 @@ clutter_grab_pointer (ClutterActor *actor)
/** /**
* clutter_grab_pointer_for_device: * clutter_grab_pointer_for_device:
* @actor: a #ClutterActor * @actor: a #ClutterActor
* @id: a device id, or -1 * @id_: a device id, or -1
* *
* Grabs all the pointer events coming from the device @id for @actor. * Grabs all the pointer events coming from the device @id for @actor.
* *
@ -2723,22 +2725,21 @@ clutter_grab_pointer (ClutterActor *actor)
*/ */
void void
clutter_grab_pointer_for_device (ClutterActor *actor, clutter_grab_pointer_for_device (ClutterActor *actor,
gint id) gint id_)
{ {
ClutterInputDevice *dev; ClutterInputDevice *dev;
g_return_if_fail (actor == NULL || CLUTTER_IS_ACTOR (actor)); g_return_if_fail (actor == NULL || CLUTTER_IS_ACTOR (actor));
/* essentially a global grab */ /* essentially a global grab */
if (id == -1) if (id_ == -1)
{ {
clutter_grab_pointer (actor); clutter_grab_pointer (actor);
return; return;
} }
dev = clutter_get_input_device_for_id (id); dev = clutter_get_input_device_for_id (id_);
if (dev == NULL)
if (!dev)
return; return;
if (dev->pointer_grab_actor == actor) if (dev->pointer_grab_actor == actor)
@ -2778,16 +2779,16 @@ clutter_ungrab_pointer (void)
/** /**
* clutter_ungrab_pointer_for_device: * clutter_ungrab_pointer_for_device:
* @id: a device id * @id_: a device id
* *
* Removes an existing grab of the pointer events for device @id. * Removes an existing grab of the pointer events for device @id_.
* *
* Since: 0.8 * Since: 0.8
*/ */
void void
clutter_ungrab_pointer_for_device (gint id) clutter_ungrab_pointer_for_device (gint id_)
{ {
clutter_grab_pointer_for_device (NULL, id); clutter_grab_pointer_for_device (NULL, id_);
} }
@ -3012,9 +3013,9 @@ clutter_get_font_flags (void)
/** /**
* clutter_get_input_device_for_id: * clutter_get_input_device_for_id:
* @id: the unique id for a device * @id_: the unique id for a device
* *
* Retrieves the #ClutterInputDevice from its @id. This is a convenience * Retrieves the #ClutterInputDevice from its @id_. This is a convenience
* wrapper for clutter_device_manager_get_device() and it is functionally * wrapper for clutter_device_manager_get_device() and it is functionally
* equivalent to: * equivalent to:
* *
@ -3031,13 +3032,13 @@ clutter_get_font_flags (void)
* Since: 0.8 * Since: 0.8
*/ */
ClutterInputDevice * ClutterInputDevice *
clutter_get_input_device_for_id (gint id) clutter_get_input_device_for_id (gint id_)
{ {
ClutterDeviceManager *manager; ClutterDeviceManager *manager;
manager = clutter_device_manager_get_default (); manager = clutter_device_manager_get_default ();
return clutter_device_manager_get_device (manager, id); return clutter_device_manager_get_device (manager, id_);
} }
/** /**

View File

@ -159,12 +159,12 @@ void clutter_clear_glyph_cache (void);
void clutter_set_font_flags (ClutterFontFlags flags); void clutter_set_font_flags (ClutterFontFlags flags);
ClutterFontFlags clutter_get_font_flags (void); ClutterFontFlags clutter_get_font_flags (void);
ClutterInputDevice *clutter_get_input_device_for_id (gint id); ClutterInputDevice *clutter_get_input_device_for_id (gint id_);
void clutter_grab_pointer_for_device (ClutterActor *actor, void clutter_grab_pointer_for_device (ClutterActor *actor,
gint id); gint id_);
void clutter_ungrab_pointer_for_device (gint id); void clutter_ungrab_pointer_for_device (gint id_);
PangoFontMap * clutter_get_font_map (void); PangoFontMap * clutter_get_font_map (void);

View File

@ -555,14 +555,14 @@ find_entry_by_timeline (ClutterScore *score,
static GNode * static GNode *
find_entry_by_id (ClutterScore *score, find_entry_by_id (ClutterScore *score,
gulong id) gulong id_)
{ {
ClutterScorePrivate *priv = score->priv; ClutterScorePrivate *priv = score->priv;
TraverseClosure closure; TraverseClosure closure;
closure.action = FIND_BY_ID; closure.action = FIND_BY_ID;
closure.score = score; closure.score = score;
closure.d.id = id; closure.d.id = id_;
closure.result = NULL; closure.result = NULL;
g_node_traverse (priv->root, g_node_traverse (priv->root,
@ -1010,7 +1010,7 @@ clutter_score_append_at_marker (ClutterScore *score,
/** /**
* clutter_score_remove: * clutter_score_remove:
* @score: a #ClutterScore * @score: a #ClutterScore
* @id: the id of the timeline to remove * @id_: the id of the timeline to remove
* *
* Removes the #ClutterTimeline with the given id inside @score. If * Removes the #ClutterTimeline with the given id inside @score. If
* the timeline has other timelines attached to it, those are removed * the timeline has other timelines attached to it, those are removed
@ -1020,19 +1020,19 @@ clutter_score_append_at_marker (ClutterScore *score,
*/ */
void void
clutter_score_remove (ClutterScore *score, clutter_score_remove (ClutterScore *score,
gulong id) gulong id_)
{ {
ClutterScorePrivate *priv; ClutterScorePrivate *priv;
TraverseClosure closure; TraverseClosure closure;
g_return_if_fail (CLUTTER_IS_SCORE (score)); g_return_if_fail (CLUTTER_IS_SCORE (score));
g_return_if_fail (id > 0); g_return_if_fail (id_ > 0);
priv = score->priv; priv = score->priv;
closure.action = REMOVE_BY_ID; closure.action = REMOVE_BY_ID;
closure.score = score; closure.score = score;
closure.d.id = id; closure.d.id = id_;
closure.result = NULL; closure.result = NULL;
g_node_traverse (priv->root, g_node_traverse (priv->root,
@ -1075,9 +1075,9 @@ clutter_score_remove_all (ClutterScore *score)
/** /**
* clutter_score_get_timeline: * clutter_score_get_timeline:
* @score: a #ClutterScore * @score: a #ClutterScore
* @id: the id of the timeline * @id_: the id of the timeline
* *
* Retrieves the #ClutterTimeline for @id inside @score. * Retrieves the #ClutterTimeline for @id_ inside @score.
* *
* Return value: (transfer none): the requested timeline, or %NULL. This * Return value: (transfer none): the requested timeline, or %NULL. This
* function does not increase the reference count on the returned * function does not increase the reference count on the returned
@ -1087,15 +1087,15 @@ clutter_score_remove_all (ClutterScore *score)
*/ */
ClutterTimeline * ClutterTimeline *
clutter_score_get_timeline (ClutterScore *score, clutter_score_get_timeline (ClutterScore *score,
gulong id) gulong id_)
{ {
GNode *node; GNode *node;
ClutterScoreEntry *entry; ClutterScoreEntry *entry;
g_return_val_if_fail (CLUTTER_IS_SCORE (score), NULL); g_return_val_if_fail (CLUTTER_IS_SCORE (score), NULL);
g_return_val_if_fail (id > 0, NULL); g_return_val_if_fail (id_ > 0, NULL);
node = find_entry_by_id (score, id); node = find_entry_by_id (score, id_);
if (G_UNLIKELY (!node)) if (G_UNLIKELY (!node))
return NULL; return NULL;

View File

@ -112,10 +112,10 @@ gulong clutter_score_append_at_marker (ClutterScore *score,
const gchar *marker_name, const gchar *marker_name,
ClutterTimeline *timeline); ClutterTimeline *timeline);
void clutter_score_remove (ClutterScore *score, void clutter_score_remove (ClutterScore *score,
gulong id); gulong id_);
void clutter_score_remove_all (ClutterScore *score); void clutter_score_remove_all (ClutterScore *score);
ClutterTimeline *clutter_score_get_timeline (ClutterScore *score, ClutterTimeline *clutter_score_get_timeline (ClutterScore *score,
gulong id); gulong id_);
GSList * clutter_score_list_timelines (ClutterScore *score); GSList * clutter_score_list_timelines (ClutterScore *score);
void clutter_score_start (ClutterScore *score); void clutter_score_start (ClutterScore *score);

View File

@ -528,11 +528,11 @@ parse_children (ObjectInfo *oinfo,
for (i = 0; i < array_len; i++) for (i = 0; i < array_len; i++)
{ {
JsonNode *child = json_array_get_element (array, i); JsonNode *child = json_array_get_element (array, i);
const gchar *id; const gchar *id_;
id = _clutter_script_get_id_from_node (child); id_ = _clutter_script_get_id_from_node (child);
if (id) if (id_ != NULL)
retval = g_list_prepend (retval, g_strdup (id)); retval = g_list_prepend (retval, g_strdup (id_));
} }
return g_list_reverse (retval); return g_list_reverse (retval);
@ -820,10 +820,10 @@ _clutter_script_parse_alpha (ClutterScript *script,
if (JSON_NODE_TYPE (val) == JSON_NODE_VALUE && if (JSON_NODE_TYPE (val) == JSON_NODE_VALUE &&
json_node_get_string (val) != NULL) json_node_get_string (val) != NULL)
{ {
const gchar *id = json_node_get_string (val); const gchar *id_ = json_node_get_string (val);
timeline = timeline =
CLUTTER_TIMELINE (clutter_script_get_object (script, id)); CLUTTER_TIMELINE (clutter_script_get_object (script, id_));
} }
else if (JSON_NODE_TYPE (val) == JSON_NODE_OBJECT) else if (JSON_NODE_TYPE (val) == JSON_NODE_OBJECT)
{ {
@ -833,7 +833,7 @@ _clutter_script_parse_alpha (ClutterScript *script,
} }
val = json_object_get_member (object, "mode"); val = json_object_get_member (object, "mode");
if (val) if (val != NULL)
mode = clutter_script_resolve_animation_mode (val); mode = clutter_script_resolve_animation_mode (val);
if (mode == CLUTTER_CUSTOM_MODE) if (mode == CLUTTER_CUSTOM_MODE)
@ -884,7 +884,7 @@ clutter_script_parser_object_end (JsonParser *json_parser,
ClutterScript *script = parser->script; ClutterScript *script = parser->script;
ObjectInfo *oinfo; ObjectInfo *oinfo;
JsonNode *val; JsonNode *val;
const gchar *id; const gchar *id_;
GList *members, *l; GList *members, *l;
/* if the object definition does not have an 'id' field we'll /* if the object definition does not have an 'id' field we'll
@ -922,17 +922,17 @@ clutter_script_parser_object_end (JsonParser *json_parser,
return; return;
} }
id = json_object_get_string_member (object, "id"); id_ = json_object_get_string_member (object, "id");
CLUTTER_NOTE (SCRIPT, "Getting object info for object '%s'", id); CLUTTER_NOTE (SCRIPT, "Getting object info for object '%s'", id_);
oinfo = _clutter_script_get_object_info (script, id); oinfo = _clutter_script_get_object_info (script, id_);
if (oinfo == NULL) if (oinfo == NULL)
{ {
const gchar *class_name; const gchar *class_name;
oinfo = g_slice_new0 (ObjectInfo); oinfo = g_slice_new0 (ObjectInfo);
oinfo->merge_id = _clutter_script_get_last_merge_id (script); oinfo->merge_id = _clutter_script_get_last_merge_id (script);
oinfo->id = g_strdup (id); oinfo->id = g_strdup (id_);
class_name = json_object_get_string_member (object, "type"); class_name = json_object_get_string_member (object, "type");
oinfo->class_name = g_strdup (class_name); oinfo->class_name = g_strdup (class_name);
@ -1075,7 +1075,7 @@ clutter_script_parse_node (ClutterScript *script,
{ {
GType p_type; GType p_type;
ObjectInfo *oinfo; ObjectInfo *oinfo;
const gchar *id; const gchar *id_;
if (G_IS_VALUE (value)) if (G_IS_VALUE (value))
p_type = G_VALUE_TYPE (value); p_type = G_VALUE_TYPE (value);
@ -1092,11 +1092,11 @@ clutter_script_parse_node (ClutterScript *script,
* definitions are parsed leaf-first we are guaranteed * definitions are parsed leaf-first we are guaranteed
* to have a defined object at this point * to have a defined object at this point
*/ */
id = _clutter_script_get_id_from_node (node); id_ = _clutter_script_get_id_from_node (node);
if (id == NULL || *id == '\0') if (id_ == NULL || *id_ == '\0')
return FALSE; return FALSE;
oinfo = _clutter_script_get_object_info (script, id); oinfo = _clutter_script_get_object_info (script, id_);
if (oinfo == NULL || oinfo->gtype == G_TYPE_INVALID ) if (oinfo == NULL || oinfo->gtype == G_TYPE_INVALID )
return FALSE; return FALSE;
@ -1806,13 +1806,13 @@ _clutter_script_check_unresolved (ClutterScript *script,
{ {
GObject *child = l->data; GObject *child = l->data;
ObjectInfo *child_info; ObjectInfo *child_info;
const gchar *id; const gchar *id_;
id = clutter_get_script_id (child); id_ = clutter_get_script_id (child);
if (id == NULL || *id == '\0') if (id_ == NULL || *id_ == '\0')
continue; continue;
child_info = _clutter_script_get_object_info (script, id); child_info = _clutter_script_get_object_info (script, id_);
if (child_info == NULL) if (child_info == NULL)
continue; continue;

View File

@ -1196,7 +1196,7 @@ _clutter_script_generate_fake_id (ClutterScript *script)
/* /*
* _clutter_script_warn_missing_attribute: * _clutter_script_warn_missing_attribute:
* @script: a #ClutterScript * @script: a #ClutterScript
* @id: the id of an object definition, or %NULL * @id_: the id of an object definition, or %NULL
* @attribute: the expected attribute * @attribute: the expected attribute
* *
* Emits a warning, using GLib's log facilities, for a missing * Emits a warning, using GLib's log facilities, for a missing
@ -1205,19 +1205,19 @@ _clutter_script_generate_fake_id (ClutterScript *script)
*/ */
void void
_clutter_script_warn_missing_attribute (ClutterScript *script, _clutter_script_warn_missing_attribute (ClutterScript *script,
const gchar *id, const gchar *id_,
const gchar *attribute) const gchar *attribute)
{ {
ClutterScriptPrivate *priv = script->priv; ClutterScriptPrivate *priv = script->priv;
JsonParser *parser = JSON_PARSER (priv->parser); JsonParser *parser = JSON_PARSER (priv->parser);
gint current_line = json_parser_get_current_line (parser); gint current_line = json_parser_get_current_line (parser);
if (id != NULL && *id != '\0') if (id_ != NULL && *id_ != '\0')
{ {
g_warning ("%s:%d: object '%s' has no '%s' attribute", g_warning ("%s:%d: object '%s' has no '%s' attribute",
priv->is_filename ? priv->filename : "<input>", priv->is_filename ? priv->filename : "<input>",
current_line, current_line,
id, id_,
attribute); attribute);
} }
else else

View File

@ -63,9 +63,9 @@ clutter_scriptable_default_init (ClutterScriptableInterface *iface)
/** /**
* clutter_scriptable_set_id: * clutter_scriptable_set_id:
* @scriptable: a #ClutterScriptable * @scriptable: a #ClutterScriptable
* @id: the #ClutterScript id of the object * @id_: the #ClutterScript id of the object
* *
* Sets @id as the unique Clutter script it for this instance of * Sets @id_ as the unique Clutter script it for this instance of
* #ClutterScriptableIface. * #ClutterScriptableIface.
* *
* This name can be used by user interface designer applications to * This name can be used by user interface designer applications to
@ -76,20 +76,20 @@ clutter_scriptable_default_init (ClutterScriptableInterface *iface)
*/ */
void void
clutter_scriptable_set_id (ClutterScriptable *scriptable, clutter_scriptable_set_id (ClutterScriptable *scriptable,
const gchar *id) const gchar *id_)
{ {
ClutterScriptableIface *iface; ClutterScriptableIface *iface;
g_return_if_fail (CLUTTER_IS_SCRIPTABLE (scriptable)); g_return_if_fail (CLUTTER_IS_SCRIPTABLE (scriptable));
g_return_if_fail (id != NULL); g_return_if_fail (id_ != NULL);
iface = CLUTTER_SCRIPTABLE_GET_IFACE (scriptable); iface = CLUTTER_SCRIPTABLE_GET_IFACE (scriptable);
if (iface->set_id) if (iface->set_id)
iface->set_id (scriptable, id); iface->set_id (scriptable, id_);
else else
g_object_set_data_full (G_OBJECT (scriptable), g_object_set_data_full (G_OBJECT (scriptable),
"clutter-script-id", "clutter-script-id",
g_strdup (id), g_strdup (id_),
g_free); g_free);
} }

View File

@ -73,7 +73,7 @@ struct _ClutterScriptableIface
/*< public >*/ /*< public >*/
void (* set_id) (ClutterScriptable *scriptable, void (* set_id) (ClutterScriptable *scriptable,
const gchar *id); const gchar *id_);
const gchar *(* get_id) (ClutterScriptable *scriptable); const gchar *(* get_id) (ClutterScriptable *scriptable);
gboolean (* parse_custom_node) (ClutterScriptable *scriptable, gboolean (* parse_custom_node) (ClutterScriptable *scriptable,
@ -90,7 +90,7 @@ struct _ClutterScriptableIface
GType clutter_scriptable_get_type (void) G_GNUC_CONST; GType clutter_scriptable_get_type (void) G_GNUC_CONST;
void clutter_scriptable_set_id (ClutterScriptable *scriptable, void clutter_scriptable_set_id (ClutterScriptable *scriptable,
const gchar *id); const gchar *id_);
G_CONST_RETURN gchar *clutter_scriptable_get_id (ClutterScriptable *scriptable); G_CONST_RETURN gchar *clutter_scriptable_get_id (ClutterScriptable *scriptable);
gboolean clutter_scriptable_parse_custom_node (ClutterScriptable *scriptable, gboolean clutter_scriptable_parse_custom_node (ClutterScriptable *scriptable,
ClutterScript *script, ClutterScript *script,

View File

@ -1865,13 +1865,13 @@ parse_state_transition (JsonArray *array,
if (json_object_has_member (object, "animator")) if (json_object_has_member (object, "animator"))
{ {
const gchar *id = json_object_get_string_member (object, "animator"); const gchar *id_ = json_object_get_string_member (object, "animator");
GObject *animator; GObject *animator;
animator = clutter_script_get_object (clos->script, id); animator = clutter_script_get_object (clos->script, id_);
if (animator == NULL) if (animator == NULL)
{ {
g_warning ("No object with id '%s' has been defined.", id); g_warning ("No object with id '%s' has been defined.", id_);
return; return;
} }
@ -1907,16 +1907,16 @@ parse_state_transition (JsonArray *array,
ClutterStateKey *state_key; ClutterStateKey *state_key;
GObject *gobject; GObject *gobject;
GParamSpec *pspec; GParamSpec *pspec;
const gchar *id; const gchar *id_;
const gchar *property; const gchar *property;
gulong mode; gulong mode;
gboolean res; gboolean res;
id = json_array_get_string_element (key, 0); id_ = json_array_get_string_element (key, 0);
gobject = clutter_script_get_object (clos->script, id); gobject = clutter_script_get_object (clos->script, id_);
if (gobject == NULL) if (gobject == NULL)
{ {
g_warning ("No object with id '%s' has been defined.", id); g_warning ("No object with id '%s' has been defined.", id_);
continue; continue;
} }
@ -1928,7 +1928,7 @@ parse_state_transition (JsonArray *array,
g_warning ("The object of type '%s' and name '%s' has no " g_warning ("The object of type '%s' and name '%s' has no "
"property named '%s'.", "property named '%s'.",
G_OBJECT_TYPE_NAME (gobject), G_OBJECT_TYPE_NAME (gobject),
id, id_,
property); property);
continue; continue;
} }
@ -1949,7 +1949,7 @@ parse_state_transition (JsonArray *array,
g_warning ("Unable to parse the key value for the " g_warning ("Unable to parse the key value for the "
"property '%s' of object '%s' at index %d", "property '%s' of object '%s' at index %d",
property, property,
id, id_,
index_); index_);
clutter_state_key_free (state_key); clutter_state_key_free (state_key);
continue; continue;

View File

@ -463,9 +463,9 @@ clutter_timeout_pool_add (ClutterTimeoutPool *pool,
/** /**
* clutter_timeout_pool_remove: * clutter_timeout_pool_remove:
* @pool: a #ClutterTimeoutPool * @pool: a #ClutterTimeoutPool
* @id: the id of the timeout to remove * @id_: the id of the timeout to remove
* *
* Removes a timeout function with @id from the timeout pool. The id * Removes a timeout function with @id_ from the timeout pool. The id
* is the same returned when adding a function to the timeout pool with * is the same returned when adding a function to the timeout pool with
* clutter_timeout_pool_add(). * clutter_timeout_pool_add().
* *
@ -475,18 +475,18 @@ clutter_timeout_pool_add (ClutterTimeoutPool *pool,
*/ */
void void
clutter_timeout_pool_remove (ClutterTimeoutPool *pool, clutter_timeout_pool_remove (ClutterTimeoutPool *pool,
guint id) guint id_)
{ {
GList *l; GList *l;
if ((l = g_list_find_custom (pool->timeouts, GUINT_TO_POINTER (id), if ((l = g_list_find_custom (pool->timeouts, GUINT_TO_POINTER (id_),
clutter_timeout_find_by_id))) clutter_timeout_find_by_id)))
{ {
clutter_timeout_unref (l->data); clutter_timeout_unref (l->data);
pool->timeouts = g_list_delete_link (pool->timeouts, l); pool->timeouts = g_list_delete_link (pool->timeouts, l);
} }
else if ((l = g_list_find_custom (pool->dispatched_timeouts, else if ((l = g_list_find_custom (pool->dispatched_timeouts,
GUINT_TO_POINTER (id), GUINT_TO_POINTER (id_),
clutter_timeout_find_by_id))) clutter_timeout_find_by_id)))
{ {
clutter_timeout_unref (l->data); clutter_timeout_unref (l->data);

View File

@ -60,7 +60,7 @@ guint clutter_timeout_pool_add (ClutterTimeoutPool *pool,
gpointer data, gpointer data,
GDestroyNotify notify); GDestroyNotify notify);
void clutter_timeout_pool_remove (ClutterTimeoutPool *pool, void clutter_timeout_pool_remove (ClutterTimeoutPool *pool,
guint id); guint id_);
#endif /* CLUTTER_DISABLE_DEPRECATED */ #endif /* CLUTTER_DISABLE_DEPRECATED */