From 193b345786f2ae3c2a518f3ca9dac719386992a4 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 11 Oct 2011 23:42:23 +0100 Subject: [PATCH] Remove some compiler warnings Some issues found using clang as the compiler. --- clutter/clutter-main.c | 2 +- clutter/clutter-model.c | 12 ++++++------ clutter/clutter-script-parser.c | 2 +- clutter/osx/clutter-event-loop-osx.c | 4 ++-- clutter/osx/clutter-stage-osx.c | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index 2cd5649cc..7c482c4f7 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -684,7 +684,7 @@ clutter_context_get_pango_fontmap (void) static ClutterTextDirection clutter_get_text_direction (void) { - PangoDirection dir = PANGO_DIRECTION_LTR; + ClutterTextDirection dir = CLUTTER_TEXT_DIRECTION_LTR; const gchar *direction; direction = g_getenv ("CLUTTER_TEXT_DIRECTION"); diff --git a/clutter/clutter-model.c b/clutter/clutter-model.c index 17836c316..346b34fa1 100644 --- a/clutter/clutter-model.c +++ b/clutter/clutter-model.c @@ -232,7 +232,7 @@ clutter_model_real_get_column_type (ClutterModel *model, { ClutterModelPrivate *priv = model->priv; - if (column < 0 || column >= clutter_model_get_n_columns (model)) + if (column >= clutter_model_get_n_columns (model)) return G_TYPE_INVALID; return priv->column_types[column]; @@ -244,7 +244,7 @@ clutter_model_real_get_column_name (ClutterModel *model, { ClutterModelPrivate *priv = model->priv; - if (column < 0 || column >= clutter_model_get_n_columns (model)) + if (column >= clutter_model_get_n_columns (model)) return NULL; if (priv->column_names && priv->column_names[column]) @@ -1390,7 +1390,7 @@ clutter_model_get_column_name (ClutterModel *model, g_return_val_if_fail (CLUTTER_IS_MODEL (model), NULL); - if (column < 0 || column >= clutter_model_get_n_columns (model)) + if (column >= clutter_model_get_n_columns (model)) { g_warning ("%s: Invalid column id value %d\n", G_STRLOC, column); return NULL; @@ -1422,7 +1422,7 @@ clutter_model_get_column_type (ClutterModel *model, g_return_val_if_fail (CLUTTER_IS_MODEL (model), G_TYPE_INVALID); - if (column < 0 || column >= clutter_model_get_n_columns (model)) + if (column >= clutter_model_get_n_columns (model)) { g_warning ("%s: Invalid column id value %d\n", G_STRLOC, column); return G_TYPE_INVALID; @@ -2003,7 +2003,7 @@ clutter_model_iter_set_internal_valist (ClutterModelIter *iter, gchar *error = NULL; GType col_type; - if (column < 0 || column >= clutter_model_get_n_columns (model)) + if (column >= clutter_model_get_n_columns (model)) { g_warning ("%s: Invalid column number %d added to iter " "(remember to end you list of columns with a -1)", @@ -2169,7 +2169,7 @@ clutter_model_iter_get_valist (ClutterModelIter *iter, gchar *error = NULL; GType col_type; - if (column < 0 || column >= clutter_model_get_n_columns (model)) + if (column >= clutter_model_get_n_columns (model)) { g_warning ("%s: Invalid column number %d added to iter " "(remember to end you list of columns with a -1)", diff --git a/clutter/clutter-script-parser.c b/clutter/clutter-script-parser.c index 8a33b55c3..dd36ac944 100644 --- a/clutter/clutter-script-parser.c +++ b/clutter/clutter-script-parser.c @@ -1937,7 +1937,7 @@ void _clutter_script_construct_object (ClutterScript *script, ObjectInfo *oinfo) { - GArray *params; + GArray *params = NULL; guint i; /* we have completely updated the object */ diff --git a/clutter/osx/clutter-event-loop-osx.c b/clutter/osx/clutter-event-loop-osx.c index 484a88e7f..d8e6dd6e4 100644 --- a/clutter/osx/clutter-event-loop-osx.c +++ b/clutter/osx/clutter-event-loop-osx.c @@ -524,8 +524,8 @@ select_thread_start_poll (GPollFD *ufds, have_new_pollfds = TRUE; else { - if (!((nfds == 1 && poll_fd_index < 0 && g_thread_supported ()) || - (nfds == 2 && poll_fd_index >= 0 && g_thread_supported ()))) + if (!((nfds == 1 && poll_fd_index < 0) || + (nfds == 2 && poll_fd_index >= 0))) select_thread_set_state (POLLING_RESTART); } } diff --git a/clutter/osx/clutter-stage-osx.c b/clutter/osx/clutter-stage-osx.c index ecea1476f..f19dbfcb8 100644 --- a/clutter/osx/clutter-stage-osx.c +++ b/clutter/osx/clutter-stage-osx.c @@ -135,7 +135,7 @@ clutter_stage_osx_get_wrapper (ClutterStageWindow *stage_window); - (void)windowDidChangeScreen:(NSNotification *)notification { - clutter_redraw(CLUTTER_STAGE(self->stage_osx->wrapper)); + clutter_stage_ensure_redraw (CLUTTER_STAGE(self->stage_osx->wrapper)); } @end