* 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.
This commit is contained in:
Neil Roberts 2008-07-30 10:32:25 +00:00
parent 51563ba73e
commit d6496254d6
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,13 @@
2008-07-30 Neil Roberts <neil@o-hand.com>
* 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.
2008-07-26 Neil Roberts <neil@o-hand.com>
* clutter/clutter-timeline.c (clutter_timeline_list_markers): When

View File

@ -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;