macros.h (dovecot-2.3.16) | : | macros.h (dovecot-2.3.17) | ||
---|---|---|---|---|
skipping to change at line 44 | skipping to change at line 44 | |||
files that are included after this file generating tons of warnings. */ | files that are included after this file generating tons of warnings. */ | |||
#define I_MIN(a, b) (((a) < (b)) ? (a) : (b)) | #define I_MIN(a, b) (((a) < (b)) ? (a) : (b)) | |||
#define I_MAX(a, b) (((a) > (b)) ? (a) : (b)) | #define I_MAX(a, b) (((a) > (b)) ? (a) : (b)) | |||
/* make it easier to cast from/to pointers. assumes that | /* make it easier to cast from/to pointers. assumes that | |||
sizeof(uintptr_t) == sizeof(void *) and they're both the largest datatypes | sizeof(uintptr_t) == sizeof(void *) and they're both the largest datatypes | |||
that are allowed to be used. so, long long isn't safe with these. */ | that are allowed to be used. so, long long isn't safe with these. */ | |||
#define POINTER_CAST(i) \ | #define POINTER_CAST(i) \ | |||
((void *) (((uintptr_t)NULL) + (i))) | ((void *) (((uintptr_t)NULL) + (i))) | |||
#define POINTER_CAST_TO(p, type) \ | #define POINTER_CAST_TO(p, type) \ | |||
((type) ((const char *) (p) - (const char *) NULL)) | ((type)(uintptr_t)(p)) | |||
/* Define VA_COPY() to do the right thing for copying va_list variables. | /* Define VA_COPY() to do the right thing for copying va_list variables. | |||
config.h may have already defined VA_COPY as va_copy or __va_copy. */ | config.h may have already defined VA_COPY as va_copy or __va_copy. */ | |||
#ifndef VA_COPY | #ifndef VA_COPY | |||
# if defined (__GNUC__) && defined (__PPC__) && \ | # if defined (__GNUC__) && defined (__PPC__) && \ | |||
(defined (_CALL_SYSV) || defined (_WIN32)) | (defined (_CALL_SYSV) || defined (_WIN32)) | |||
# define VA_COPY(ap1, ap2) (*(ap1) = *(ap2)) | # define VA_COPY(ap1, ap2) (*(ap1) = *(ap2)) | |||
# elif defined (VA_COPY_AS_ARRAY) | # elif defined (VA_COPY_AS_ARRAY) | |||
# define VA_COPY(ap1, ap2) memmove ((ap1), (ap2), sizeof (va_list)) | # define VA_COPY(ap1, ap2) memmove ((ap1), (ap2), sizeof (va_list)) | |||
# else /* va_list is a pointer */ | # else /* va_list is a pointer */ | |||
skipping to change at line 301 | skipping to change at line 301 | |||
#ifdef HAVE_FSANITIZE_INTEGER | #ifdef HAVE_FSANITIZE_INTEGER | |||
# define ATTR_NO_SANITIZE_INTEGER ATTR_NO_SANITIZE("integer") | # define ATTR_NO_SANITIZE_INTEGER ATTR_NO_SANITIZE("integer") | |||
# define ATTR_NO_SANITIZE_IMPLICIT_CONVERSION ATTR_NO_SANITIZE("implicit-convers ion") | # define ATTR_NO_SANITIZE_IMPLICIT_CONVERSION ATTR_NO_SANITIZE("implicit-convers ion") | |||
#else | #else | |||
# define ATTR_NO_SANITIZE_INTEGER | # define ATTR_NO_SANITIZE_INTEGER | |||
# define ATTR_NO_SANITIZE_IMPLICIT_CONVERSION | # define ATTR_NO_SANITIZE_IMPLICIT_CONVERSION | |||
#endif | #endif | |||
/* negate enumeration flags in a way that avoids implicit conversion */ | /* negate enumeration flags in a way that avoids implicit conversion */ | |||
#define ENUM_NEGATE(x) \ | #ifndef STATIC_CHECKER | |||
# define ENUM_NEGATE(x) \ | ||||
((unsigned int)(~(x)) + COMPILE_ERROR_IF_TRUE(sizeof((x)) > sizeof(int) | | (x) < 0 || (x) > INT_MAX)) | ((unsigned int)(~(x)) + COMPILE_ERROR_IF_TRUE(sizeof((x)) > sizeof(int) | | (x) < 0 || (x) > INT_MAX)) | |||
#else | ||||
/* clang scan-build keeps complaining about x > 2147483647 case, so disable the | ||||
sizeof check. */ | ||||
# define ENUM_NEGATE(x) ((unsigned int)(~(x))) | ||||
#endif | ||||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 3 lines changed or added |