**** Merged from HEAD ****

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-27 19:30:30 +00:00
parent 38de742ca4
commit dff497d2fa
38 changed files with 262 additions and 180 deletions

View File

@@ -26,8 +26,8 @@
#include <glibtop/shm_limits.h>
static unsigned long _glibtop_sysdeps_shm_limits =
(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) +
(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG);
(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) +
(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG);
/* Init function. */
@@ -53,7 +53,7 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
if (ret != 1) return;
buf->flags += (1 << GLIBTOP_IPC_SHMMAX);
buf->flags += (1L << GLIBTOP_IPC_SHMMAX);
buf->shmmax = value;
@@ -63,7 +63,7 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
if (ret != 1) return;
buf->flags += (1 << GLIBTOP_IPC_SHMMIN);
buf->flags += (1L << GLIBTOP_IPC_SHMMIN);
buf->shmmin = value;
@@ -73,7 +73,7 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
if (ret != 1) return;
buf->flags += (1 << GLIBTOP_IPC_SHMMNI);
buf->flags += (1L << GLIBTOP_IPC_SHMMNI);
buf->shmmni = value;
@@ -83,7 +83,7 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
if (ret != 1) return;
buf->flags += (1 << GLIBTOP_IPC_SHMSEG);
buf->flags += (1L << GLIBTOP_IPC_SHMSEG);
buf->shmseg = value;
}