Commit 5c4699c2 authored by pkasting's avatar pkasting Committed by Commit bot

Type conversion fixes, tools/ edition.

This is mostly to fix MSVC warnings about possible value truncation.

BUG=81439
TEST=none

Review URL: https://codereview.chromium.org/644433003

Cr-Commit-Position: refs/heads/master@{#300131}
parent fe5c903a
...@@ -114,7 +114,7 @@ int RunGen(const std::vector<std::string>& args) { ...@@ -114,7 +114,7 @@ int RunGen(const std::vector<std::string>& args) {
base::IntToString( base::IntToString(
setup->scheduler().input_file_manager()->GetInputFileCount()) + setup->scheduler().input_file_manager()->GetInputFileCount()) +
" files in " + " files in " +
base::IntToString(elapsed_time.InMilliseconds()) + "ms\n"; base::Int64ToString(elapsed_time.InMilliseconds()) + "ms\n";
OutputString(stats); OutputString(stats);
} }
......
...@@ -132,7 +132,8 @@ std::vector<base::FilePath::StringType> GetPathComponents( ...@@ -132,7 +132,8 @@ std::vector<base::FilePath::StringType> GetPathComponents(
// don't want the slash in there. This doesn't support input like "C:foo" // don't want the slash in there. This doesn't support input like "C:foo"
// which means foo relative to the current directory of the C drive but // which means foo relative to the current directory of the C drive but
// that's basically legacy DOS behavior we don't need to support. // that's basically legacy DOS behavior we don't need to support.
if (result.size() >= 2 && result[1].size() == 1 && IsSlash(result[1][0])) if (result.size() >= 2 && result[1].size() == 1 &&
IsSlash(static_cast<char>(result[1][0])))
result.erase(result.begin() + 1); result.erase(result.begin() + 1);
#endif #endif
......
...@@ -38,7 +38,7 @@ base::FilePath RepoPathToPathName(const std::vector<int>& repo_path) { ...@@ -38,7 +38,7 @@ base::FilePath RepoPathToPathName(const std::vector<int>& repo_path) {
std::string TargetIndexToLetter(int target_index) { std::string TargetIndexToLetter(int target_index) {
char ret[2]; char ret[2];
ret[0] = 'a' + target_index; ret[0] = static_cast<char>('a' + target_index);
ret[1] = 0; ret[1] = 0;
return ret; return ret;
} }
......
...@@ -220,7 +220,7 @@ std::string SummarizeTraces() { ...@@ -220,7 +220,7 @@ std::string SummarizeTraces() {
// possible for more than one to run if more than one build is going in // possible for more than one to run if more than one build is going in
// parallel. Just report the total of all of them. // parallel. Just report the total of all of them.
if (!check_headers.empty()) { if (!check_headers.empty()) {
float check_headers_time = 0; double check_headers_time = 0;
for (const auto& cur : check_headers) for (const auto& cur : check_headers)
check_headers_time += cur->delta().InMillisecondsF(); check_headers_time += cur->delta().InMillisecondsF();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment