From f32a24d50e041a16a2ecf4457d00589b208251a9 Mon Sep 17 00:00:00 2001 From: GreyMerlin Date: Thu, 26 Jul 2018 15:15:50 -0700 Subject: [PATCH] Reduce Level 4 Build Warnings (7) * Another "name hiding" issue (analyze.c) * various string casting --- Externals/poco/Foundation/include/Poco/String.h | 12 ++++++------ Src/Common/unicoder.cpp | 6 +++--- Src/diffutils/src/analyze.c | 6 +++--- Src/markdown.cpp | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Externals/poco/Foundation/include/Poco/String.h b/Externals/poco/Foundation/include/Poco/String.h index 7f0a4f894..b9506c0df 100644 --- a/Externals/poco/Foundation/include/Poco/String.h +++ b/Externals/poco/Foundation/include/Poco/String.h @@ -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(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(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(Ascii::toLower(*it1))); + typename S::value_type c2(static_cast(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(Ascii::toLower(*it))); + typename S::value_type c2(static_cast(Ascii::toLower(*ptr))); if (c1 < c2) return -1; else if (c1 > c2) diff --git a/Src/Common/unicoder.cpp b/Src/Common/unicoder.cpp index 5f60fa579..6931dbbe2 100644 --- a/Src/Common/unicoder.cpp +++ b/Src/Common/unicoder.cpp @@ -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(unich); return; } else if (unich < 0x110000) { - ch = ((unich - 0x10000)/0x400 + 0xd800); - ch += ((unich % 0x400) + 0xdc00); + ch = static_cast(((unich - 0x10000)/0x400 + 0xd800)); + ch += static_cast(((unich % 0x400) + 0xdc00)); return; } lossy = TRUE; diff --git a/Src/diffutils/src/analyze.c b/Src/diffutils/src/analyze.c index 6fcf8792f..a4b7ad92a 100644 --- a/Src/diffutils/src/analyze.c +++ b/Src/diffutils/src/analyze.c @@ -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); } diff --git a/Src/markdown.cpp b/Src/markdown.cpp index dd7b6cc2f..717382410 100644 --- a/Src/markdown.cpp +++ b/Src/markdown.cpp @@ -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(ordinal)); *key = '#'; } else -- 2.11.0