Skip to content

Commit

Permalink
Making ecs component internal functions static.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chukobyte committed Feb 8, 2024
1 parent a6590ba commit 7dbab9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions seika/ecs/component.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,40 @@ typedef struct ComponentArray {
void* components[SKA_ECS_MAX_COMPONENTS];
} ComponentArray;

ComponentArray* component_array_create() {
static ComponentArray* component_array_create() {

Check warning on line 50 in seika/ecs/component.c

View workflow job for this annotation

GitHub Actions / build

‘component_array_create’ defined but not used [-Wunused-function]
ComponentArray* componentArray = SE_MEM_ALLOCATE(ComponentArray);
for (unsigned int i = 0; i < SKA_ECS_MAX_COMPONENTS; i++) {
componentArray->components[i] = NULL;
}
return componentArray;
}

void component_array_initialize(ComponentArray* componentArray) {
static void component_array_initialize(ComponentArray* componentArray) {

Check warning on line 58 in seika/ecs/component.c

View workflow job for this annotation

GitHub Actions / build

‘component_array_initialize’ defined but not used [-Wunused-function]
for (unsigned int i = 0; i < SKA_ECS_MAX_COMPONENTS; i++) {
componentArray->components[i] = NULL;
}
}

bool component_array_has_component(ComponentArray* componentArray, SkaComponentIndex index) {
static bool component_array_has_component(ComponentArray* componentArray, SkaComponentIndex index) {
return componentArray->components[index] == NULL ? false : true;
}

void* component_array_get_component(ComponentArray* componentArray, SkaComponentIndex index) {
static void* component_array_get_component(ComponentArray* componentArray, SkaComponentIndex index) {
return componentArray->components[index];
}

void component_array_set_component(ComponentArray* componentArray, SkaComponentIndex index, void* component) {
static void component_array_set_component(ComponentArray* componentArray, SkaComponentIndex index, void* component) {
componentArray->components[index] = component;
}

void component_array_remove_component(ComponentArray* componentArray, SkaComponentIndex index) {
static void component_array_remove_component(ComponentArray* componentArray, SkaComponentIndex index) {
if (component_array_has_component(componentArray, index)) {
SE_MEM_FREE(componentArray->components[index]);
componentArray->components[index] = NULL;
}
}

void component_array_remove_all_components(ComponentArray* componentArray) {
static void component_array_remove_all_components(ComponentArray* componentArray) {
for (size_t i = 0; i < SKA_ECS_MAX_COMPONENTS; i++) {
component_array_remove_component(componentArray, (SkaComponentIndex)i);
}
Expand All @@ -94,7 +94,7 @@ typedef struct ComponentManager {

static ComponentManager* componentManager = NULL;

SkaComponentType component_manager_translate_index_to_type(SkaComponentIndex index);
static SkaComponentType component_manager_translate_index_to_type(SkaComponentIndex index);

void ska_ecs_component_manager_initialize() {
SE_ASSERT(componentNameToTypeMap == NULL);
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "seika",
"version": "0.0.26",
"version": "0.0.27",
"dependencies": [
{
"name": "sdl2",
Expand Down

0 comments on commit 7dbab9f

Please sign in to comment.