Remove some compiler warnings
authorEmmanuele Bassi <ebassi@gnome.org>
Tue, 11 Oct 2011 22:42:23 +0000 (23:42 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 11 Oct 2011 22:42:23 +0000 (23:42 +0100)
Some issues found using clang as the compiler.

clutter/clutter-main.c
clutter/clutter-model.c
clutter/clutter-script-parser.c
clutter/osx/clutter-event-loop-osx.c
clutter/osx/clutter-stage-osx.c

index 2cd5649..7c482c4 100644 (file)
@@ -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");
index 17836c3..346b34f 100644 (file)
@@ -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)",
index 8a33b55..dd36ac9 100644 (file)
@@ -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 */
index 484a88e..d8e6dd6 100644 (file)
@@ -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);
        }
     }
index ecea147..f19dbfc 100644 (file)
@@ -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