diff options
author | Neil Roberts <neil@openedhand.com> | 2008-07-30 10:32:25 +0000 |
---|---|---|
committer | Neil Roberts <neil@openedhand.com> | 2008-07-30 10:32:25 +0000 |
commit | d6496254d647c4bcf13757da4a71a4bf64f406b0 (patch) | |
tree | ca7140b0150a6e171d9ccd43aaff50218a65d292 /clutter/clutter-model.c | |
parent | 51563ba73eb13e42e8dfea803288eb3827ab1f2d (diff) | |
download | clutter-d6496254d647c4bcf13757da4a71a4bf64f406b0.tar.gz |
* clutter/clutter-model.c (clutter_model_set_sorting_column): This
function is supposed to accept -1 to disable sorting. However it
checks for whether the column is >= the number of columns, but
clutter_model_get_n_columns() returns an unsigned int so the
column number also gets promoted to unsigned for the
comparison. Therefore -1 is always greater than the number of
columns so it wouldn't let you set it.
Diffstat (limited to 'clutter/clutter-model.c')
-rw-r--r-- | clutter/clutter-model.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clutter/clutter-model.c b/clutter/clutter-model.c index ecfe9d6ce..c301d56cd 100644 --- a/clutter/clutter-model.c +++ b/clutter/clutter-model.c @@ -1220,7 +1220,9 @@ clutter_model_set_sorting_column (ClutterModel *model, g_return_if_fail (CLUTTER_IS_MODEL (model)); priv = model->priv; - if (column >= clutter_model_get_n_columns (model)) + /* The extra comparison for >= 0 is because column gets promoted to + unsigned in the second comparison */ + if (column >= 0 && column >= clutter_model_get_n_columns (model)) { g_warning ("%s: Invalid column id value %d\n", G_STRLOC, column); return; |