Use (1L << feature)' instead of
(1 << feature)' to avoid problems
with integer overflows when we add more fields.
This commit is contained in:
@@ -26,12 +26,12 @@
|
||||
#include <glibtop/loadavg.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_loadavg =
|
||||
(1 << GLIBTOP_LOADAVG_LOADAVG);
|
||||
(1L << GLIBTOP_LOADAVG_LOADAVG);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_loadavg_tasks =
|
||||
(1 << GLIBTOP_LOADAVG_NR_RUNNING) +
|
||||
(1 << GLIBTOP_LOADAVG_NR_TASKS) +
|
||||
(1 << GLIBTOP_LOADAVG_LAST_PID);
|
||||
(1L << GLIBTOP_LOADAVG_NR_RUNNING) +
|
||||
(1L << GLIBTOP_LOADAVG_NR_TASKS) +
|
||||
(1L << GLIBTOP_LOADAVG_LAST_PID);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
|
Reference in New Issue
Block a user