From 137bd83029458ecd461718a891c74cd1afd8f6cb Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Fri, 13 May 2016 12:41:39 +0530 Subject: index: Fix compiler warning Problem: ---------------------------- index.c:420:18: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare] if (type < 0 || type >= XATTROP_TYPE_END) ~~~~ ^ ~ 1 warning generated. ---------------------------- Fix: Do a type cast before comparing. Change-Id: I65911a05de5f8b5634f1e8cf359c38dad7d125aa BUG: 1335232 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/14318 Reviewed-by: Pranith Kumar Karampuri Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System --- xlators/features/index/src/index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 41d21c50abe..12203f82c56 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -417,7 +417,7 @@ index_dec_link_count (index_priv_t *priv, index_xattrop_type_t type) char* index_get_subdir_from_type (index_xattrop_type_t type) { - if (type < 0 || type >= XATTROP_TYPE_END) + if ((int)type < 0 || (int)type >= (int)XATTROP_TYPE_END) return NULL; return index_subdirs[type]; } -- cgit