Fix more -Wshorten-64-to-32 warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/System/Unix/Memory.inc b/lib/System/Unix/Memory.inc
index afa8f03..0b74f74 100644
--- a/lib/System/Unix/Memory.inc
+++ b/lib/System/Unix/Memory.inc
@@ -28,7 +28,7 @@
std::string *ErrMsg) {
if (NumBytes == 0) return MemoryBlock();
- long pageSize = Process::GetPageSize();
+ unsigned pageSize = Process::GetPageSize();
unsigned NumPages = (NumBytes+pageSize-1)/pageSize;
int fd = -1;
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index aca4b93..9f4b591 100644
--- a/lib/System/Unix/Path.inc
+++ b/lib/System/Unix/Path.inc
@@ -566,7 +566,7 @@
path.copy(pathname,MAXPATHLEN);
// Null-terminate the last component
- int lastchar = path.length() - 1 ;
+ size_t lastchar = path.length() - 1 ;
if (pathname[lastchar] != '/')
++lastchar;
@@ -639,7 +639,7 @@
// Otherwise, try to just remove the one directory.
char pathname[MAXPATHLEN];
path.copy(pathname, MAXPATHLEN);
- int lastchar = path.length() - 1 ;
+ size_t lastchar = path.length() - 1;
if (pathname[lastchar] == '/')
pathname[lastchar] = 0;
else
diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc
index 91baefb..d0dade1 100644
--- a/lib/System/Unix/Program.inc
+++ b/lib/System/Unix/Program.inc
@@ -58,7 +58,7 @@
return Path();
// Now we have a colon separated list of directories to search; try them.
- unsigned PathLen = strlen(PathStr);
+ size_t PathLen = strlen(PathStr);
while (PathLen) {
// Find the first colon...
const char *Colon = std::find(PathStr, PathStr+PathLen, ':');
diff --git a/lib/System/Unix/Signals.inc b/lib/System/Unix/Signals.inc
index 3314a43..79236cd 100644
--- a/lib/System/Unix/Signals.inc
+++ b/lib/System/Unix/Signals.inc
@@ -65,7 +65,8 @@
static void PrintStackTrace() {
#ifdef HAVE_BACKTRACE
// Use backtrace() to output a backtrace on Linux systems with glibc.
- int depth = backtrace(StackTrace, array_lengthof(StackTrace));
+ int depth = backtrace(StackTrace,
+ static_cast<int>(array_lengthof(StackTrace)));
backtrace_symbols_fd(StackTrace, depth, STDERR_FILENO);
#endif
}