Skip to content

Commit

Permalink
warnings cleanup, fix pqueue crash
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFrenik committed May 15, 2024
1 parent b86f742 commit 4f13bfd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions gs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2495,7 +2495,7 @@ typedef uint32_t gs_slot_map_iter;
#define gs_pqueue_child_right_idx(I) ((I * 2) + 2)

GS_API_DECL void**
gs_pqueue_init(void** pq);
gs_pqueue_init(void** pq, size_t sz);

#define gs_pqueue_init_all(__PQ, __V)\
(gs_pqueue_init((void**)&(__PQ), sizeof(*(__PQ))), gs_dyn_array_init((void**)&((__PQ)->priority), sizeof(int32_t)),\
Expand All @@ -2514,7 +2514,7 @@ gs_pqueue_init(void** pq);
} while (0)

#define gs_pqueue_empty(__PQ)\
(!gs_pqueue_size(__PQ))
(!(__PQ) || !gs_pqueue_size(__PQ))

#define __gs_pqueue_swp(__PQ, __I0, __I1, __SZ)\
do {\
Expand Down Expand Up @@ -6707,7 +6707,8 @@ typedef struct gs_context_t
gs_audio_t* audio;
gs_app_desc_t app;
gs_os_api_t os;
} gs_context_t;
gs_atomic_int_t lock;
} gs_context_t;

typedef struct gs_t
{
Expand Down Expand Up @@ -8844,6 +8845,7 @@ GS_API_DECL bool gs_token_compare_type(const gs_token_t* t, gs_token_type type)

GS_API_DECL bool gs_token_compare_text(const gs_token_t* t, const char* match)
{
if (t->len != gs_string_length(match)) return false;
return (gs_string_compare_equal_n(t->text, match, t->len));
}

Expand Down Expand Up @@ -9336,6 +9338,8 @@ gs_create(gs_app_desc_t app_desc)
_gs_instance = (gs_t*)os.malloc(sizeof(gs_t));
memset(_gs_instance, 0, sizeof(gs_t));

gs_instance()->ctx.lock = SCHED_PIPE_INVALID;

// Set os api now allocated
gs_instance()->ctx.os = os;

Expand Down
2 changes: 1 addition & 1 deletion util/gs_gfxt.h
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@ gs_gfxt_mesh_t gs_gfxt_mesh_unit_quad_generate(gs_gfxt_mesh_import_options_t* op
mesh.desc = mdesc;

// Free data
gs_dyn_array_free(mesh_data.primitives);
if (mesh_data.primitives) gs_dyn_array_free(mesh_data.primitives);

return mesh;
}
Expand Down

0 comments on commit 4f13bfd

Please sign in to comment.