Fix some compiler warnings

GCC complains that some variable might be used uninitialized.
This commit is contained in:
Emmanuele Bassi 2010-02-09 16:57:14 +00:00
parent 193c477495
commit d2bdd3cb62
5 changed files with 18 additions and 7 deletions

View File

@ -285,10 +285,12 @@ _clutter_backend_create_stage (ClutterBackend *backend,
stage_manager = clutter_stage_manager_get_default ();
klass = CLUTTER_BACKEND_GET_CLASS (backend);
if (klass->create_stage)
if (klass->create_stage != NULL)
stage_window = klass->create_stage (backend, wrapper, error);
else
stage_window = NULL;
if (!stage_window)
if (stage_window != NULL)
return NULL;
g_assert (CLUTTER_IS_STAGE_WINDOW (stage_window));

View File

@ -459,6 +459,7 @@ clutter_bin_layout_allocate (ClutterLayoutManager *manager,
continue;
}
child_width = child_height = 0;
request = clutter_actor_get_request_mode (child);
if (request == CLUTTER_REQUEST_HEIGHT_FOR_WIDTH)
{

View File

@ -236,6 +236,8 @@ clutter_flow_layout_get_preferred_width (ClutterLayoutManager *manager,
if (children)
line_count = 1;
max_min_width = max_natural_width = 0;
for (l = children; l != NULL; l = l->next)
{
ClutterActor *child = l->data;
@ -385,6 +387,8 @@ clutter_flow_layout_get_preferred_height (ClutterLayoutManager *manager,
if (children)
line_count = 1;
max_min_height = max_natural_height = 0;
for (l = children; l != NULL; l = l->next)
{
ClutterActor *child = l->data;
@ -523,6 +527,8 @@ clutter_flow_layout_allocate (ClutterLayoutManager *manager,
if (!CLUTTER_ACTOR_IS_VISIBLE (child))
continue;
new_x = new_y = 0;
if (priv->orientation == CLUTTER_FLOW_HORIZONTAL)
{
if (line_item_count == items_per_line && line_item_count > 0)

View File

@ -1952,10 +1952,8 @@ clutter_text_real_move_right (ClutterText *self,
{
ClutterTextPrivate *priv = self->priv;
gint pos = priv->position;
gint new_pos;
gint len;
len = priv->n_chars;
gint len = priv->n_chars;
gint new_pos = 0;
g_object_freeze_notify (G_OBJECT (self));

View File

@ -408,19 +408,23 @@ _cogl_matrix_stack_flush_to_gl (CoglMatrixStack *stack,
if (ctx->flushed_matrix_mode != mode)
{
GLenum gl_mode;
GLenum gl_mode = 0;
switch (mode)
{
case COGL_MATRIX_MODELVIEW:
gl_mode = GL_MODELVIEW;
break;
case COGL_MATRIX_PROJECTION:
gl_mode = GL_PROJECTION;
break;
case COGL_MATRIX_TEXTURE:
gl_mode = GL_TEXTURE;
break;
}
GE (glMatrixMode (gl_mode));
ctx->flushed_matrix_mode = mode;
}