Use (1L << feature)' instead of (1 << feature)' to avoid problems

with integer overflows when we add more fields.
This commit is contained in:
Martin Baulig
1999-05-06 21:35:36 +00:00
parent b252a80b7e
commit 6120c5e4a8
101 changed files with 450 additions and 450 deletions

View File

@@ -28,10 +28,10 @@
#include <sys/stat.h>
static const unsigned long _glibtop_sysdeps_proc_state =
(1 << GLIBTOP_PROC_STATE_CMD);
(1L << GLIBTOP_PROC_STATE_CMD);
static const unsigned long _glibtop_sysdeps_proc_state_uid =
(1 << GLIBTOP_PROC_STATE_UID) + (1 << GLIBTOP_PROC_STATE_GID);
(1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID);
/* Init function. */
@@ -112,5 +112,5 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
return;
}
buf->flags |= (1 << GLIBTOP_PROC_STATE_STATE);
buf->flags |= (1L << GLIBTOP_PROC_STATE_STATE);
}