Use (1L << feature)' instead of
(1 << feature)' to avoid problems
with integer overflows when we add more fields.
This commit is contained in:
@@ -33,8 +33,8 @@
|
||||
#define GLIBTOP_PROCLIST_FLAGS 3
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proclist =
|
||||
(1 << GLIBTOP_PROCLIST_TOTAL) + (1 << GLIBTOP_PROCLIST_NUMBER) +
|
||||
(1 << GLIBTOP_PROCLIST_SIZE);
|
||||
(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) +
|
||||
(1L << GLIBTOP_PROCLIST_SIZE);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
|
@@ -27,8 +27,8 @@
|
||||
#include <glibtop_private.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_time =
|
||||
(1 << GLIBTOP_PROC_TIME_START_TIME) + (1 << GLIBTOP_PROC_TIME_RTIME) +
|
||||
(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_STIME);
|
||||
(1L << GLIBTOP_PROC_TIME_START_TIME) + (1L << GLIBTOP_PROC_TIME_RTIME) +
|
||||
(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
|
Reference in New Issue
Block a user