summaryrefslogtreecommitdiffstats
path: root/liblog
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2019-01-16 22:25:53 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-01-16 22:25:53 +0000
commit4f8246122f9324b1f19fad97a4b3e6362b8d6ee2 (patch)
treef4c11c77b56b60129e33cd6932df9744b2c0c156 /liblog
parentc8b83f3874cdef096b37e01ded8a15a47dbfa1c2 (diff)
parentbab52203b7c0a2610c1f51428703388223cb634a (diff)
downloadsystem_core-4f8246122f9324b1f19fad97a4b3e6362b8d6ee2.tar.gz
system_core-4f8246122f9324b1f19fad97a4b3e6362b8d6ee2.tar.bz2
system_core-4f8246122f9324b1f19fad97a4b3e6362b8d6ee2.zip
Merge "Use #pragma one for all liblog includes"
Diffstat (limited to 'liblog')
-rw-r--r--liblog/config_read.h5
-rw-r--r--liblog/config_write.h5
-rw-r--r--liblog/fake_log_device.h5
-rw-r--r--liblog/include/log/event_tag_map.h5
-rw-r--r--liblog/include/log/log.h5
-rw-r--r--liblog/include/log/log_event_list.h5
-rw-r--r--liblog/include/log/log_id.h5
-rw-r--r--liblog/include/log/log_main.h5
-rw-r--r--liblog/include/log/log_properties.h5
-rw-r--r--liblog/include/log/log_radio.h5
-rw-r--r--liblog/include/log/log_read.h5
-rw-r--r--liblog/include/log/log_safetynet.h5
-rw-r--r--liblog/include/log/log_system.h5
-rw-r--r--liblog/include/log/log_time.h13
-rw-r--r--liblog/include/log/log_transport.h5
-rw-r--r--liblog/include/log/logprint.h5
-rw-r--r--liblog/include/log/uio.h5
-rw-r--r--liblog/include/private/android_logger.h5
-rw-r--r--liblog/log_portability.h5
-rw-r--r--liblog/logd_reader.h5
-rw-r--r--liblog/logger.h5
-rw-r--r--liblog/tests/log_time_test.cpp6
22 files changed, 21 insertions, 98 deletions
diff --git a/liblog/config_read.h b/liblog/config_read.h
index 7b29fa4c2..00ea453e4 100644
--- a/liblog/config_read.h
+++ b/liblog/config_read.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBLOG_CONFIG_READ_H__
-#define _LIBLOG_CONFIG_READ_H__
+#pragma once
#include <cutils/list.h>
@@ -51,5 +50,3 @@ LIBLOG_HIDDEN void __android_log_config_read();
LIBLOG_HIDDEN void __android_log_config_read_close();
__END_DECLS
-
-#endif /* _LIBLOG_CONFIG_READ_H__ */
diff --git a/liblog/config_write.h b/liblog/config_write.h
index db1a08314..e3be4455f 100644
--- a/liblog/config_write.h
+++ b/liblog/config_write.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBLOG_CONFIG_WRITE_H__
-#define _LIBLOG_CONFIG_WRITE_H__
+#pragma once
#include <cutils/list.h>
@@ -51,5 +50,3 @@ LIBLOG_HIDDEN void __android_log_config_write();
LIBLOG_HIDDEN void __android_log_config_write_close();
__END_DECLS
-
-#endif /* _LIBLOG_CONFIG_WRITE_H__ */
diff --git a/liblog/fake_log_device.h b/liblog/fake_log_device.h
index d88eaeef8..74d434e60 100644
--- a/liblog/fake_log_device.h
+++ b/liblog/fake_log_device.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBLOG_FAKE_LOG_DEVICE_H
-#define _LIBLOG_FAKE_LOG_DEVICE_H
+#pragma once
#include <sys/types.h>
@@ -36,5 +35,3 @@ LIBLOG_ABI_PUBLIC int __android_log_is_loggable_len(int prio, const char*, size_
LIBLOG_ABI_PRIVATE int __android_log_is_debuggable();
__END_DECLS
-
-#endif // _LIBLOG_FAKE_LOG_DEVICE_H
diff --git a/liblog/include/log/event_tag_map.h b/liblog/include/log/event_tag_map.h
index 8dd91572c..2687b3aad 100644
--- a/liblog/include/log/event_tag_map.h
+++ b/liblog/include/log/event_tag_map.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBS_CUTILS_EVENTTAGMAP_H
-#define _LIBS_CUTILS_EVENTTAGMAP_H
+#pragma once
#ifdef __cplusplus
extern "C" {
@@ -69,5 +68,3 @@ int android_lookupEventTagNum(EventTagMap* map, const char* tagname,
#ifdef __cplusplus
}
#endif
-
-#endif /*_LIBS_CUTILS_EVENTTAGMAP_H*/
diff --git a/liblog/include/log/log.h b/liblog/include/log/log.h
index 544b3a640..df5affb4a 100644
--- a/liblog/include/log/log.h
+++ b/liblog/include/log/log.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBS_LOG_LOG_H
-#define _LIBS_LOG_LOG_H
+#pragma once
/* Too many in the ecosystem assume these are included */
#if !defined(_WIN32)
@@ -200,5 +199,3 @@ int __android_log_ratelimit(time_t seconds, time_t* last);
#ifdef __cplusplus
}
#endif
-
-#endif /* _LIBS_LOG_LOG_H */
diff --git a/liblog/include/log/log_event_list.h b/liblog/include/log/log_event_list.h
index 7819fb1b4..b37650424 100644
--- a/liblog/include/log/log_event_list.h
+++ b/liblog/include/log/log_event_list.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBS_LOG_EVENT_LIST_H
-#define _LIBS_LOG_EVENT_LIST_H
+#pragma once
#include <errno.h>
#include <stdint.h>
@@ -299,5 +298,3 @@ class android_log_event_list {
#ifdef __cplusplus
}
#endif
-
-#endif /* _LIBS_LOG_EVENT_LIST_H */
diff --git a/liblog/include/log/log_id.h b/liblog/include/log/log_id.h
index c44f5a2eb..c052a503c 100644
--- a/liblog/include/log/log_id.h
+++ b/liblog/include/log/log_id.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBS_LOG_LOG_ID_H
-#define _LIBS_LOG_LOG_ID_H
+#pragma once
#ifdef __cplusplus
extern "C" {
@@ -62,5 +61,3 @@ const char* android_log_id_to_name(log_id_t log_id);
#ifdef __cplusplus
}
#endif
-
-#endif /* _LIBS_LOG_LOG_ID_H */
diff --git a/liblog/include/log/log_main.h b/liblog/include/log/log_main.h
index a94a2836d..64791c2cc 100644
--- a/liblog/include/log/log_main.h
+++ b/liblog/include/log/log_main.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBS_LOG_LOG_MAIN_H
-#define _LIBS_LOG_LOG_MAIN_H
+#pragma once
#include <stdbool.h>
#include <sys/cdefs.h>
@@ -374,5 +373,3 @@ int __android_log_is_loggable_len(int prio, const char* tag, size_t len, int def
#endif
__END_DECLS
-
-#endif /* _LIBS_LOG_LOG_MAIN_H */
diff --git a/liblog/include/log/log_properties.h b/liblog/include/log/log_properties.h
index 94da242ef..3a8af6deb 100644
--- a/liblog/include/log/log_properties.h
+++ b/liblog/include/log/log_properties.h
@@ -7,8 +7,7 @@
** General Public License.
*/
-#ifndef _LIBS_LOG_PROPERTIES_H
-#define _LIBS_LOG_PROPERTIES_H
+#pragma once
#ifdef __cplusplus
extern "C" {
@@ -19,5 +18,3 @@ int __android_log_is_debuggable();
#ifdef __cplusplus
}
#endif
-
-#endif /* _LIBS_LOG_PROPERTIES_H */
diff --git a/liblog/include/log/log_radio.h b/liblog/include/log/log_radio.h
index bd629fe35..8b8a3625f 100644
--- a/liblog/include/log/log_radio.h
+++ b/liblog/include/log/log_radio.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBS_LOG_LOG_RADIO_H
-#define _LIBS_LOG_LOG_RADIO_H
+#pragma once
#include <android/log.h>
#include <log/log_id.h>
@@ -140,5 +139,3 @@
LOG_TAG, __VA_ARGS__)) \
: (void)0)
#endif
-
-#endif /* _LIBS_LOG_LOG_RADIO_H */
diff --git a/liblog/include/log/log_read.h b/liblog/include/log/log_read.h
index d6de930d9..fdef306d2 100644
--- a/liblog/include/log/log_read.h
+++ b/liblog/include/log/log_read.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBS_LOG_LOG_READ_H
-#define _LIBS_LOG_LOG_READ_H
+#pragma once
#include <sys/types.h>
@@ -246,5 +245,3 @@ struct logger_list* android_logger_list_open(log_id_t id, int mode,
#ifdef __cplusplus
}
#endif
-
-#endif /* _LIBS_LOG_LOG_H */
diff --git a/liblog/include/log/log_safetynet.h b/liblog/include/log/log_safetynet.h
index c8a5781cf..d3e9b1954 100644
--- a/liblog/include/log/log_safetynet.h
+++ b/liblog/include/log/log_safetynet.h
@@ -7,8 +7,7 @@
** General Public License.
*/
-#ifndef _LIBS_LOG_SAFETYNET_H
-#define _LIBS_LOG_SAFETYNET_H
+#pragma once
#include <stdint.h>
@@ -28,5 +27,3 @@ int __android_log_error_write(int tag, const char* subTag, int32_t uid,
#ifdef __cplusplus
}
#endif
-
-#endif /* _LIBS_LOG_SAFETYNET_H */
diff --git a/liblog/include/log/log_system.h b/liblog/include/log/log_system.h
index 3b5ae2277..eaec741ea 100644
--- a/liblog/include/log/log_system.h
+++ b/liblog/include/log/log_system.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBS_LOG_LOG_SYSTEM_H
-#define _LIBS_LOG_LOG_SYSTEM_H
+#pragma once
#include <android/log.h>
#include <log/log_id.h>
@@ -138,5 +137,3 @@
LOG_TAG, __VA_ARGS__)) \
: (void)0)
#endif
-
-#endif /* _LIBS_LOG_LOG_SYSTEM_H */
diff --git a/liblog/include/log/log_time.h b/liblog/include/log/log_time.h
index 5830e6edb..be6925598 100644
--- a/liblog/include/log/log_time.h
+++ b/liblog/include/log/log_time.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBS_LOG_LOG_TIME_H
-#define _LIBS_LOG_LOG_TIME_H
+#pragma once
#include <stdint.h>
#include <time.h>
@@ -56,10 +55,8 @@ struct log_time {
explicit log_time(uint32_t sec, uint32_t nsec = 0)
: tv_sec(sec), tv_nsec(nsec) {
}
-#ifdef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
#define __struct_log_time_private_defined
static const timespec EPOCH;
-#endif
log_time() {
}
#ifdef __linux__
@@ -105,7 +102,6 @@ struct log_time {
return !(*this > T);
}
-#ifdef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
log_time operator-=(const timespec& T);
log_time operator-(const timespec& T) const {
log_time local(*this);
@@ -116,7 +112,6 @@ struct log_time {
log_time local(*this);
return local += T;
}
-#endif
/* log_time */
bool operator==(const log_time& T) const {
@@ -140,7 +135,6 @@ struct log_time {
return !(*this > T);
}
-#ifdef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
log_time operator-=(const log_time& T);
log_time operator-(const log_time& T) const {
log_time local(*this);
@@ -151,7 +145,6 @@ struct log_time {
log_time local(*this);
return local += T;
}
-#endif
uint64_t nsec() const {
return static_cast<uint64_t>(tv_sec) * NS_PER_SEC + tv_nsec;
@@ -165,12 +158,10 @@ struct log_time {
tv_nsec / (NS_PER_SEC / MS_PER_SEC);
}
-#ifdef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
static const char default_format[];
/* Add %#q for the fraction of a second to the standard library functions */
char* strptime(const char* s, const char* format = default_format);
-#endif
} __attribute__((__packed__));
}
@@ -184,5 +175,3 @@ typedef struct log_time {
#endif /* __cplusplus */
#endif /* __struct_log_time_defined */
-
-#endif /* _LIBS_LOG_LOG_TIME_H */
diff --git a/liblog/include/log/log_transport.h b/liblog/include/log/log_transport.h
index 8b029957c..b48761af8 100644
--- a/liblog/include/log/log_transport.h
+++ b/liblog/include/log/log_transport.h
@@ -7,8 +7,7 @@
** General Public License.
*/
-#ifndef _LIBS_LOG_TRANSPORT_H
-#define _LIBS_LOG_TRANSPORT_H
+#pragma once
#ifdef __cplusplus
extern "C" {
@@ -33,5 +32,3 @@ int android_get_log_transport();
#ifdef __cplusplus
}
#endif
-
-#endif /* _LIBS_LOG_TRANSPORT_H */
diff --git a/liblog/include/log/logprint.h b/liblog/include/log/logprint.h
index ca58bc7e0..8f4b1877e 100644
--- a/liblog/include/log/logprint.h
+++ b/liblog/include/log/logprint.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LOGPRINT_H
-#define _LOGPRINT_H
+#pragma once
#include <pthread.h>
@@ -158,5 +157,3 @@ int android_log_printLogLine(AndroidLogFormat* p_format, int fd,
#ifdef __cplusplus
}
#endif
-
-#endif /*_LOGPRINT_H*/
diff --git a/liblog/include/log/uio.h b/liblog/include/log/uio.h
index a492baefe..7feb5527f 100644
--- a/liblog/include/log/uio.h
+++ b/liblog/include/log/uio.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBS_CUTILS_UIO_H
-#define _LIBS_CUTILS_UIO_H
+#pragma once
#if !defined(_WIN32)
@@ -46,5 +45,3 @@ extern int writev(int fd, const struct iovec* vecs, int count);
#endif
#endif
-
-#endif /* _LIBS_UTILS_UIO_H */
diff --git a/liblog/include/private/android_logger.h b/liblog/include/private/android_logger.h
index 9da20a65b..830f6516b 100644
--- a/liblog/include/private/android_logger.h
+++ b/liblog/include/private/android_logger.h
@@ -16,8 +16,7 @@
/* This file is used to define the internal protocol for the Android Logger */
-#ifndef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
-#define _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
+#pragma once
/* Android private interfaces */
@@ -185,5 +184,3 @@ class __android_log_event_list : public android_log_event_list {
#if defined(__cplusplus)
}
#endif
-
-#endif /* _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_ */
diff --git a/liblog/log_portability.h b/liblog/log_portability.h
index 4a1f59c1b..b9fb1d248 100644
--- a/liblog/log_portability.h
+++ b/liblog/log_portability.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBLOG_PORTABILITY_H__
-#define _LIBLOG_PORTABILITY_H__
+#pragma once
#include <sys/cdefs.h>
#include <unistd.h>
@@ -75,5 +74,3 @@
_rc; \
})
#endif
-
-#endif /* _LIBLOG_PORTABILITY_H__ */
diff --git a/liblog/logd_reader.h b/liblog/logd_reader.h
index 8ebb1aee1..0bba7cf56 100644
--- a/liblog/logd_reader.h
+++ b/liblog/logd_reader.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBLOG_LOGD_READER_H__
-#define _LIBLOG_LOGD_READER_H__
+#pragma once
#include <unistd.h>
@@ -26,5 +25,3 @@ __BEGIN_DECLS
LIBLOG_HIDDEN ssize_t __send_log_msg(char* buf, size_t buf_size);
__END_DECLS
-
-#endif /* _LIBLOG_LOGD_READER_H__ */
diff --git a/liblog/logger.h b/liblog/logger.h
index 7bb9b20fb..25ee06547 100644
--- a/liblog/logger.h
+++ b/liblog/logger.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _LIBLOG_LOGGER_H__
-#define _LIBLOG_LOGGER_H__
+#pragma once
#include <stdatomic.h>
#include <stdbool.h>
@@ -164,5 +163,3 @@ LIBLOG_HIDDEN void __android_log_unlock();
extern LIBLOG_HIDDEN int __android_log_transport;
__END_DECLS
-
-#endif /* _LIBLOG_LOGGER_H__ */
diff --git a/liblog/tests/log_time_test.cpp b/liblog/tests/log_time_test.cpp
index 0ae1d1848..47fe594ab 100644
--- a/liblog/tests/log_time_test.cpp
+++ b/liblog/tests/log_time_test.cpp
@@ -21,12 +21,6 @@
#include <log/log_time.h>
TEST(liblog, log_time) {
-#ifdef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
- log_time(CLOCK_MONOTONIC);
-
- EXPECT_EQ(log_time, log_time::EPOCH);
-#endif
-
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
log_time tl(ts);