Add an assertion to ensure that GLIBTOP_SYSDEPS_* fit in an unsigned long.

This commit is contained in:
Benoît Dejean
2015-03-12 23:25:24 +01:00
parent 931a8364ff
commit 94aa63f796

View File

@@ -56,6 +56,9 @@ G_BEGIN_DECLS
#define GLIBTOP_MAX_SYSDEPS 27 #define GLIBTOP_MAX_SYSDEPS 27
/* The 'features' args to glibtop_init_* is an unsigned long */
G_STATIC_ASSERT((1UL << (GLIBTOP_MAX_SYSDEPS - 1)) <= ULONG_MAX);
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1) #define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
typedef struct _glibtop_sysdeps glibtop_sysdeps; typedef struct _glibtop_sysdeps glibtop_sysdeps;