diff options
author | Leandro Pereira <leandro@hardinfo.org> | 2019-07-06 13:20:08 -0700 |
---|---|---|
committer | Leandro Pereira <leandro@hardinfo.org> | 2019-07-06 13:20:08 -0700 |
commit | 3970c1d1a2ef425b281e823b8ee6dc2aaebdc138 (patch) | |
tree | 6b5dfc0c4d1e7d594e61398f0eaaebfe9a3f6215 /includes/info.h | |
parent | 923c5437bf22ce32c656016095e758f9bd93615d (diff) |
Cleanup group comparison functions
Reduce code repetition by using an array of GCompareFunc function
pointers.
Diffstat (limited to 'includes/info.h')
-rw-r--r-- | includes/info.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/info.h b/includes/info.h index f2d442f4..f85ab39c 100644 --- a/includes/info.h +++ b/includes/info.h @@ -21,7 +21,7 @@ #include <stdarg.h> #include <glib.h> -enum { +enum InfoGroupSort { INFO_GROUP_SORT_NONE, INFO_GROUP_SORT_NAME_ASCENDING, INFO_GROUP_SORT_NAME_DESCENDING, @@ -29,6 +29,7 @@ enum { INFO_GROUP_SORT_VALUE_DESCENDING, INFO_GROUP_SORT_TAG_ASCENDING, INFO_GROUP_SORT_TAG_DESCENDING, + INFO_GROUP_SORT_MAX, }; struct Info { @@ -47,7 +48,7 @@ struct Info { struct InfoGroup { const gchar *name; - int sort; + enum InfoGroupSort sort; GArray *fields; |