Fix warnings about sign conversion (#323)

This commit is contained in:
Rob Loach 2021-08-15 15:30:49 -04:00 committed by GitHub
parent 7ef8fd65cc
commit 0b49ee5db0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 14 deletions

View File

@ -19024,7 +19024,7 @@ nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size)
NK_ASSERT(size >= sizeof(struct nk_page));
if (size < sizeof(struct nk_page)) return;
/* first nk_page_element is embedded in nk_page, additional elements follow in adjacent space */
pool->capacity = 1 + (unsigned)(size - sizeof(struct nk_page)) / sizeof(struct nk_page_element);
pool->capacity = (unsigned)(1 + (size - sizeof(struct nk_page)) / sizeof(struct nk_page_element));
pool->pages = (struct nk_page*)memory;
pool->type = NK_BUFFER_FIXED;
pool->size = size;
@ -19330,8 +19330,8 @@ nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type pan
/* window movement */
if ((win->flags & NK_WINDOW_MOVABLE) && !(win->flags & NK_WINDOW_ROM)) {
int left_mouse_down;
int left_mouse_clicked;
nk_bool left_mouse_down;
unsigned int left_mouse_clicked;
int left_mouse_click_in_cursor;
/* calculate draggable window space */
@ -19346,7 +19346,7 @@ nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type pan
/* window movement by dragging */
left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
left_mouse_clicked = (int)in->mouse.buttons[NK_BUTTON_LEFT].clicked;
left_mouse_clicked = in->mouse.buttons[NK_BUTTON_LEFT].clicked;
left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
NK_BUTTON_LEFT, header, nk_true);
if (left_mouse_down && left_mouse_click_in_cursor && !left_mouse_clicked) {
@ -21865,7 +21865,7 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
layout->bounds.w, layout->row.columns);
#define NK_FRAC(x) (x - (int)x) /* will be used to remove fookin gaps */
#define NK_FRAC(x) (x - (float)(int)x) /* will be used to remove fookin gaps */
/* calculate the width of one item inside the current layout space */
switch (layout->row.type) {
case NK_LAYOUT_DYNAMIC_FIXED: {
@ -25074,7 +25074,7 @@ nk_scrollbar_behavior(nk_flags *state, struct nk_input *in,
{
nk_flags ws = 0;
int left_mouse_down;
int left_mouse_clicked;
unsigned int left_mouse_clicked;
int left_mouse_click_in_cursor;
float scroll_delta;
@ -29508,4 +29508,3 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
/// in libraries and brought me to create some of my own. Finally Apoorva Joshi
/// for his single header file packer.
*/

View File

@ -1,6 +1,6 @@
{
"name": "nuklear",
"version": "4.07.3",
"version": "4.07.4",
"repo": "Immediate-Mode-UI/Nuklear",
"description": "A small ANSI C gui toolkit",
"keywords": ["gl", "ui", "toolkit"],

View File

@ -8,6 +8,7 @@
/// - [yy]: Minor version with non-breaking API and library changes
/// - [zz]: Bug fix version with no direct changes to API
///
/// - 2021/08/15 (4.07.4) - Fix conversion and sign conversion warnings
/// - 2021/08/08 (4.07.3) - Fix crash when baking merged fonts
/// - 2021/08/08 (4.07.2) - Fix Multiline Edit wrong offset
/// - 2021/03/17 (4.07.1) - Fix warning about unused parameter

View File

@ -601,7 +601,7 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
layout->bounds.w, layout->row.columns);
#define NK_FRAC(x) (x - (int)x) /* will be used to remove fookin gaps */
#define NK_FRAC(x) (x - (float)(int)x) /* will be used to remove fookin gaps */
/* calculate the width of one item inside the current layout space */
switch (layout->row.type) {
case NK_LAYOUT_DYNAMIC_FIXED: {

View File

@ -122,8 +122,8 @@ nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type pan
/* window movement */
if ((win->flags & NK_WINDOW_MOVABLE) && !(win->flags & NK_WINDOW_ROM)) {
int left_mouse_down;
int left_mouse_clicked;
nk_bool left_mouse_down;
unsigned int left_mouse_clicked;
int left_mouse_click_in_cursor;
/* calculate draggable window space */
@ -138,7 +138,7 @@ nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type pan
/* window movement by dragging */
left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
left_mouse_clicked = (int)in->mouse.buttons[NK_BUTTON_LEFT].clicked;
left_mouse_clicked = in->mouse.buttons[NK_BUTTON_LEFT].clicked;
left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
NK_BUTTON_LEFT, header, nk_true);
if (left_mouse_down && left_mouse_click_in_cursor && !left_mouse_clicked) {

View File

@ -37,7 +37,7 @@ nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size)
NK_ASSERT(size >= sizeof(struct nk_page));
if (size < sizeof(struct nk_page)) return;
/* first nk_page_element is embedded in nk_page, additional elements follow in adjacent space */
pool->capacity = 1 + (unsigned)(size - sizeof(struct nk_page)) / sizeof(struct nk_page_element);
pool->capacity = (unsigned)(1 + (size - sizeof(struct nk_page)) / sizeof(struct nk_page_element));
pool->pages = (struct nk_page*)memory;
pool->type = NK_BUFFER_FIXED;
pool->size = size;

View File

@ -15,7 +15,7 @@ nk_scrollbar_behavior(nk_flags *state, struct nk_input *in,
{
nk_flags ws = 0;
int left_mouse_down;
int left_mouse_clicked;
unsigned int left_mouse_clicked;
int left_mouse_click_in_cursor;
float scroll_delta;