diff --git a/component.c b/component.c index a47a2691..0793ecdc 100644 --- a/component.c +++ b/component.c @@ -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); @@ -89,7 +89,7 @@ void* fiftyoneDegreesComponentReadFromFile( offset, &component, sizeof(Component) - sizeof(fiftyoneDegreesComponentKeyValuePair), - getFinalSize, + getFinalComponentSize, exception); } @@ -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); } } } -} \ No newline at end of file +} diff --git a/profile.c b/profile.c index 3706a093..d11ec1cb 100644 --- a/profile.c +++ b/profile.c @@ -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)); @@ -238,7 +238,7 @@ void* fiftyoneDegreesProfileReadFromFile( offset, &profile, sizeof(Profile), - getFinalSize, + getFinalProfileSize, exception); } diff --git a/property.c b/property.c index 7c2a949c..d78a5ee4 100644 --- a/property.c +++ b/property.c @@ -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, diff --git a/string.c b/string.c index f0b73541..5fd281e8 100644 --- a/string.c +++ b/string.c @@ -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)); } @@ -42,7 +42,7 @@ void* fiftyoneDegreesStringRead( offset, &length, sizeof(int16_t), - getFinalSize, + getFinalStringSize, exception); } diff --git a/value.c b/value.c index 1a06b45d..f1ed9061 100644 --- a/value.c +++ b/value.c @@ -31,6 +31,8 @@ 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, @@ -38,6 +40,7 @@ static fiftyoneDegreesString* getString( Exception *exception) { return StringGet(strings, offset, item, exception); } +#endif /* * Function that compare the current String item