liblog: Assure shifting behavior is consistent
Shifting a signed 32-bit value by 31 bits is implementation-
defined behavior. So we change to an unsigned value for our
shift by 31 bits, and go ahead and change the others to
unsigned for consistency.
Test: TreeHugger
Change-Id: Ib98f9b1e468d28dafd09e86273bf76beb1ea1fa5
diff --git a/liblog/logger.h b/liblog/logger.h
index d2251e5..f0a4a92 100644
--- a/liblog/logger.h
+++ b/liblog/logger.h
@@ -85,9 +85,9 @@
// bits 0-2: the decimal value of the log buffer.
// Other bits are unused.
-#define LOGGER_LOGD (1 << 31)
-#define LOGGER_PMSG (1 << 30)
-#define LOGGER_LOG_ID_MASK ((1 << 3) - 1)
+#define LOGGER_LOGD (1U << 31)
+#define LOGGER_PMSG (1U << 30)
+#define LOGGER_LOG_ID_MASK ((1U << 3) - 1)
inline bool android_logger_is_logd(struct logger* logger) {
return reinterpret_cast<uintptr_t>(logger) & LOGGER_LOGD;