diff options
author | Mark Salyzyn <salyzyn@google.com> | 2014-01-10 14:07:58 -0800 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2014-01-27 15:19:53 -0800 |
commit | 318bb72601c0b6895a93d95ad0dedaebf2ae3d9f (patch) | |
tree | ba485d3a1bf5fe0edbc183aac5440b3625c221ae | |
parent | 5d3d1f17dbcb01aedd510b5435ebdaf1d6afc138 (diff) | |
download | system_core-318bb72601c0b6895a93d95ad0dedaebf2ae3d9f.zip system_core-318bb72601c0b6895a93d95ad0dedaebf2ae3d9f.tar.gz system_core-318bb72601c0b6895a93d95ad0dedaebf2ae3d9f.tar.bz2 |
liblog: Add const pedantics
(cherry picked from commit 9e03ce45f999b75000f1652747783d74e7063b9a)
Change-Id: I819695b778ac08fcfc9b1a87f3f86e5715f53084
-rw-r--r-- | include/log/logger.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/include/log/logger.h b/include/log/logger.h index 004b690..966397a 100644 --- a/include/log/logger.h +++ b/include/log/logger.h @@ -7,8 +7,8 @@ ** General Public License. */ -#ifndef _UTILS_LOGGER_H -#define _UTILS_LOGGER_H +#ifndef _LIBS_LOG_LOGGER_H +#define _LIBS_LOG_LOGGER_H #include <stdint.h> #include <log/log.h> @@ -77,36 +77,36 @@ struct log_msg { } extra; } __attribute__((aligned(4))); #ifdef __cplusplus - /* Matching log_time_t operators */ - bool operator== (log_msg &T) + /* Matching log_time operators */ + bool operator== (const log_msg &T) const { return (entry.sec == T.entry.sec) && (entry.nsec == T.entry.nsec); } - bool operator!= (log_msg &T) + bool operator!= (const log_msg &T) const { return !(*this == T); } - bool operator< (log_msg &T) + bool operator< (const log_msg &T) const { return (entry.sec < T.entry.sec) || ((entry.sec == T.entry.sec) && (entry.nsec < T.entry.nsec)); } - bool operator>= (log_msg &T) + bool operator>= (const log_msg &T) const { return !(*this < T); } - bool operator> (log_msg &T) + bool operator> (const log_msg &T) const { return (entry.sec > T.entry.sec) || ((entry.sec == T.entry.sec) && (entry.nsec > T.entry.nsec)); } - bool operator<= (log_msg &T) + bool operator<= (const log_msg &T) const { return !(*this > T); } - uint64_t nsec(void) + uint64_t nsec(void) const { return static_cast<uint64_t>(entry.sec) * NS_PER_SEC + entry.nsec; } @@ -167,4 +167,4 @@ const char *android_log_id_to_name(log_id_t log_id); } #endif -#endif /* _UTILS_LOGGER_H */ +#endif /* _LIBS_LOG_LOGGER_H */ |