Enable -Wconversion for thread.cc

This should help prevent bugs due to unexpected implicit integer
conversions.

Some collateral changes were needed as well to limit the number of casts
that had to be introduced.

Bug: 165843530
Test: m test-art-host-gtests
Change-Id: I091122827001ab335c7e140864f67cdf90fcf8b4
diff --git a/libartbase/base/globals.h b/libartbase/base/globals.h
index 97eae63..700d4e6 100644
--- a/libartbase/base/globals.h
+++ b/libartbase/base/globals.h
@@ -36,7 +36,7 @@
 
 // System page size. We check this against sysconf(_SC_PAGE_SIZE) at runtime, but use a simple
 // compile-time constant so the compiler can generate better code.
-static constexpr int kPageSize = 4096;
+static constexpr size_t kPageSize = 4096;
 
 // Clion, clang analyzer, etc can falsely believe that "if (kIsDebugBuild)" always
 // returns the same value. By wrapping into a call to another constexpr function, we force it
diff --git a/libartbase/base/utils.cc b/libartbase/base/utils.cc
index 19311b3..339cf83 100644
--- a/libartbase/base/utils.cc
+++ b/libartbase/base/utils.cc
@@ -179,7 +179,7 @@
   return false;
 }
 
-pid_t GetTid() {
+uint32_t GetTid() {
 #if defined(__APPLE__)
   uint64_t owner;
   CHECK_PTHREAD_CALL(pthread_threadid_np, (nullptr, &owner), __FUNCTION__);  // Requires Mac OS 10.6
@@ -209,14 +209,14 @@
   return result;
 }
 
-std::string PrettySize(int64_t byte_count) {
+std::string PrettySize(uint64_t byte_count) {
   // The byte thresholds at which we display amounts.  A byte count is displayed
   // in unit U when kUnitThresholds[U] <= bytes < kUnitThresholds[U+1].
-  static const int64_t kUnitThresholds[] = {
-    0,       // B up to...
-    10*KB,   // KB up to...
-    10*MB,   // MB up to...
-    10LL*GB  // GB from here.
+  static const uint64_t kUnitThresholds[] = {
+    0,        // B up to...
+    10*KB,    // KB up to...
+    10*MB,    // MB up to...
+    10ULL*GB  // GB from here.
   };
   static const int64_t kBytesPerUnit[] = { 1, KB, MB, GB };
   static const char* const kUnitStrings[] = { "B", "KB", "MB", "GB" };
diff --git a/libartbase/base/utils.h b/libartbase/base/utils.h
index 4bcb915..66a5699 100644
--- a/libartbase/base/utils.h
+++ b/libartbase/base/utils.h
@@ -40,14 +40,14 @@
 }
 
 // Returns a human-readable size string such as "1MB".
-std::string PrettySize(int64_t size_in_bytes);
+std::string PrettySize(uint64_t size_in_bytes);
 
 // Splits a string using the given separator character into a vector of
 // strings. Empty strings will be omitted.
 void Split(const std::string& s, char separator, std::vector<std::string>* result);
 
 // Returns the calling thread's tid. (The C libraries don't expose this.)
-pid_t GetTid();
+uint32_t GetTid();
 
 // Returns the given thread's name.
 std::string GetThreadName(pid_t tid);