From 860e9eb8c9ad07721aad4526046753d6fcc3b3ac Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Aug 2012 00:45:46 +0200 Subject: locate: make "tag" unsigned --- src/locate.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/locate.c') diff --git a/src/locate.c b/src/locate.c index e966747fd..c63c48c9d 100644 --- a/src/locate.c +++ b/src/locate.c @@ -33,7 +33,7 @@ /* struct used for search, find, list queries */ struct locate_item { - int8_t tag; + uint8_t tag; /* what we are looking for */ char *needle; }; @@ -49,7 +49,7 @@ struct locate_item_list { struct locate_item items[1]; }; -int +unsigned locate_parse_type(const char *str) { if (0 == g_ascii_strcasecmp(str, LOCATE_TAG_FILE_KEY) || @@ -59,11 +59,7 @@ locate_parse_type(const char *str) if (0 == g_ascii_strcasecmp(str, LOCATE_TAG_ANY_KEY)) return LOCATE_TAG_ANY_TYPE; - enum tag_type i = tag_name_parse_i(str); - if (i != TAG_NUM_OF_ITEM_TYPES) - return i; - - return -1; + return tag_name_parse_i(str); } static bool @@ -73,7 +69,7 @@ locate_item_init(struct locate_item *item, { item->tag = locate_parse_type(type_string); - if (item->tag < 0) + if (item->tag == TAG_NUM_OF_ITEM_TYPES) return false; item->needle = fold_case -- cgit v1.2.3