summaryrefslogtreecommitdiffstats
path: root/src/util.cc
diff options
context:
space:
mode:
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);