[gnome-commander] src/utils.cc: fix for -Wsign-compare
- From: Uwe Scholz <uwescholz src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-commander] src/utils.cc: fix for -Wsign-compare
 
- Date: Fri, 28 Apr 2017 21:45:19 +0000 (UTC)
 
commit 449e69c0a51801529531c43176e4f4fdbec83b35
Author: Mamoru TASAKA <mtasaka fedoraproject org>
Date:   Sat Apr 29 01:41:03 2017 +0900
    src/utils.cc: fix for -Wsign-compare
    
    src/utils.cc:1467:40: error: comparison between signed and unsigned integer expressions 
[-Werror=sign-compare]
       for (int end; (end=s.find(sep,start))!=string::npos; ++n)
    
    string::npos is size_t (and actually s.find is also size_t)
 src/utils.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/utils.cc b/src/utils.cc
index 99374e6..4a96f6b 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -1464,7 +1464,7 @@ int split(const string &s, vector<string> &coll, const char *sep)
   int n = 1;
   int start = 0;
 
-  for (int end; (end=s.find(sep,start))!=string::npos; ++n)
+  for (int end; (size_t)(end=s.find(sep,start))!=string::npos; ++n)
   {
     coll.push_back(string(s,start,end-start));
     start = end + seplen;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]