1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-08 21:17:47 +03:00

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
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-07-17 12:45:42 +02:00
parent cfec3117d4
commit ab1a1ba5dc
6 changed files with 8 additions and 8 deletions

View File

@ -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);

View File

@ -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) \

View File

@ -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) \

View File

@ -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

View File

@ -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;

View File

@ -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) {