[gtk/matthiasc/for-master: 23/26] bitmask: add an assertion



commit 0f096d6ad99330b73c34370f15aff39190539a19
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon May 25 17:18:27 2020 -0400

    bitmask: add an assertion
    
    The static analysis in ci is complaining about
    this, since it doesn't know that start is always
    smaller than end.

 gtk/gtkbitmaskprivateimpl.h | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gtk/gtkbitmaskprivateimpl.h b/gtk/gtkbitmaskprivateimpl.h
index 3a16e178fc..d9598528c5 100644
--- a/gtk/gtkbitmaskprivateimpl.h
+++ b/gtk/gtkbitmaskprivateimpl.h
@@ -124,6 +124,8 @@ _gtk_bitmask_invert_range (GtkBitmask *mask,
                            guint       start,
                            guint       end)
 {
+  g_assert (start <= end);
+
   if (_gtk_bitmask_is_allocated (mask) ||
       (end > GTK_BITMASK_N_DIRECT_BITS))
     return _gtk_allocated_bitmask_invert_range (mask, start, end);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]