diff options
-rw-r--r-- | src/state.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/state.c b/src/state.c index ca71b28..9f2b738 100644 --- a/src/state.c +++ b/src/state.c @@ -66,39 +66,34 @@ struct LilvStateImpl { static int abs_cmp(const void* a, const void* b, void* user_data) { - return strcmp(((const PathMap*)a)->abs, - ((const PathMap*)b)->abs); + return strcmp(((const PathMap*)a)->abs, ((const PathMap*)b)->abs); } static int rel_cmp(const void* a, const void* b, void* user_data) { - return strcmp(((const PathMap*)a)->rel, - ((const PathMap*)b)->rel); -} - -static void -path_rel_free(void* ptr) -{ - free(((PathMap*)ptr)->abs); - free(((PathMap*)ptr)->rel); - free(ptr); + return strcmp(((const PathMap*)a)->rel, ((const PathMap*)b)->rel); } static int property_cmp(const void* a, const void* b) { - const Property* pa = (const Property*)a; - const Property* pb = (const Property*)b; - return pa->key - pb->key; + return ((const Property*)a)->key - ((const Property*)b)->key; } static int value_cmp(const void* a, const void* b) { - const PortValue* pa = (const PortValue*)a; - const PortValue* pb = (const PortValue*)b; - return strcmp(pa->symbol, pb->symbol); + return strcmp(((const PortValue*)a)->symbol, + ((const PortValue*)b)->symbol); +} + +static void +path_rel_free(void* ptr) +{ + free(((PathMap*)ptr)->abs); + free(((PathMap*)ptr)->rel); + free(ptr); } static PortValue* |