OSDN Git Service

Reduce Level 4 Build Warnings (7)
authorGreyMerlin <GreyMerlin@gmail.com>
Thu, 26 Jul 2018 22:15:50 +0000 (15:15 -0700)
committerGreyMerlin <GreyMerlin@gmail.com>
Thu, 26 Jul 2018 22:15:50 +0000 (15:15 -0700)
* Another "name hiding" issue (analyze.c)
* various string casting

Externals/poco/Foundation/include/Poco/String.h
Src/Common/unicoder.cpp
Src/diffutils/src/analyze.c
Src/markdown.cpp

index 7f0a4f8..b9506c0 100644 (file)
@@ -166,7 +166,7 @@ S toLower(const S& str)
 
        S result;
        result.reserve(str.size());
-       while (it != end) result += Ascii::toLower(*it++);
+       while (it != end) result += static_cast<S::value_type>(Ascii::toLower(*it++));
        return result;
 }
 
@@ -178,7 +178,7 @@ S& toLowerInPlace(S& str)
        typename S::iterator it  = str.begin();
        typename S::iterator end = str.end();
 
-       while (it != end) { *it = Ascii::toLower(*it); ++it; }
+       while (it != end) { *it = static_cast<S::value_type>(Ascii::toLower(*it)); ++it; }
        return str;
 }
 
@@ -202,8 +202,8 @@ int icompare(
        It end1 = str.begin() + pos + n;
        while (it1 != end1 && it2 != end2)
        {
-        typename S::value_type c1(Ascii::toLower(*it1));
-        typename S::value_type c2(Ascii::toLower(*it2));
+        typename S::value_type c1(static_cast<S::value_type>(Ascii::toLower(*it1)));
+        typename S::value_type c2(static_cast<S::value_type>(Ascii::toLower(*it2)));
         if (c1 < c2)
             return -1;
         else if (c1 > c2)
@@ -313,8 +313,8 @@ int icompare(
        typename S::const_iterator end = str.begin() + pos + n;
        while (it != end && *ptr)
        {
-        typename S::value_type c1(Ascii::toLower(*it));
-        typename S::value_type c2(Ascii::toLower(*ptr));
+        typename S::value_type c1(static_cast<S::value_type>(Ascii::toLower(*it)));
+        typename S::value_type c2(static_cast<S::value_type>(Ascii::toLower(*ptr)));
         if (c1 < c2)
             return -1;
         else if (c1 > c2)
index 5f60fa5..6931dbb 100644 (file)
@@ -276,13 +276,13 @@ void maketchar(String & ch, unsigned unich, bool & lossy, unsigned codepage)
 #ifdef _UNICODE
        if (unich < 0x10000)
        {
-               ch = (TCHAR)unich;
+               ch = static_cast<TCHAR>(unich);
                return;
        }
        else if (unich < 0x110000)
        {
-               ch = ((unich - 0x10000)/0x400 + 0xd800);
-               ch += ((unich % 0x400) + 0xdc00);
+               ch = static_cast<TCHAR>(((unich - 0x10000)/0x400 + 0xd800));
+               ch += static_cast<TCHAR>(((unich % 0x400) + 0xdc00));
                return;
        }
        lossy = TRUE;
index 6fcf879..a4b7ad9 100644 (file)
@@ -832,11 +832,11 @@ briefly_report (int changes, struct file_data const filevec[])
 
 //  Report the differences of two files.  DEPTH is the current directory
 // depth. 
-// WinMerge: add moved_blocks_flag for detecting moved blocks and
+// WinMerge: add bMoved_blocks_flag for detecting moved blocks and
 // bin_file for getting info which file is binary file (can be NULL)
 // Winmerge: assume S_ISREG() files, not pipes, directories or devices
 struct change * diff_2_files (struct file_data filevec[], int depth, int * bin_status,
-       int moved_blocks_flag, int * bin_file)
+       int bMoved_blocks_flag, int * bin_file)
 {
        int diags;
        int i;
@@ -1023,7 +1023,7 @@ struct change * diff_2_files (struct file_data filevec[], int depth, int * bin_s
                }
 
                /* WinMerge moved block support */
-               if (moved_blocks_flag)
+               if (bMoved_blocks_flag)
                {
                        moved_block_analysis(&script, filevec);
                }
index dd7b6cc..7173824 100644 (file)
@@ -144,7 +144,7 @@ std::string CMarkdown::Resolve(const EntityMap &map, const std::string& v)
                        unsigned ordinal = '?';
                        *key = '0';
                        if (NumberParser::tryParseHex(key, ordinal))
-                               value.assign(1, ordinal);
+                               value.assign(1, static_cast<std::string::value_type>(ordinal));
                        *key = '#';
                }
                else