Immediate-Mode-UI / Nuklear

A single-header ANSI C immediate mode cross-platform GUI library
https://immediate-mode-ui.github.io/Nuklear/doc/index.html
Other
9.17k stars 553 forks source link

Incorrect returned value in nk_group_scrolled_offset_begin #581

Open krys-g opened 11 months ago

krys-g commented 11 months ago

As of version 4.10.6, compiling nuklear.h with #define NK_INCLUDE_STANDARD_BOOL yields the following warning: enum constant in boolean context [-Wint-in-bool-context]

The issue stems from NK_API nk_bool nk_group_scrolled_offset_begin():

        if (f & NK_WINDOW_CLOSED)
            return NK_WINDOW_CLOSED;
        if (f & NK_WINDOW_MINIMIZED)
            return NK_WINDOW_MINIMIZED;

Given that the function is expected to return "true(1) if visible and fillable with widgets or false(0) otherwise", I'm guessing the two return should be merged into a single return false instead? Currently the conversion from the nk_window_flags enum to bool would return true.