[gtk/matthiasc/for-master: 9/10] bitset: Correct preconditions in gtk_bitset_add_rectangle
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 9/10] bitset: Correct preconditions in gtk_bitset_add_rectangle
- Date: Mon, 29 Jun 2020 01:40:23 +0000 (UTC)
commit 02d4d3e9ff453bcdb9141d63a00bad9c6bdb4aab
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jun 28 21:28:47 2020 -0400
bitset: Correct preconditions in gtk_bitset_add_rectangle
We want to make sure that the rectangle fits in the grid.
gtk/gtkbitset.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkbitset.c b/gtk/gtkbitset.c
index c4116bd87c..d6fc7c8cd0 100644
--- a/gtk/gtkbitset.c
+++ b/gtk/gtkbitset.c
@@ -399,7 +399,7 @@ gtk_bitset_add_rectangle (GtkBitset *self,
guint i;
g_return_if_fail (self != NULL);
- g_return_if_fail (width <= stride);
+ g_return_if_fail ((start % stride) + width <= stride);
g_return_if_fail (G_MAXUINT - start >= height * stride);
if (width == 0 || height == 0)
@@ -664,7 +664,7 @@ G_STATIC_ASSERT (sizeof (GtkBitsetIter) >= sizeof (roaring_uint32_iterator_t));
/**
* gtk_bitset_iter_init_first:
- * @iter: (out): a pointer to a preallocated #GtkBitsetIter
+ * @iter: (out): a pointer to an uninitialized #GtkBitsetIter
* @set: a #GtkBitset
* @value: (out) (optional): Set to the first value in @set
*
@@ -694,7 +694,7 @@ gtk_bitset_iter_init_first (GtkBitsetIter *iter,
/**
* gtk_bitset_iter_init_last:
- * @iter: (out): a pointer to a preallocated #GtkBitsetIter
+ * @iter: (out): a pointer to an uninitialized #GtkBitsetIter
* @set: a #GtkBitset
* @value: (out) (optional): Set to the last value in @set
*
@@ -723,7 +723,7 @@ gtk_bitset_iter_init_last (GtkBitsetIter *iter,
/**
* gtk_bitset_iter_init_at:
- * @iter: a #GtkBitsetIter
+ * @iter: (out): a pointer to an uninitialized #GtkBitsetIter
* @set: a #GtkBitset
* @target: target value to start iterating at
* @value: (out) (optional): Set to the found value in @set
@@ -851,7 +851,7 @@ gtk_bitset_iter_get_value (const GtkBitsetIter *iter)
* gtk_bitset_iter_is_valid:
* @iter: a #GtkBitsetIter
*
- * Checks if @iter points to a valid value
+ * Checks if @iter points to a valid value.
*
* Returns: %TRUE if @iter points to a valid value
**/
@@ -864,4 +864,3 @@ gtk_bitset_iter_is_valid (const GtkBitsetIter *iter)
return riter->has_value;
}
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]