mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
girparser: Adjust signedness() to avoid compiler warnings
No functional change intended. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
8c9b9bca35
commit
c7e0f3e6b8
@ -454,16 +454,7 @@ typedef struct {
|
||||
unsigned int is_signed : 1;
|
||||
} IntegerAliasInfo;
|
||||
|
||||
/* Ignore warnings from use of signedness() */
|
||||
#if G_GNUC_CHECK_VERSION(4, 6)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wtype-limits"
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtype-limits"
|
||||
#endif
|
||||
|
||||
#define signedness(T) (((T) -1) < 0)
|
||||
#define signedness(T) (((T) -1) <= 0)
|
||||
G_STATIC_ASSERT (signedness (int) == 1);
|
||||
G_STATIC_ASSERT (signedness (unsigned int) == 0);
|
||||
|
||||
@ -493,12 +484,6 @@ static IntegerAliasInfo integer_aliases[] = {
|
||||
#undef INTEGER_ALIAS
|
||||
};
|
||||
|
||||
#if G_GNUC_CHECK_VERSION(4, 6)
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
const char *str;
|
||||
int tag;
|
||||
|
Loading…
Reference in New Issue
Block a user