summaryrefslogtreecommitdiffstats
path: root/src/util.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-08-10 20:27:08 (GMT)
committerEvan Martin <martine@danga.com>2012-08-10 20:44:40 (GMT)
commitd58a10965610eb6b338e411ce816b810d76ab59e (patch)
treef5e9627cb0fcd0c2f62665388fa93f284ba318ee /src/util.cc
parentd98ba72ef8adfb1698b8de197de6751c8b14d5c0 (diff)
downloadNinja-d58a10965610eb6b338e411ce816b810d76ab59e.zip
Ninja-d58a10965610eb6b338e411ce816b810d76ab59e.tar.gz
Ninja-d58a10965610eb6b338e411ce816b810d76ab59e.tar.bz2
windows: fix size_t<->int conversions in ninja.exe
Diffstat (limited to 'src/util.cc')
-rw-r--r--src/util.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.cc b/src/util.cc
index 7c2f895..90a1d45 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -81,7 +81,7 @@ void Error(const char* msg, ...) {
bool CanonicalizePath(string* path, string* err) {
METRIC_RECORD("canonicalize str");
- int len = path->size();
+ size_t len = path->size();
char* str = 0;
if (len > 0)
str = &(*path)[0];
@@ -91,7 +91,7 @@ bool CanonicalizePath(string* path, string* err) {
return true;
}
-bool CanonicalizePath(char* path, int* len, string* err) {
+bool CanonicalizePath(char* path, size_t* len, string* err) {
// WARNING: this function is performance-critical; please benchmark
// any changes you make to it.
METRIC_RECORD("canonicalize path");
@@ -323,7 +323,7 @@ string ElideMiddle(const string& str, size_t width) {
const int kMargin = 3; // Space for "...".
string result = str;
if (result.size() + kMargin > width) {
- int elide_size = (width - kMargin) / 2;
+ size_t elide_size = (width - kMargin) / 2;
result = result.substr(0, elide_size)
+ "..."
+ result.substr(result.size() - elide_size, elide_size);