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

@@ -37,7 +37,7 @@ glibtop_init_msg_limits_p (glibtop *server)
void
glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
{
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
memset (buf, 0, sizeof (glibtop_msg_limits));
}
@@ -56,9 +56,9 @@ glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
#include <sys/msg.h>
static const unsigned long _glibtop_sysdeps_msg_limits =
(1 << GLIBTOP_IPC_MSGMAX) + (1 << GLIBTOP_IPC_MSGMNI) +
(1 << GLIBTOP_IPC_MSGMNB) + (1 << GLIBTOP_IPC_MSGTQL) +
(1 << GLIBTOP_IPC_MSGSSZ);
(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNI) +
(1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGTQL) +
(1L << GLIBTOP_IPC_MSGSSZ);
/* The values in this structure never change at runtime, so we only
* read it once during initialization. We have to use the name `_msginfo'
@@ -95,7 +95,7 @@ glibtop_init_msg_limits_p (glibtop *server)
void
glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
{
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
memset (buf, 0, sizeof (glibtop_msg_limits));