Skip to content

Commit

Permalink
Merged Pull Request '#36 make-clib-amalgamable->main : Guard conflict…
Browse files Browse the repository at this point in the history
…ing statics'

Guard conflicting statics
  • Loading branch information
Automation51D authored Nov 30, 2023
2 parents 6b287a7 + e94a0f9 commit 0a5f01a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
8 changes: 4 additions & 4 deletions component.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "fiftyone.h"

static uint32_t getFinalSize(void *initial) {
static uint32_t getFinalComponentSize(void *initial) {
Component *component = (Component*)initial;
int32_t trailing = (component->keyValuesCount - 1) * sizeof(fiftyoneDegreesComponentKeyValuePair);
return (uint32_t)(sizeof(Component) + trailing);
Expand Down Expand Up @@ -89,7 +89,7 @@ void* fiftyoneDegreesComponentReadFromFile(
offset,
&component,
sizeof(Component) - sizeof(fiftyoneDegreesComponentKeyValuePair),
getFinalSize,
getFinalComponentSize,
exception);
}

Expand Down Expand Up @@ -117,8 +117,8 @@ void fiftyoneDegreesComponentInitList(
ListAdd(list, &item);

// Move to the next component in the collection.
offset += getFinalSize((void*)component);
offset += getFinalComponentSize((void*)component);
}
}
}
}
}
4 changes: 2 additions & 2 deletions profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

MAP_TYPE(Collection)

static uint32_t getFinalSize(void *initial) {
static uint32_t getFinalProfileSize(void *initial) {
Profile *profile = (Profile*)initial;
return sizeof(Profile) +
(profile->valueCount * sizeof(uint32_t));
Expand Down Expand Up @@ -238,7 +238,7 @@ void* fiftyoneDegreesProfileReadFromFile(
offset,
&profile,
sizeof(Profile),
getFinalSize,
getFinalProfileSize,
exception);
}

Expand Down
5 changes: 4 additions & 1 deletion property.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@

MAP_TYPE(Collection)

static String* getString(
#ifndef FIFTYONE_DEGREES_GET_STRING_DEFINED
#define FIFTYONE_DEGREES_GET_STRING_DEFINED
static fiftyoneDegreesString* getString(
Collection *stringsCollection,
uint32_t offset,
Item *item,
Exception *exception) {
return StringGet(stringsCollection, offset, item, exception);
}
#endif

fiftyoneDegreesString* fiftyoneDegreesPropertyGetName(
fiftyoneDegreesCollection *stringsCollection,
Expand Down
4 changes: 2 additions & 2 deletions string.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "fiftyone.h"

static uint32_t getFinalSize(void *initial) {
static uint32_t getFinalStringSize(void *initial) {
return (uint32_t)(sizeof(int16_t) + (*(int16_t*)initial));
}

Expand All @@ -42,7 +42,7 @@ void* fiftyoneDegreesStringRead(
offset,
&length,
sizeof(int16_t),
getFinalSize,
getFinalStringSize,
exception);
}

Expand Down
3 changes: 3 additions & 0 deletions value.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ typedef struct value_search_t {
const char *valueName;
} valueSearch;

#ifndef FIFTYONE_DEGREES_GET_STRING_DEFINED
#define FIFTYONE_DEGREES_GET_STRING_DEFINED
static fiftyoneDegreesString* getString(
Collection *strings,
uint32_t offset,
Item *item,
Exception *exception) {
return StringGet(strings, offset, item, exception);
}
#endif

/*
* Function that compare the current String item
Expand Down

0 comments on commit 0a5f01a

Please sign in to comment.