Skip to content
  • Robert Mader's avatar
    clutter-box-layout: Use floats and assert on denormal numbers · 72692b11
    Robert Mader authored
    `distribute_natural_allocation` expects an input >= 0 of type `gint`. In
    `get_preferred_size_for_opposite_orientation` it is used with an unchecked
    variable `size` of type `gfloat`, which in case it is `Infinity`, gets
    passed on in the macro `MAX (0, size)`. `Infinity` becomes `G_MININT`
    when implicitly casted to `gint` in `distribute_natural_allocation`,
    triggering the assertion `extra_space >= 0`.
    
    The resulting warning in the log is counter intuitive and not very
    helpful.
    
    Use `float` in `distribute_natural_allocation` instead of `gint` and
    assert on denormal values so we can more easily identify bugs.
    
    Additionally change some types while at it and add a even more
    expressive warning referencing the actor at one point.
    
    GNOME/mutter!375
    72692b11