Skip to content

Commit

Permalink
fix compiler warnings: bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Samdal committed Feb 7, 2024
1 parent 7c9b32c commit 01c4d40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions gs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7925,7 +7925,7 @@ gs_asset_texture_load_from_file(const char* path, void* out, gs_graphics_texture
stbi_set_flip_vertically_on_load(t->desc.flip_y);
*t->desc.data = (uint8_t*)stbi_load_from_file(f, (int32_t*)&t->desc.width, (int32_t*)&t->desc.height, (int32_t*)&comp, STBI_rgb_alpha);

if (!t->desc.data) {
if (!*t->desc.data) {
fclose(f);
return false;
}
Expand Down Expand Up @@ -7972,7 +7972,7 @@ bool gs_asset_texture_load_from_memory(const void* memory, size_t sz, void* out,
// Load texture data
int32_t num_comps = 0;
bool32_t loaded = gs_util_load_texture_data_from_memory(memory, sz, (int32_t*)&t->desc.width,
(int32_t*)&t->desc.height, (uint32_t*)&num_comps, (void**)&t->desc.data, t->desc.flip_y);
(int32_t*)&t->desc.height, (uint32_t*)&num_comps, t->desc.data, t->desc.flip_y);

if (!loaded) {
return false;
Expand All @@ -7981,7 +7981,7 @@ bool gs_asset_texture_load_from_memory(const void* memory, size_t sz, void* out,
t->hndl = gs_graphics_texture_create(&t->desc);

if (!keep_data) {
gs_free(t->desc.data);
gs_free(*t->desc.data);
*t->desc.data = NULL;
}

Expand Down Expand Up @@ -8721,7 +8721,7 @@ gs_lexer_c_next_token(gs_lexer_t* lex)
)
{
// Grab decimal
num_decimals = lex->at[0] == '.' ? num_decimals++ : num_decimals;
num_decimals = lex->at[0] == '.' ? num_decimals + 1 : num_decimals;

//Increment
lex->at++;
Expand Down Expand Up @@ -8818,7 +8818,7 @@ gs_lexer_c_next_token(gs_lexer_t* lex)
)
{
// Grab decimal
num_decimals = lex->at[0] == '.' ? num_decimals++ : num_decimals;
num_decimals = lex->at[0] == '.' ? num_decimals + 1 : num_decimals;

//Increment
lex->at++;
Expand Down
6 changes: 3 additions & 3 deletions util/gs_gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -5478,7 +5478,7 @@ gs_gui_draw_text(gs_gui_context_t* ctx, gs_asset_font_t* font, const char *str,
} while (0)

// Draw shadow
if (shadow_x || shadow_y && shadow_color.a)
if ((shadow_x || shadow_y) && shadow_color.a)
{
DRAW_TEXT(str, gs_gui_rect(pos.x + (float)shadow_x, pos.y + (float)shadow_y, td.x, td.y), shadow_color);
}
Expand Down Expand Up @@ -7246,8 +7246,8 @@ gs_gui_window_begin_ex(gs_gui_context_t * ctx, const char* title, gs_gui_rect_t
if (tab_bar->focus == tab_item->idx)
{
cnt->flags |= GS_GUI_WINDOW_FLAGS_VISIBLE;
cnt->opt &= !GS_GUI_OPT_NOINTERACT;
cnt->opt &= !GS_GUI_OPT_NOHOVER;
cnt->opt &= ~GS_GUI_OPT_NOINTERACT;
cnt->opt &= ~GS_GUI_OPT_NOHOVER;
}
else
{
Expand Down

0 comments on commit 01c4d40

Please sign in to comment.