diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-07-17 12:45:42 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-07-17 12:57:20 +0200 |
commit | ab1a1ba5dc80a7657fe09dcb4a614789d56538b2 (patch) | |
tree | 6aa955f688285605461e9198fb95ca6cf4c3f1d7 | |
parent | basic/macro: drop do {} while(0) from assert_not_reached (diff) | |
download | systemd-ab1a1ba5dc80a7657fe09dcb4a614789d56538b2.tar.xz systemd-ab1a1ba5dc80a7657fe09dcb4a614789d56538b2.zip |
Drop trailing slash from assert_cc() definition
We use assert_cc(...); almost everywhere. Let's always require that.
https://github.com/systemd/systemd/issues/12997#issuecomment-510103988
-rw-r--r-- | src/basic/log.h | 2 | ||||
-rw-r--r-- | src/basic/macro.h | 4 | ||||
-rw-r--r-- | src/basic/process-util.h | 2 | ||||
-rw-r--r-- | src/libsystemd-network/radv-internal.h | 2 | ||||
-rw-r--r-- | src/resolve/resolved-dns-packet.c | 2 | ||||
-rw-r--r-- | src/shared/json.h | 4 |
6 files changed, 8 insertions, 8 deletions
diff --git a/src/basic/log.h b/src/basic/log.h index 2e0179b2a5..625be22402 100644 --- a/src/basic/log.h +++ b/src/basic/log.h @@ -73,7 +73,7 @@ int log_get_max_level_realm(LogRealm realm) _pure_; * for the application itself. */ -assert_cc(STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1) +assert_cc(STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1); #define PROJECT_FILE (__FILE__ + STRLEN(RELATIVE_SOURCE_PATH) + 1) int log_open(void); diff --git a/src/basic/macro.h b/src/basic/macro.h index fb002d2172..00dfd48023 100644 --- a/src/basic/macro.h +++ b/src/basic/macro.h @@ -348,12 +348,12 @@ static inline int __coverity_check__(int condition) { #if defined(static_assert) #define assert_cc(expr) \ - static_assert(expr, #expr); + static_assert(expr, #expr) #else #define assert_cc(expr) \ struct CONCATENATE(_assert_struct_, __COUNTER__) { \ char x[(expr) ? 0 : -1]; \ - }; + } #endif #define assert_return(expr, r) \ diff --git a/src/basic/process-util.h b/src/basic/process-util.h index 4adf254808..41d4759c97 100644 --- a/src/basic/process-util.h +++ b/src/basic/process-util.h @@ -189,7 +189,7 @@ int set_oom_score_adjust(int value); #error "Unknown pid_t size" #endif -assert_cc(TASKS_MAX <= (unsigned long) PID_T_MAX) +assert_cc(TASKS_MAX <= (unsigned long) PID_T_MAX); /* Like TAKE_PTR() but for child PIDs, resetting them to 0 */ #define TAKE_PID(pid) \ diff --git a/src/libsystemd-network/radv-internal.h b/src/libsystemd-network/radv-internal.h index 517e4dc528..7b09c7a66c 100644 --- a/src/libsystemd-network/radv-internal.h +++ b/src/libsystemd-network/radv-internal.h @@ -11,7 +11,7 @@ #include "list.h" #include "sparse-endian.h" -assert_cc(SD_RADV_DEFAULT_MIN_TIMEOUT_USEC <= SD_RADV_DEFAULT_MAX_TIMEOUT_USEC) +assert_cc(SD_RADV_DEFAULT_MIN_TIMEOUT_USEC <= SD_RADV_DEFAULT_MAX_TIMEOUT_USEC); #define SD_RADV_MAX_INITIAL_RTR_ADVERT_INTERVAL_USEC (16*USEC_PER_SEC) #define SD_RADV_MAX_INITIAL_RTR_ADVERTISEMENTS 3 diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index 20ee8c9ca3..05aaa0fb7f 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -17,7 +17,7 @@ #define EDNS0_OPT_DO (1<<15) -assert_cc(DNS_PACKET_SIZE_START > DNS_PACKET_HEADER_SIZE) +assert_cc(DNS_PACKET_SIZE_START > DNS_PACKET_HEADER_SIZE); typedef struct DnsPacketRewinder { DnsPacket *packet; diff --git a/src/shared/json.h b/src/shared/json.h index d78082905a..1f9c620ebb 100644 --- a/src/shared/json.h +++ b/src/shared/json.h @@ -241,10 +241,10 @@ int json_dispatch_unsigned(const char *name, JsonVariant *variant, JsonDispatchF int json_dispatch_uint32(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); int json_dispatch_int32(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata); -assert_cc(sizeof(uintmax_t) == sizeof(uint64_t)) +assert_cc(sizeof(uintmax_t) == sizeof(uint64_t)); #define json_dispatch_uint64 json_dispatch_unsigned -assert_cc(sizeof(intmax_t) == sizeof(int64_t)) +assert_cc(sizeof(intmax_t) == sizeof(int64_t)); #define json_dispatch_int64 json_dispatch_integer static inline int json_dispatch_level(JsonDispatchFlags flags) { |