Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9829e7f8 authored by Greg Kaiser's avatar Greg Kaiser
Browse files

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
parent ba535169
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -85,9 +85,9 @@ struct logger_list {
// 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;