Skip to content

Commit

Permalink
#70 fix compiler warnings in strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Sep 9, 2019
1 parent 7bcf93f commit ae6b357
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/entity.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,7 @@ void ecs_set_watch(
ecs_stage_t *stage,
ecs_entity_t entity)
{
(void)world;
ecs_row_t row = row_from_stage(stage, entity);

if (row.index > 0) {
Expand Down Expand Up @@ -1037,7 +1038,6 @@ ecs_entity_t _ecs_new(

static
bool has_unset_columns(
ecs_world_t *world,
ecs_type_t type,
ecs_table_column_t *columns,
ecs_table_data_t *data)
Expand All @@ -1046,7 +1046,7 @@ bool has_unset_columns(
return true;
}

int i;
uint32_t i;
for (i = 0; i < data->column_count; i ++) {
/* If no column is provided for component, skip it */
ecs_entity_t component = data->components[i];
Expand All @@ -1071,7 +1071,6 @@ bool has_unset_columns(

static
void copy_column_data(
ecs_world_t *world,
ecs_type_t type,
ecs_table_column_t *columns,
uint32_t start_row,
Expand Down Expand Up @@ -1198,7 +1197,7 @@ uint32_t update_entity_index(
* must be copied from the old table to the new table */
if (!tested_for_unset) {
has_unset = has_unset_columns(
world, type, columns, data);
type, columns, data);
}

if (has_unset) {
Expand Down Expand Up @@ -1338,7 +1337,7 @@ ecs_entity_t set_w_data_intern(

/* If columns were provided, copy data from columns into table */
if (data->columns) {
copy_column_data(world, type, columns, start_row, data);
copy_column_data(type, columns, start_row, data);
}

ecs_entity_info_t info = {
Expand Down
3 changes: 1 addition & 2 deletions src/stage.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ void clean_data_stage(
*(ecs_table_column_t**)ecs_map_next_w_key(&it, &keyval);

ecs_type_t type = (ecs_type_t)(uintptr_t)keyval;
uint32_t count = ecs_vector_count(type);
uint32_t i, count = ecs_vector_count(type);

int i;
for(i = 0; i < count + 1; i ++) {
ecs_vector_free(columns[i].data);
}
Expand Down
1 change: 1 addition & 0 deletions src/table.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ void ecs_table_free(
ecs_world_t *world,
ecs_table_t *table)
{
(void)world;
ecs_table_free_columns(table);
ecs_os_free(table->columns);
ecs_vector_free(table->frame_systems);
Expand Down
2 changes: 1 addition & 1 deletion src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ typedef struct EcsSystem {

int32_t cascade_by; /* CASCADE column index */
EcsSystemKind kind; /* Kind of system */
float time_spent; /* Time spent on running system */
double time_spent; /* Time spent on running system */
bool enabled; /* Is system enabled or not */
bool has_refs; /* Does the system have reference columns */
bool needs_tables; /* Does the system need table matching */
Expand Down

0 comments on commit ae6b357

Please sign in to comment.