From 6120c5e4a8ce2b53d19650e0d545d5ee49676ada Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Thu, 6 May 1999 21:35:36 +0000 Subject: [PATCH] Use `(1L << feature)' instead of `(1 << feature)' to avoid problems with integer overflows when we add more fields. --- examples/procmap.c | 2 +- examples/sysdeps.c | 2 +- src/daemon/slave.c | 2 +- sysdeps/freebsd/cpu.c | 8 ++-- sysdeps/freebsd/loadavg.c | 4 +- sysdeps/freebsd/mem.c | 14 +++---- sysdeps/freebsd/msg_limits.c | 10 ++--- sysdeps/freebsd/netload.c | 30 +++++++-------- sysdeps/freebsd/ppp.c | 6 +-- sysdeps/freebsd/procargs.c | 4 +- sysdeps/freebsd/procdata.c | 2 +- sysdeps/freebsd/prockernel.c | 22 +++++------ sysdeps/freebsd/proclist.c | 6 +-- sysdeps/freebsd/procmap.c | 12 +++--- sysdeps/freebsd/procmem.c | 14 +++---- sysdeps/freebsd/procsegment.c | 2 +- sysdeps/freebsd/procsignal.c | 10 ++--- sysdeps/freebsd/procstate.c | 8 ++-- sysdeps/freebsd/proctime.c | 8 ++-- sysdeps/freebsd/procuid.c | 12 +++--- sysdeps/freebsd/sem_limits.c | 14 +++---- sysdeps/freebsd/shm_limits.c | 10 ++--- sysdeps/freebsd/swap.c | 8 ++-- sysdeps/freebsd/uptime.c | 8 ++-- sysdeps/kernel/cpu.c | 12 +++--- sysdeps/kernel/loadavg.c | 2 +- sysdeps/kernel/mem.c | 6 +-- sysdeps/kernel/msg_limits.c | 8 ++-- sysdeps/kernel/netload.c | 48 +++++++++++------------ sysdeps/kernel/ppp.c | 10 ++--- sysdeps/kernel/procargs.c | 2 +- sysdeps/kernel/prockernel.c | 14 +++---- sysdeps/kernel/proclist.c | 4 +- sysdeps/kernel/procmap.c | 12 +++--- sysdeps/kernel/procmem.c | 6 +-- sysdeps/kernel/procsegment.c | 16 ++++---- sysdeps/kernel/procsignal.c | 8 ++-- sysdeps/kernel/procstate.c | 10 ++--- sysdeps/kernel/proctime.c | 8 ++-- sysdeps/kernel/procuid.c | 18 ++++----- sysdeps/kernel/sem_limits.c | 10 ++--- sysdeps/kernel/shm_limits.c | 6 +-- sysdeps/kernel/swap.c | 6 +-- sysdeps/kernel/sysinfo.c | 2 +- sysdeps/kernel/uptime.c | 4 +- sysdeps/linux/cpu.c | 12 +++--- sysdeps/linux/loadavg.c | 8 ++-- sysdeps/linux/mem.c | 8 ++-- sysdeps/linux/msg_limits.c | 8 ++-- sysdeps/linux/netload.c | 72 +++++++++++++++++------------------ sysdeps/linux/ppp.c | 10 ++--- sysdeps/linux/procargs.c | 2 +- sysdeps/linux/prockernel.c | 8 ++-- sysdeps/linux/proclist.c | 18 ++++----- sysdeps/linux/procmap.c | 12 +++--- sysdeps/linux/procmem.c | 8 ++-- sysdeps/linux/procsegment.c | 14 +++---- sysdeps/linux/procsignal.c | 4 +- sysdeps/linux/procstate.c | 6 +-- sysdeps/linux/proctime.c | 12 +++--- sysdeps/linux/procuid.c | 12 +++--- sysdeps/linux/sem_limits.c | 10 ++--- sysdeps/linux/shm_limits.c | 6 +-- sysdeps/linux/swap.c | 6 +-- sysdeps/linux/sysinfo.c | 2 +- sysdeps/linux/uptime.c | 2 +- sysdeps/osf1/cpu.c | 6 +-- sysdeps/osf1/loadavg.c | 2 +- sysdeps/osf1/mem.c | 4 +- sysdeps/osf1/msg_limits.c | 14 +++---- sysdeps/osf1/procdata.c | 2 +- sysdeps/osf1/proclist.c | 4 +- sysdeps/osf1/procmem.c | 8 ++-- sysdeps/osf1/procsegment.c | 10 ++--- sysdeps/osf1/procsignal.c | 4 +- sysdeps/osf1/procstate.c | 4 +- sysdeps/osf1/proctime.c | 6 +-- sysdeps/osf1/procuid.c | 14 +++---- sysdeps/osf1/sem_limits.c | 18 ++++----- sysdeps/osf1/shm_limits.c | 12 +++--- sysdeps/osf1/swap.c | 4 +- sysdeps/osf1/uptime.c | 2 +- sysdeps/solaris/proclist.c | 4 +- sysdeps/solaris/proctime.c | 4 +- sysdeps/stub_suid/procdata.c | 2 +- sysdeps/sun4/cpu.c | 8 ++-- sysdeps/sun4/loadavg.c | 4 +- sysdeps/sun4/mem.c | 6 +-- sysdeps/sun4/msg_limits.c | 8 ++-- sysdeps/sun4/prockernel.c | 4 +- sysdeps/sun4/proclist.c | 6 +-- sysdeps/sun4/procmem.c | 6 +-- sysdeps/sun4/procsegment.c | 6 +-- sysdeps/sun4/procsignal.c | 6 +-- sysdeps/sun4/procstate.c | 4 +- sysdeps/sun4/proctime.c | 4 +- sysdeps/sun4/procuid.c | 12 +++--- sysdeps/sun4/sem_limits.c | 12 +++--- sysdeps/sun4/shm_limits.c | 8 ++-- sysdeps/sun4/swap.c | 2 +- sysdeps/sun4/uptime.c | 10 ++--- 101 files changed, 450 insertions(+), 450 deletions(-) diff --git a/examples/procmap.c b/examples/procmap.c index 2c0ff929..0dfd78a1 100644 --- a/examples/procmap.c +++ b/examples/procmap.c @@ -97,7 +97,7 @@ main (int argc, char *argv []) unsigned device, device_major, device_minor; char perm [5]; - if (maps [i].flags & (1 << GLIBTOP_MAP_ENTRY_FILENAME)) + if (maps [i].flags & (1L << GLIBTOP_MAP_ENTRY_FILENAME)) filename = maps [i].filename; #ifdef GLIBTOP_INODEDB diff --git a/examples/sysdeps.c b/examples/sysdeps.c index d323135d..047ea507 100644 --- a/examples/sysdeps.c +++ b/examples/sysdeps.c @@ -69,7 +69,7 @@ main (int argc, char *argv []) glibtop_get_sysdeps (&sysdeps); -#define FEATURE_CHECK(f) ((sysdeps.features & (1 << GLIBTOP_SYSDEPS_##f##)) ? 1 : 0) +#define FEATURE_CHECK(f) ((sysdeps.features & (1L << GLIBTOP_SYSDEPS_##f##)) ? 1 : 0) printf ("Sysdeps (0x%08lx):\n\n" "\tfeatures:\t\t0x%08lx\n\n" diff --git a/src/daemon/slave.c b/src/daemon/slave.c index 97eb4233..e5aabcd1 100644 --- a/src/daemon/slave.c +++ b/src/daemon/slave.c @@ -129,7 +129,7 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp, resp->u.sysdeps.features = glibtop_server_features; resp->u.sysdeps.pointer_size = sizeof (void*)*8; resp->u.sysdeps.flags = glibtop_server_features | - (1 << GLIBTOP_SYSDEPS_FEATURES); + (1L << GLIBTOP_SYSDEPS_FEATURES); resp->offset = _offset_union (sysdeps); break; #if GLIBTOP_SUID_CPU diff --git a/sysdeps/freebsd/cpu.c b/sysdeps/freebsd/cpu.c index 972b338a..a56106c7 100644 --- a/sysdeps/freebsd/cpu.c +++ b/sysdeps/freebsd/cpu.c @@ -28,9 +28,9 @@ #include static const unsigned long _glibtop_sysdeps_cpu = -(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) + -(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) + -(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY); +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) + +(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY); /* nlist structure for kernel access */ static struct nlist nlst [] = { @@ -70,7 +70,7 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf) struct clockinfo ci; size_t length; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_CPU), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_CPU), 0); memset (buf, 0, sizeof (glibtop_cpu)); diff --git a/sysdeps/freebsd/loadavg.c b/sysdeps/freebsd/loadavg.c index 834153bd..b0530e8a 100644 --- a/sysdeps/freebsd/loadavg.c +++ b/sysdeps/freebsd/loadavg.c @@ -28,7 +28,7 @@ #include static const unsigned long _glibtop_sysdeps_loadavg = -(1 << GLIBTOP_LOADAVG_LOADAVG); +(1L << GLIBTOP_LOADAVG_LOADAVG); /* Init function. */ @@ -46,7 +46,7 @@ glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf) double ldavg[3]; int i; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_LOADAVG), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_LOADAVG), 0); memset (buf, 0, sizeof (glibtop_loadavg)); diff --git a/sysdeps/freebsd/mem.c b/sysdeps/freebsd/mem.c index e8b774d8..63a71c41 100644 --- a/sysdeps/freebsd/mem.c +++ b/sysdeps/freebsd/mem.c @@ -32,14 +32,14 @@ #include static const unsigned long _glibtop_sysdeps_mem = -(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) + -(1 << GLIBTOP_MEM_FREE) + -(1 << GLIBTOP_MEM_SHARED) + -(1 << GLIBTOP_MEM_BUFFER) + +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE) + +(1L << GLIBTOP_MEM_SHARED) + +(1L << GLIBTOP_MEM_BUFFER) + #ifdef __FreeBSD__ -(1 << GLIBTOP_MEM_CACHED) + +(1L << GLIBTOP_MEM_CACHED) + #endif -(1 << GLIBTOP_MEM_USER) + (1 << GLIBTOP_MEM_LOCKED); +(1L << GLIBTOP_MEM_USER) + (1L << GLIBTOP_MEM_LOCKED); #ifndef LOG1024 #define LOG1024 10 @@ -109,7 +109,7 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf) u_int v_total_count; int bufspace; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MEM), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MEM), 0); memset (buf, 0, sizeof (glibtop_mem)); diff --git a/sysdeps/freebsd/msg_limits.c b/sysdeps/freebsd/msg_limits.c index be4b9d9f..3c4de8d5 100644 --- a/sysdeps/freebsd/msg_limits.c +++ b/sysdeps/freebsd/msg_limits.c @@ -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 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)); diff --git a/sysdeps/freebsd/netload.c b/sysdeps/freebsd/netload.c index 30821048..cc252326 100644 --- a/sysdeps/freebsd/netload.c +++ b/sysdeps/freebsd/netload.c @@ -39,20 +39,20 @@ #include static const unsigned long _glibtop_sysdeps_netload = -(1 << GLIBTOP_NETLOAD_IF_FLAGS) + -(1 << GLIBTOP_NETLOAD_MTU) + -(1 << GLIBTOP_NETLOAD_SUBNET) + -(1 << GLIBTOP_NETLOAD_ADDRESS) + -(1 << GLIBTOP_NETLOAD_PACKETS_IN) + -(1 << GLIBTOP_NETLOAD_PACKETS_OUT) + -(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) + -(1 << GLIBTOP_NETLOAD_BYTES_IN) + -(1 << GLIBTOP_NETLOAD_BYTES_OUT) + -(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) + -(1 << GLIBTOP_NETLOAD_ERRORS_IN) + -(1 << GLIBTOP_NETLOAD_ERRORS_OUT) + -(1 << GLIBTOP_NETLOAD_ERRORS_TOTAL) + -(1 << GLIBTOP_NETLOAD_COLLISIONS); +(1L << GLIBTOP_NETLOAD_IF_FLAGS) + +(1L << GLIBTOP_NETLOAD_MTU) + +(1L << GLIBTOP_NETLOAD_SUBNET) + +(1L << GLIBTOP_NETLOAD_ADDRESS) + +(1L << GLIBTOP_NETLOAD_PACKETS_IN) + +(1L << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_IN) + +(1L << GLIBTOP_NETLOAD_BYTES_OUT) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1L << GLIBTOP_NETLOAD_ERRORS_IN) + +(1L << GLIBTOP_NETLOAD_ERRORS_OUT) + +(1L << GLIBTOP_NETLOAD_ERRORS_TOTAL) + +(1L << GLIBTOP_NETLOAD_COLLISIONS); /* nlist structure for kernel access */ static struct nlist nlst [] = { @@ -87,7 +87,7 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, struct in_ifaddr in; } ifaddr; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_NETLOAD), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_NETLOAD), 0); memset (buf, 0, sizeof (glibtop_netload)); diff --git a/sysdeps/freebsd/ppp.c b/sysdeps/freebsd/ppp.c index 093148a1..9101694b 100644 --- a/sysdeps/freebsd/ppp.c +++ b/sysdeps/freebsd/ppp.c @@ -51,11 +51,11 @@ #endif static const unsigned long _glibtop_sysdeps_ppp = -(1 << GLIBTOP_PPP_STATE); +(1L << GLIBTOP_PPP_STATE); #ifdef HAVE_I4B_ACCT static const unsigned long _glibtop_sysdeps_ppp_acct = -(1 << GLIBTOP_PPP_BYTES_IN) + (1 << GLIBTOP_PPP_BYTES_OUT); +(1L << GLIBTOP_PPP_BYTES_IN) + (1L << GLIBTOP_PPP_BYTES_OUT); #endif #endif /* HAVE_I4B */ @@ -99,7 +99,7 @@ glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device) #endif int phase; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PPP), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PPP), 0); memset (buf, 0, sizeof (glibtop_ppp)); diff --git a/sysdeps/freebsd/procargs.c b/sysdeps/freebsd/procargs.c index 84a0a619..83b6a78b 100644 --- a/sysdeps/freebsd/procargs.c +++ b/sysdeps/freebsd/procargs.c @@ -33,7 +33,7 @@ #include static const unsigned long _glibtop_sysdeps_proc_args = -(1 << GLIBTOP_PROC_ARGS_SIZE); +(1L << GLIBTOP_PROC_ARGS_SIZE); /* Init function. */ @@ -59,7 +59,7 @@ glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, struct stat statb; #endif - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_ARGS), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_ARGS), 0); memset (buf, 0, sizeof (glibtop_proc_args)); diff --git a/sysdeps/freebsd/procdata.c b/sysdeps/freebsd/procdata.c index 4b76e252..65ec6822 100644 --- a/sysdeps/freebsd/procdata.c +++ b/sysdeps/freebsd/procdata.c @@ -28,7 +28,7 @@ #define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z) -#define BIT_SHIFT(x) (1 << (x % 32)) +#define BIT_SHIFT(x) (1L << (x % 64)) static const unsigned long _glibtop_sysdeps_procdata_0 = BIT_SHIFT(GLIBTOP_PROCDATA_CMD) + diff --git a/sysdeps/freebsd/prockernel.c b/sysdeps/freebsd/prockernel.c index b1dc4c76..7f0ab38a 100644 --- a/sysdeps/freebsd/prockernel.c +++ b/sysdeps/freebsd/prockernel.c @@ -49,18 +49,18 @@ #endif static const unsigned long _glibtop_sysdeps_proc_kernel_pstats = -(1 << GLIBTOP_PROC_KERNEL_MIN_FLT) + -(1 << GLIBTOP_PROC_KERNEL_MAJ_FLT) + -(1 << GLIBTOP_PROC_KERNEL_CMIN_FLT) + -(1 << GLIBTOP_PROC_KERNEL_CMAJ_FLT); +(1L << GLIBTOP_PROC_KERNEL_MIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) + +(1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT); static const unsigned long _glibtop_sysdeps_proc_kernel_pcb = -(1 << GLIBTOP_PROC_KERNEL_KSTK_EIP) + -(1 << GLIBTOP_PROC_KERNEL_KSTK_ESP); +(1L << GLIBTOP_PROC_KERNEL_KSTK_EIP) + +(1L << GLIBTOP_PROC_KERNEL_KSTK_ESP); static const unsigned long _glibtop_sysdeps_proc_kernel_wchan = -(1 << GLIBTOP_PROC_KERNEL_NWCHAN) + -(1 << GLIBTOP_PROC_KERNEL_WCHAN); +(1L << GLIBTOP_PROC_KERNEL_NWCHAN) + +(1L << GLIBTOP_PROC_KERNEL_WCHAN); /* Init function. */ @@ -86,7 +86,7 @@ glibtop_get_proc_kernel_p (glibtop *server, char filename [BUFSIZ]; struct stat statb; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); memset (buf, 0, sizeof (glibtop_proc_kernel)); @@ -102,13 +102,13 @@ glibtop_get_proc_kernel_p (glibtop *server, glibtop_error_io_r (server, "kvm_getprocs (%d)", pid); buf->nwchan = (unsigned long) pinfo [0].kp_proc.p_wchan &~ KERNBASE; - buf->flags |= (1 << GLIBTOP_PROC_KERNEL_NWCHAN); + buf->flags |= (1L << GLIBTOP_PROC_KERNEL_NWCHAN); if (pinfo [0].kp_proc.p_wchan && pinfo [0].kp_proc.p_wmesg) { strncpy (buf->wchan, pinfo [0].kp_eproc.e_wmesg, sizeof (buf->wchan) - 1); buf->wchan [sizeof (buf->wchan) - 1] = 0; - buf->flags |= (1 << GLIBTOP_PROC_KERNEL_WCHAN); + buf->flags |= (1L << GLIBTOP_PROC_KERNEL_WCHAN); } else { buf->wchan [0] = 0; } diff --git a/sysdeps/freebsd/proclist.c b/sysdeps/freebsd/proclist.c index 11ffa7b1..20353ec5 100644 --- a/sysdeps/freebsd/proclist.c +++ b/sysdeps/freebsd/proclist.c @@ -29,8 +29,8 @@ #include 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); /* Fetch list of currently running processes. * The interface of this function is a little bit different from the others: @@ -67,7 +67,7 @@ glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, int which, count; int i,j; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROCLIST), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROCLIST), 0); memset (buf, 0, sizeof (glibtop_proclist)); diff --git a/sysdeps/freebsd/procmap.c b/sysdeps/freebsd/procmap.c index e4944e4d..2c9cc251 100644 --- a/sysdeps/freebsd/procmap.c +++ b/sysdeps/freebsd/procmap.c @@ -49,13 +49,13 @@ #include static const unsigned long _glibtop_sysdeps_proc_map = -(1 << GLIBTOP_PROC_MAP_TOTAL) + (1 << GLIBTOP_PROC_MAP_NUMBER) + -(1 << GLIBTOP_PROC_MAP_SIZE); +(1L << GLIBTOP_PROC_MAP_TOTAL) + (1L << GLIBTOP_PROC_MAP_NUMBER) + +(1L << GLIBTOP_PROC_MAP_SIZE); static const unsigned long _glibtop_sysdeps_map_entry = -(1 << GLIBTOP_MAP_ENTRY_START) + (1 << GLIBTOP_MAP_ENTRY_END) + -(1 << GLIBTOP_MAP_ENTRY_OFFSET) + (1 << GLIBTOP_MAP_ENTRY_PERM) + -(1 << GLIBTOP_MAP_ENTRY_INODE) + (1 << GLIBTOP_MAP_ENTRY_DEVICE); +(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) + +(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) + +(1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE); /* Init function. */ @@ -82,7 +82,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, int count, i = 0; int update = 0; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MAP), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MAP), 0); memset (buf, 0, sizeof (glibtop_proc_map)); diff --git a/sysdeps/freebsd/procmem.c b/sysdeps/freebsd/procmem.c index 42140a7d..5217e671 100644 --- a/sysdeps/freebsd/procmem.c +++ b/sysdeps/freebsd/procmem.c @@ -46,12 +46,12 @@ #include static const unsigned long _glibtop_sysdeps_proc_mem = -(1 << GLIBTOP_PROC_MEM_SIZE) + -(1 << GLIBTOP_PROC_MEM_VSIZE) + -(1 << GLIBTOP_PROC_MEM_SHARE) + -(1 << GLIBTOP_PROC_MEM_RESIDENT) + -(1 << GLIBTOP_PROC_MEM_RSS) + -(1 << GLIBTOP_PROC_MEM_RSS_RLIM); +(1L << GLIBTOP_PROC_MEM_SIZE) + +(1L << GLIBTOP_PROC_MEM_VSIZE) + +(1L << GLIBTOP_PROC_MEM_SHARE) + +(1L << GLIBTOP_PROC_MEM_RESIDENT) + +(1L << GLIBTOP_PROC_MEM_RSS) + +(1L << GLIBTOP_PROC_MEM_RSS_RLIM); #ifndef LOG1024 #define LOG1024 10 @@ -98,7 +98,7 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, struct plimit plimit; int count; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MEM), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MEM), 0); memset (buf, 0, sizeof (glibtop_proc_mem)); diff --git a/sysdeps/freebsd/procsegment.c b/sysdeps/freebsd/procsegment.c index 1580f574..915472ef 100644 --- a/sysdeps/freebsd/procsegment.c +++ b/sysdeps/freebsd/procsegment.c @@ -48,7 +48,7 @@ glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, pid_t pid) { - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0); memset (buf, 0, sizeof (glibtop_proc_segment)); diff --git a/sysdeps/freebsd/procsignal.c b/sysdeps/freebsd/procsignal.c index 80cb1d45..38826a71 100644 --- a/sysdeps/freebsd/procsignal.c +++ b/sysdeps/freebsd/procsignal.c @@ -28,10 +28,10 @@ #include static const unsigned long _glibtop_sysdeps_proc_signal = -(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) + -(1 << GLIBTOP_PROC_SIGNAL_BLOCKED) + -(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + -(1 << GLIBTOP_PROC_SIGNAL_SIGCATCH); +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + +(1L << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + +(1L << GLIBTOP_PROC_SIGNAL_SIGCATCH); /* Init function. */ @@ -49,7 +49,7 @@ glibtop_get_proc_signal_p (glibtop *server, struct kinfo_proc *pinfo; int count = 0; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); memset (buf, 0, sizeof (glibtop_proc_signal)); diff --git a/sysdeps/freebsd/procstate.c b/sysdeps/freebsd/procstate.c index e1a2476d..b04df0fc 100644 --- a/sysdeps/freebsd/procstate.c +++ b/sysdeps/freebsd/procstate.c @@ -33,8 +33,8 @@ #endif static const unsigned long _glibtop_sysdeps_proc_state = -(1 << GLIBTOP_PROC_STATE_CMD) + (1 << GLIBTOP_PROC_STATE_UID) + -(1 << GLIBTOP_PROC_STATE_GID); +(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_UID) + +(1L << GLIBTOP_PROC_STATE_GID); /* Init function. */ @@ -54,7 +54,7 @@ glibtop_get_proc_state_p (glibtop *server, struct kinfo_proc *pinfo; int count = 0; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_STATE), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_STATE), 0); memset (buf, 0, sizeof (glibtop_proc_state)); @@ -97,5 +97,5 @@ glibtop_get_proc_state_p (glibtop *server, return; } - buf->flags |= (1 << GLIBTOP_PROC_STATE_STATE); + buf->flags |= (1L << GLIBTOP_PROC_STATE_STATE); } diff --git a/sysdeps/freebsd/proctime.c b/sysdeps/freebsd/proctime.c index 0f4384b9..2b16e0cd 100644 --- a/sysdeps/freebsd/proctime.c +++ b/sysdeps/freebsd/proctime.c @@ -32,11 +32,11 @@ #endif static const unsigned long _glibtop_sysdeps_proc_time = -(1 << GLIBTOP_PROC_TIME_RTIME) + (1 << GLIBTOP_PROC_TIME_FREQUENCY); +(1L << GLIBTOP_PROC_TIME_RTIME) + (1L << GLIBTOP_PROC_TIME_FREQUENCY); static const unsigned long _glibtop_sysdeps_proc_time_user = -(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_STIME) + -(1 << GLIBTOP_PROC_TIME_CUTIME) + (1 << GLIBTOP_PROC_TIME_CSTIME); +(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME) + +(1L << GLIBTOP_PROC_TIME_CUTIME) + (1L << GLIBTOP_PROC_TIME_CSTIME); #define tv2sec(tv) (((u_int64_t) tv.tv_sec * 1000000) + (u_int64_t) tv.tv_usec) @@ -130,7 +130,7 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, char filename [BUFSIZ]; struct stat statb; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_TIME), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_TIME), 0); memset (buf, 0, sizeof (glibtop_proc_time)); diff --git a/sysdeps/freebsd/procuid.c b/sysdeps/freebsd/procuid.c index 93e485ec..3f68a3b1 100644 --- a/sysdeps/freebsd/procuid.c +++ b/sysdeps/freebsd/procuid.c @@ -28,11 +28,11 @@ #include static const unsigned long _glibtop_sysdeps_proc_uid = -(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) + -(1 << GLIBTOP_PROC_UID_EGID) + (1 << GLIBTOP_PROC_UID_PID) + -(1 << GLIBTOP_PROC_UID_PPID) + (1 << GLIBTOP_PROC_UID_PGRP) + -(1 << GLIBTOP_PROC_UID_TPGID) + (1 << GLIBTOP_PROC_UID_PRIORITY) + -(1 << GLIBTOP_PROC_UID_NICE); +(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) + +(1L << GLIBTOP_PROC_UID_EGID) + (1L << GLIBTOP_PROC_UID_PID) + +(1L << GLIBTOP_PROC_UID_PPID) + (1L << GLIBTOP_PROC_UID_PGRP) + +(1L << GLIBTOP_PROC_UID_TPGID) + (1L << GLIBTOP_PROC_UID_PRIORITY) + +(1L << GLIBTOP_PROC_UID_NICE); /* Init function. */ @@ -51,7 +51,7 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, struct kinfo_proc *pinfo; int count = 0; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_UID), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_UID), 0); memset (buf, 0, sizeof (glibtop_proc_uid)); diff --git a/sysdeps/freebsd/sem_limits.c b/sysdeps/freebsd/sem_limits.c index a52b82f9..13b36130 100644 --- a/sysdeps/freebsd/sem_limits.c +++ b/sysdeps/freebsd/sem_limits.c @@ -37,7 +37,7 @@ glibtop_init_sem_limits_p (glibtop *server) void glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) { - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); memset (buf, 0, sizeof (glibtop_sem_limits)); } @@ -56,11 +56,11 @@ glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) #include static unsigned long _glibtop_sysdeps_sem_limits = -(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) + -(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) + -(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) + -(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) + -(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM); +(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) + +(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) + +(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) + +(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) + +(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM); /* The values in this structure never change at runtime, so we only * read it once during initialization. We have to use the name `_seminfo' @@ -97,7 +97,7 @@ glibtop_init_sem_limits_p (glibtop *server) void glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) { - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); memset (buf, 0, sizeof (glibtop_sem_limits)); diff --git a/sysdeps/freebsd/shm_limits.c b/sysdeps/freebsd/shm_limits.c index 0d049549..f8ab72c1 100644 --- a/sysdeps/freebsd/shm_limits.c +++ b/sysdeps/freebsd/shm_limits.c @@ -37,7 +37,7 @@ glibtop_init_shm_limits_p (glibtop *server) void glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) { - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); memset (buf, 0, sizeof (glibtop_shm_limits)); } @@ -56,9 +56,9 @@ glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) #include static unsigned long _glibtop_sysdeps_shm_limits = -(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) + -(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG) + -(1 << GLIBTOP_IPC_SHMALL); +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + +(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) + +(1L << GLIBTOP_IPC_SHMALL); /* The values in this structure never change at runtime, so we only * read it once during initialization. We have to use the name `_shminfo' @@ -95,7 +95,7 @@ glibtop_init_shm_limits_p (glibtop *server) void glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) { - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); memset (buf, 0, sizeof (glibtop_shm_limits)); diff --git a/sysdeps/freebsd/swap.c b/sysdeps/freebsd/swap.c index b6980b3e..d051a2d3 100644 --- a/sysdeps/freebsd/swap.c +++ b/sysdeps/freebsd/swap.c @@ -30,9 +30,9 @@ #include static const unsigned long _glibtop_sysdeps_swap = -(1 << GLIBTOP_SWAP_TOTAL) + (1 << GLIBTOP_SWAP_USED) + -(1 << GLIBTOP_SWAP_FREE) + (1 << GLIBTOP_SWAP_PAGEIN) + -(1 << GLIBTOP_SWAP_PAGEOUT); +(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) + +(1L << GLIBTOP_SWAP_FREE) + (1L << GLIBTOP_SWAP_PAGEIN) + +(1L << GLIBTOP_SWAP_PAGEOUT); #if defined(__FreeBSD__) || defined(__bsdi__) @@ -150,7 +150,7 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) static int swappgsin = -1; static int swappgsout = -1; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SWAP), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SWAP), 0); memset (buf, 0, sizeof (glibtop_swap)); diff --git a/sysdeps/freebsd/uptime.c b/sysdeps/freebsd/uptime.c index 5d0ae450..250a72d1 100644 --- a/sysdeps/freebsd/uptime.c +++ b/sysdeps/freebsd/uptime.c @@ -30,11 +30,11 @@ #include static const unsigned long _glibtop_sysdeps_uptime = -(1 << GLIBTOP_UPTIME_UPTIME) + (1 << GLIBTOP_UPTIME_IDLETIME); +(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME); static const unsigned long _required_cpu_flags = -(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_IDLE) + -(1 << GLIBTOP_CPU_FREQUENCY); +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_IDLE) + +(1L << GLIBTOP_CPU_FREQUENCY); /* Init function. */ @@ -51,7 +51,7 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf) { glibtop_cpu cpu; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_UPTIME), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_UPTIME), 0); memset (buf, 0, sizeof (glibtop_uptime)); diff --git a/sysdeps/kernel/cpu.c b/sysdeps/kernel/cpu.c index e4f10293..0440497f 100644 --- a/sysdeps/kernel/cpu.c +++ b/sysdeps/kernel/cpu.c @@ -27,14 +27,14 @@ #include static const unsigned long _glibtop_sysdeps_cpu = -(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) + -(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) + -(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY); +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) + +(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY); static const unsigned long _glibtop_sysdeps_cpu_smp = -(1 << GLIBTOP_XCPU_TOTAL) + (1 << GLIBTOP_XCPU_USER) + -(1 << GLIBTOP_XCPU_NICE) + (1 << GLIBTOP_XCPU_SYS) + -(1 << GLIBTOP_XCPU_IDLE); +(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) + +(1L << GLIBTOP_XCPU_NICE) + (1L << GLIBTOP_XCPU_SYS) + +(1L << GLIBTOP_XCPU_IDLE); /* Init function. */ diff --git a/sysdeps/kernel/loadavg.c b/sysdeps/kernel/loadavg.c index 660690cf..ef71baf5 100644 --- a/sysdeps/kernel/loadavg.c +++ b/sysdeps/kernel/loadavg.c @@ -27,7 +27,7 @@ #include static const unsigned long _glibtop_sysdeps_loadavg = -(1 << GLIBTOP_LOADAVG_LOADAVG); +(1L << GLIBTOP_LOADAVG_LOADAVG); /* Init function. */ diff --git a/sysdeps/kernel/mem.c b/sysdeps/kernel/mem.c index cb8060bb..9e922bb1 100644 --- a/sysdeps/kernel/mem.c +++ b/sysdeps/kernel/mem.c @@ -27,9 +27,9 @@ #include static const unsigned long _glibtop_sysdeps_mem = -(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) + -(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_SHARED) + -(1 << GLIBTOP_MEM_BUFFER) + (1 << GLIBTOP_MEM_CACHED); +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_SHARED) + +(1L << GLIBTOP_MEM_BUFFER) + (1L << GLIBTOP_MEM_CACHED); /* Init function. */ diff --git a/sysdeps/kernel/msg_limits.c b/sysdeps/kernel/msg_limits.c index 2d757dc4..6ea485af 100644 --- a/sysdeps/kernel/msg_limits.c +++ b/sysdeps/kernel/msg_limits.c @@ -27,10 +27,10 @@ #include static const unsigned long _glibtop_sysdeps_msg_limits = -(1 << GLIBTOP_IPC_MSGPOOL) + (1 << GLIBTOP_IPC_MSGMAP) + -(1 << GLIBTOP_IPC_MSGMAX) + (1 << GLIBTOP_IPC_MSGMNB) + -(1 << GLIBTOP_IPC_MSGMNI) + (1 << GLIBTOP_IPC_MSGSSZ) + -(1 << GLIBTOP_IPC_MSGTQL); +(1L << GLIBTOP_IPC_MSGPOOL) + (1L << GLIBTOP_IPC_MSGMAP) + +(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNB) + +(1L << GLIBTOP_IPC_MSGMNI) + (1L << GLIBTOP_IPC_MSGSSZ) + +(1L << GLIBTOP_IPC_MSGTQL); /* Init function. */ diff --git a/sysdeps/kernel/netload.c b/sysdeps/kernel/netload.c index 1ca15c0d..8205d4eb 100644 --- a/sysdeps/kernel/netload.c +++ b/sysdeps/kernel/netload.c @@ -54,16 +54,16 @@ #endif static const unsigned long _glibtop_sysdeps_netload = -(1 << GLIBTOP_NETLOAD_BYTES_IN) + -(1 << GLIBTOP_NETLOAD_BYTES_OUT) + -(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) + -(1 << GLIBTOP_NETLOAD_PACKETS_IN) + -(1 << GLIBTOP_NETLOAD_PACKETS_OUT) + -(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) + -(1 << GLIBTOP_NETLOAD_ERRORS_IN) + -(1 << GLIBTOP_NETLOAD_ERRORS_OUT) + -(1 << GLIBTOP_NETLOAD_ERRORS_TOTAL) + -(1 << GLIBTOP_NETLOAD_COLLISIONS); +(1L << GLIBTOP_NETLOAD_BYTES_IN) + +(1L << GLIBTOP_NETLOAD_BYTES_OUT) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1L << GLIBTOP_NETLOAD_PACKETS_IN) + +(1L << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_ERRORS_IN) + +(1L << GLIBTOP_NETLOAD_ERRORS_OUT) + +(1L << GLIBTOP_NETLOAD_ERRORS_TOTAL) + +(1L << GLIBTOP_NETLOAD_COLLISIONS); /* Init function. */ @@ -94,47 +94,47 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, strcpy (ifr.ifr_name, interface); if (!ioctl (skfd, SIOCGIFFLAGS, &ifr)) { - buf->flags |= (1 << GLIBTOP_NETLOAD_IF_FLAGS); + buf->flags |= (1L << GLIBTOP_NETLOAD_IF_FLAGS); flags = ifr.ifr_flags; } else flags = 0; if (flags & IFF_UP) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_UP); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP); if (flags & IFF_BROADCAST) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_BROADCAST); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST); if (flags & IFF_DEBUG) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_DEBUG); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG); if (flags & IFF_LOOPBACK) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_LOOPBACK); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK); if (flags & IFF_POINTOPOINT) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_POINTOPOINT); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT); if (flags & IFF_RUNNING) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_RUNNING); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING); if (flags & IFF_NOARP) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_NOARP); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP); if (flags & IFF_PROMISC) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_PROMISC); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC); if (flags & IFF_ALLMULTI) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_ALLMULTI); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI); if (flags & IFF_MULTICAST) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_MULTICAST); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST); strcpy (ifr.ifr_name, interface); if (!ioctl (skfd, SIOCGIFADDR, &ifr)) { struct sockaddr_in addr = *(struct sockaddr_in *) &ifr.ifr_addr; buf->address = addr.sin_addr.s_addr; - buf->flags |= (1 << GLIBTOP_NETLOAD_ADDRESS); + buf->flags |= (1L << GLIBTOP_NETLOAD_ADDRESS); } strcpy (ifr.ifr_name, interface); @@ -142,13 +142,13 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, struct sockaddr_in addr = *(struct sockaddr_in *) &ifr.ifr_addr; buf->subnet = addr.sin_addr.s_addr; - buf->flags |= (1 << GLIBTOP_NETLOAD_SUBNET); + buf->flags |= (1L << GLIBTOP_NETLOAD_SUBNET); } strcpy (ifr.ifr_name, interface); if (!ioctl (skfd, SIOCGIFMTU, &ifr)) { buf->mtu = ifr.ifr_mtu; - buf->flags |= (1 << GLIBTOP_NETLOAD_MTU); + buf->flags |= (1L << GLIBTOP_NETLOAD_MTU); } close (skfd); diff --git a/sysdeps/kernel/ppp.c b/sysdeps/kernel/ppp.c index 145d163f..f450b281 100644 --- a/sysdeps/kernel/ppp.c +++ b/sysdeps/kernel/ppp.c @@ -34,8 +34,8 @@ #include static const unsigned long _glibtop_sysdeps_ppp = -(1 << GLIBTOP_PPP_STATE) + (1 << GLIBTOP_PPP_BYTES_IN) + -(1 << GLIBTOP_PPP_BYTES_OUT); +(1L << GLIBTOP_PPP_STATE) + (1L << GLIBTOP_PPP_BYTES_IN) + +(1L << GLIBTOP_PPP_BYTES_OUT); /* Init function. */ @@ -187,13 +187,13 @@ glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device) if (is_ISDN_on (server, &online)) { buf->state = online ? GLIBTOP_PPP_STATE_ONLINE : GLIBTOP_PPP_STATE_HANGUP; - buf->flags |= (1 << GLIBTOP_PPP_STATE); + buf->flags |= (1L << GLIBTOP_PPP_STATE); } if (get_ISDN_stats (server, &in, &out)) { buf->bytes_in = in; buf->bytes_out = out; - buf->flags |= (1 << GLIBTOP_PPP_BYTES_IN) | - (1 << GLIBTOP_PPP_BYTES_OUT); + buf->flags |= (1L << GLIBTOP_PPP_BYTES_IN) | + (1L << GLIBTOP_PPP_BYTES_OUT); } } diff --git a/sysdeps/kernel/procargs.c b/sysdeps/kernel/procargs.c index 9e64c295..9b6682a1 100644 --- a/sysdeps/kernel/procargs.c +++ b/sysdeps/kernel/procargs.c @@ -29,7 +29,7 @@ #include static const unsigned long _glibtop_sysdeps_proc_args = -(1 << GLIBTOP_PROC_ARGS_SIZE); +(1L << GLIBTOP_PROC_ARGS_SIZE); /* Init function. */ diff --git a/sysdeps/kernel/prockernel.c b/sysdeps/kernel/prockernel.c index dd3be082..28f17db2 100644 --- a/sysdeps/kernel/prockernel.c +++ b/sysdeps/kernel/prockernel.c @@ -27,15 +27,15 @@ #include static const unsigned long _glibtop_sysdeps_proc_kernel = -(1 << GLIBTOP_PROC_KERNEL_MIN_FLT) + -(1 << GLIBTOP_PROC_KERNEL_MAJ_FLT) + -(1 << GLIBTOP_PROC_KERNEL_CMIN_FLT) + -(1 << GLIBTOP_PROC_KERNEL_CMAJ_FLT) + -(1 << GLIBTOP_PROC_KERNEL_KSTK_ESP) + -(1 << GLIBTOP_PROC_KERNEL_KSTK_EIP); +(1L << GLIBTOP_PROC_KERNEL_MIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) + +(1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT) + +(1L << GLIBTOP_PROC_KERNEL_KSTK_ESP) + +(1L << GLIBTOP_PROC_KERNEL_KSTK_EIP); static const unsigned long _glibtop_sysdeps_proc_kernel_kernel = -(1 << GLIBTOP_PROC_KERNEL_NWCHAN); +(1L << GLIBTOP_PROC_KERNEL_NWCHAN); /* Init function. */ diff --git a/sysdeps/kernel/proclist.c b/sysdeps/kernel/proclist.c index ecc8d648..8bacb597 100644 --- a/sysdeps/kernel/proclist.c +++ b/sysdeps/kernel/proclist.c @@ -30,8 +30,8 @@ #define GLIBTOP_PROCLIST_FLAGS 3 static const unsigned long _glibtop_sysdeps_proclist = -(1 << GLIBTOP_PROCLIST_NUMBER) + (1 << GLIBTOP_PROCLIST_SIZE) + -(1 << GLIBTOP_PROCLIST_TOTAL); +(1L << GLIBTOP_PROCLIST_NUMBER) + (1L << GLIBTOP_PROCLIST_SIZE) + +(1L << GLIBTOP_PROCLIST_TOTAL); /* Init function. */ diff --git a/sysdeps/kernel/procmap.c b/sysdeps/kernel/procmap.c index 54a2cd37..152440d1 100644 --- a/sysdeps/kernel/procmap.c +++ b/sysdeps/kernel/procmap.c @@ -30,14 +30,14 @@ #include static const unsigned long _glibtop_sysdeps_proc_map = -(1 << GLIBTOP_PROC_MAP_NUMBER) + (1 << GLIBTOP_PROC_MAP_TOTAL) + -(1 << GLIBTOP_PROC_MAP_SIZE); +(1L << GLIBTOP_PROC_MAP_NUMBER) + (1L << GLIBTOP_PROC_MAP_TOTAL) + +(1L << GLIBTOP_PROC_MAP_SIZE); static const unsigned long _glibtop_sysdeps_map_entry = -(1 << GLIBTOP_MAP_ENTRY_START) + (1 << GLIBTOP_MAP_ENTRY_END) + -(1 << GLIBTOP_MAP_ENTRY_OFFSET) + (1 << GLIBTOP_MAP_ENTRY_PERM) + -(1 << GLIBTOP_MAP_ENTRY_INODE) + (1 << GLIBTOP_MAP_ENTRY_DEVICE) + -(1 << GLIBTOP_MAP_ENTRY_FILENAME); +(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) + +(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) + +(1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE) + +(1L << GLIBTOP_MAP_ENTRY_FILENAME); /* Init function. */ diff --git a/sysdeps/kernel/procmem.c b/sysdeps/kernel/procmem.c index 613b77f3..7b168000 100644 --- a/sysdeps/kernel/procmem.c +++ b/sysdeps/kernel/procmem.c @@ -27,9 +27,9 @@ #include static const unsigned long _glibtop_sysdeps_proc_mem = -(1 << GLIBTOP_PROC_MEM_VSIZE) + (1 << GLIBTOP_PROC_MEM_SIZE) + -(1 << GLIBTOP_PROC_MEM_RESIDENT) + (1 << GLIBTOP_PROC_MEM_SHARE) + -(1 << GLIBTOP_PROC_MEM_RSS) + (1 << GLIBTOP_PROC_MEM_RSS_RLIM); +(1L << GLIBTOP_PROC_MEM_VSIZE) + (1L << GLIBTOP_PROC_MEM_SIZE) + +(1L << GLIBTOP_PROC_MEM_RESIDENT) + (1L << GLIBTOP_PROC_MEM_SHARE) + +(1L << GLIBTOP_PROC_MEM_RSS) + (1L << GLIBTOP_PROC_MEM_RSS_RLIM); #ifndef LOG1024 #define LOG1024 10 diff --git a/sysdeps/kernel/procsegment.c b/sysdeps/kernel/procsegment.c index 4ebb1526..7250fe65 100644 --- a/sysdeps/kernel/procsegment.c +++ b/sysdeps/kernel/procsegment.c @@ -27,16 +27,16 @@ #include static const unsigned long _glibtop_sysdeps_proc_segment = -(1 << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + -(1 << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) + -(1 << GLIBTOP_PROC_SEGMENT_DATA_RSS) + -(1 << GLIBTOP_PROC_SEGMENT_STACK_RSS) + -(1 << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE); +(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_STACK_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE); static const unsigned long _glibtop_sysdeps_proc_segment_state = -(1 << GLIBTOP_PROC_SEGMENT_START_CODE) + -(1 << GLIBTOP_PROC_SEGMENT_END_CODE) + -(1 << GLIBTOP_PROC_SEGMENT_START_STACK); +(1L << GLIBTOP_PROC_SEGMENT_START_CODE) + +(1L << GLIBTOP_PROC_SEGMENT_END_CODE) + +(1L << GLIBTOP_PROC_SEGMENT_START_STACK); #ifndef LOG1024 #define LOG1024 10 diff --git a/sysdeps/kernel/procsignal.c b/sysdeps/kernel/procsignal.c index 7c0f06b5..491fad55 100644 --- a/sysdeps/kernel/procsignal.c +++ b/sysdeps/kernel/procsignal.c @@ -27,10 +27,10 @@ #include static const unsigned long _glibtop_sysdeps_proc_signal = -(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) + -(1 << GLIBTOP_PROC_SIGNAL_BLOCKED) + -(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + -(1 << GLIBTOP_PROC_SIGNAL_SIGCATCH); +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + +(1L << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + +(1L << GLIBTOP_PROC_SIGNAL_SIGCATCH); /* Init function. */ diff --git a/sysdeps/kernel/procstate.c b/sysdeps/kernel/procstate.c index 1fb45866..a8770b83 100644 --- a/sysdeps/kernel/procstate.c +++ b/sysdeps/kernel/procstate.c @@ -27,11 +27,11 @@ #include static const unsigned long _glibtop_sysdeps_proc_state = -(1 << GLIBTOP_PROC_STATE_UID) + (1 << GLIBTOP_PROC_STATE_GID) + -(1 << GLIBTOP_PROC_STATE_RUID) + (1 << GLIBTOP_PROC_STATE_RGID) + -(1 << GLIBTOP_PROC_STATE_CMD) + (1 << GLIBTOP_PROC_STATE_STATE) + -(1 << GLIBTOP_PROC_STATE_HAS_CPU) + (1 << GLIBTOP_PROC_STATE_PROCESSOR) + -(1 << GLIBTOP_PROC_STATE_LAST_PROCESSOR); +(1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID) + +(1L << GLIBTOP_PROC_STATE_RUID) + (1L << GLIBTOP_PROC_STATE_RGID) + +(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_STATE) + +(1L << GLIBTOP_PROC_STATE_HAS_CPU) + (1L << GLIBTOP_PROC_STATE_PROCESSOR) + +(1L << GLIBTOP_PROC_STATE_LAST_PROCESSOR); /* Init function. */ diff --git a/sysdeps/kernel/proctime.c b/sysdeps/kernel/proctime.c index 2e09a061..eaca9b2b 100644 --- a/sysdeps/kernel/proctime.c +++ b/sysdeps/kernel/proctime.c @@ -27,12 +27,12 @@ #include static const unsigned long _glibtop_sysdeps_proc_time = -(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_STIME) + -(1 << GLIBTOP_PROC_TIME_CUTIME) + (1 << GLIBTOP_PROC_TIME_CSTIME) + -(1 << GLIBTOP_PROC_TIME_START_TIME) + (1 << GLIBTOP_PROC_TIME_FREQUENCY); +(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME) + +(1L << GLIBTOP_PROC_TIME_CUTIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) + +(1L << GLIBTOP_PROC_TIME_START_TIME) + (1L << GLIBTOP_PROC_TIME_FREQUENCY); static const unsigned long _glibtop_sysdeps_proc_time_smp = -(1 << GLIBTOP_PROC_TIME_XCPU_UTIME) + (1 << GLIBTOP_PROC_TIME_XCPU_STIME); +(1L << GLIBTOP_PROC_TIME_XCPU_UTIME) + (1L << GLIBTOP_PROC_TIME_XCPU_STIME); /* Init function. */ diff --git a/sysdeps/kernel/procuid.c b/sysdeps/kernel/procuid.c index 45f093a9..8776efb1 100644 --- a/sysdeps/kernel/procuid.c +++ b/sysdeps/kernel/procuid.c @@ -27,15 +27,15 @@ #include static const unsigned long _glibtop_sysdeps_proc_uid = -(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) + -(1 << GLIBTOP_PROC_UID_GID) + (1 << GLIBTOP_PROC_UID_EGID) + -(1 << GLIBTOP_PROC_UID_SUID) + (1 << GLIBTOP_PROC_UID_SGID) + -(1 << GLIBTOP_PROC_UID_FSUID) + (1 << GLIBTOP_PROC_UID_FSGID) + -(1 << GLIBTOP_PROC_UID_PID) + (1 << GLIBTOP_PROC_UID_PPID) + -(1 << GLIBTOP_PROC_UID_PGRP) + (1 << GLIBTOP_PROC_UID_SESSION) + -(1 << GLIBTOP_PROC_UID_TTY) + (1 << GLIBTOP_PROC_UID_TPGID) + -(1 << GLIBTOP_PROC_UID_PRIORITY) + (1 << GLIBTOP_PROC_UID_NICE) + -(1 << GLIBTOP_PROC_UID_NGROUPS) + (1 << GLIBTOP_PROC_UID_GROUPS); +(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) + +(1L << GLIBTOP_PROC_UID_GID) + (1L << GLIBTOP_PROC_UID_EGID) + +(1L << GLIBTOP_PROC_UID_SUID) + (1L << GLIBTOP_PROC_UID_SGID) + +(1L << GLIBTOP_PROC_UID_FSUID) + (1L << GLIBTOP_PROC_UID_FSGID) + +(1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) + +(1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_SESSION) + +(1L << GLIBTOP_PROC_UID_TTY) + (1L << GLIBTOP_PROC_UID_TPGID) + +(1L << GLIBTOP_PROC_UID_PRIORITY) + (1L << GLIBTOP_PROC_UID_NICE) + +(1L << GLIBTOP_PROC_UID_NGROUPS) + (1L << GLIBTOP_PROC_UID_GROUPS); #ifndef min #define min(a,b) ((a < b) ? a : b) diff --git a/sysdeps/kernel/sem_limits.c b/sysdeps/kernel/sem_limits.c index 8c85a3a9..205c2875 100644 --- a/sysdeps/kernel/sem_limits.c +++ b/sysdeps/kernel/sem_limits.c @@ -42,11 +42,11 @@ union semun #endif static unsigned long _glibtop_sysdeps_sem_limits = -(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) + -(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) + -(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) + -(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) + -(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM); +(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) + +(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) + +(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) + +(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) + +(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM); /* Init function. */ diff --git a/sysdeps/kernel/shm_limits.c b/sysdeps/kernel/shm_limits.c index e43f9a12..8b26bc5d 100644 --- a/sysdeps/kernel/shm_limits.c +++ b/sysdeps/kernel/shm_limits.c @@ -27,9 +27,9 @@ #include static unsigned long _glibtop_sysdeps_shm_limits = -(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) + -(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG) + -(1 << GLIBTOP_IPC_SHMALL); +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + +(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) + +(1L << GLIBTOP_IPC_SHMALL); /* Init function. */ diff --git a/sysdeps/kernel/swap.c b/sysdeps/kernel/swap.c index e11014a7..7ff8a4fe 100644 --- a/sysdeps/kernel/swap.c +++ b/sysdeps/kernel/swap.c @@ -27,11 +27,11 @@ #include static const unsigned long _glibtop_sysdeps_swap = -(1 << GLIBTOP_SWAP_TOTAL) + (1 << GLIBTOP_SWAP_USED) + -(1 << GLIBTOP_SWAP_FREE); +(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) + +(1L << GLIBTOP_SWAP_FREE); static const unsigned long _glibtop_sysdeps_swap_stat = -(1 << GLIBTOP_SWAP_PAGEIN) + (1 << GLIBTOP_SWAP_PAGEOUT); +(1L << GLIBTOP_SWAP_PAGEIN) + (1L << GLIBTOP_SWAP_PAGEOUT); /* Init function. */ diff --git a/sysdeps/kernel/sysinfo.c b/sysdeps/kernel/sysinfo.c index 49f374c4..d4a19bf3 100644 --- a/sysdeps/kernel/sysinfo.c +++ b/sysdeps/kernel/sysinfo.c @@ -26,7 +26,7 @@ #include static const unsigned long _glibtop_sysdeps_sysinfo = -(1 << GLIBTOP_SYSINFO_CPUINFO); +(1L << GLIBTOP_SYSINFO_CPUINFO); static glibtop_sysinfo sysinfo; diff --git a/sysdeps/kernel/uptime.c b/sysdeps/kernel/uptime.c index 7fd64d23..ac45dc7f 100644 --- a/sysdeps/kernel/uptime.c +++ b/sysdeps/kernel/uptime.c @@ -27,8 +27,8 @@ #include static unsigned long _glibtop_sysdeps_uptime = -(1 << GLIBTOP_UPTIME_UPTIME) + (1 << GLIBTOP_UPTIME_IDLETIME) + -(1 << GLIBTOP_UPTIME_BOOT_TIME); +(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME) + +(1L << GLIBTOP_UPTIME_BOOT_TIME); /* Init function. */ diff --git a/sysdeps/linux/cpu.c b/sysdeps/linux/cpu.c index 63ae5085..a362dc0f 100644 --- a/sysdeps/linux/cpu.c +++ b/sysdeps/linux/cpu.c @@ -26,14 +26,14 @@ #include static const unsigned long _glibtop_sysdeps_cpu = -(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) + -(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) + -(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY); +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) + +(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY); static const unsigned long _glibtop_sysdeps_cpu_smp = -(1 << GLIBTOP_XCPU_TOTAL) + (1 << GLIBTOP_XCPU_USER) + -(1 << GLIBTOP_XCPU_NICE) + (1 << GLIBTOP_XCPU_SYS) + -(1 << GLIBTOP_XCPU_IDLE); +(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) + +(1L << GLIBTOP_XCPU_NICE) + (1L << GLIBTOP_XCPU_SYS) + +(1L << GLIBTOP_XCPU_IDLE); /* Init function. */ diff --git a/sysdeps/linux/loadavg.c b/sysdeps/linux/loadavg.c index 30ab8c75..aedff8ca 100644 --- a/sysdeps/linux/loadavg.c +++ b/sysdeps/linux/loadavg.c @@ -26,12 +26,12 @@ #include 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. */ diff --git a/sysdeps/linux/mem.c b/sysdeps/linux/mem.c index 7ed10f4a..732dbe51 100644 --- a/sysdeps/linux/mem.c +++ b/sysdeps/linux/mem.c @@ -26,10 +26,10 @@ #include static const unsigned long _glibtop_sysdeps_mem = -(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) + -(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_SHARED) + -(1 << GLIBTOP_MEM_BUFFER) + (1 << GLIBTOP_MEM_CACHED) + -(1 << GLIBTOP_MEM_USER); +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_SHARED) + +(1L << GLIBTOP_MEM_BUFFER) + (1L << GLIBTOP_MEM_CACHED) + +(1L << GLIBTOP_MEM_USER); /* Init function. */ diff --git a/sysdeps/linux/msg_limits.c b/sysdeps/linux/msg_limits.c index 2ebd1b05..81d19c1f 100644 --- a/sysdeps/linux/msg_limits.c +++ b/sysdeps/linux/msg_limits.c @@ -27,10 +27,10 @@ #include static const unsigned long _glibtop_sysdeps_msg_limits = -(1 << GLIBTOP_IPC_MSGPOOL) + (1 << GLIBTOP_IPC_MSGMAP) + -(1 << GLIBTOP_IPC_MSGMAX) + (1 << GLIBTOP_IPC_MSGMNB) + -(1 << GLIBTOP_IPC_MSGMNI) + (1 << GLIBTOP_IPC_MSGSSZ) + -(1 << GLIBTOP_IPC_MSGTQL); +(1L << GLIBTOP_IPC_MSGPOOL) + (1L << GLIBTOP_IPC_MSGMAP) + +(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNB) + +(1L << GLIBTOP_IPC_MSGMNI) + (1L << GLIBTOP_IPC_MSGSSZ) + +(1L << GLIBTOP_IPC_MSGTQL); /* Init function. */ diff --git a/sysdeps/linux/netload.c b/sysdeps/linux/netload.c index b5b2fbdd..feff1815 100644 --- a/sysdeps/linux/netload.c +++ b/sysdeps/linux/netload.c @@ -51,40 +51,40 @@ #define _GLIBTOP_IP_FW_ACCTOUT 0x2000 /* Account outgoing packets only. */ static const unsigned long _glibtop_sysdeps_netload = -(1 << GLIBTOP_NETLOAD_ERRORS_IN) + -(1 << GLIBTOP_NETLOAD_ERRORS_OUT) + -(1 << GLIBTOP_NETLOAD_COLLISIONS); +(1L << GLIBTOP_NETLOAD_ERRORS_IN) + +(1L << GLIBTOP_NETLOAD_ERRORS_OUT) + +(1L << GLIBTOP_NETLOAD_COLLISIONS); static const unsigned long _glibtop_sysdeps_netload_data = -(1 << GLIBTOP_NETLOAD_ADDRESS) + -(1 << GLIBTOP_NETLOAD_SUBNET) + -(1 << GLIBTOP_NETLOAD_MTU); +(1L << GLIBTOP_NETLOAD_ADDRESS) + +(1L << GLIBTOP_NETLOAD_SUBNET) + +(1L << GLIBTOP_NETLOAD_MTU); static const unsigned long _glibtop_sysdeps_netload_bytes = -(1 << GLIBTOP_NETLOAD_BYTES_IN) + -(1 << GLIBTOP_NETLOAD_BYTES_OUT) + -(1 << GLIBTOP_NETLOAD_BYTES_TOTAL); +(1L << GLIBTOP_NETLOAD_BYTES_IN) + +(1L << GLIBTOP_NETLOAD_BYTES_OUT) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL); static const unsigned long _glibtop_sysdeps_netload_packets = -(1 << GLIBTOP_NETLOAD_PACKETS_IN) + -(1 << GLIBTOP_NETLOAD_PACKETS_OUT) + -(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL); +(1L << GLIBTOP_NETLOAD_PACKETS_IN) + +(1L << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL); static const unsigned long _glibtop_sysdeps_netload_total = -(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) + -(1 << GLIBTOP_NETLOAD_BYTES_TOTAL); +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL); static const unsigned long _glibtop_sysdeps_netload_in = -(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) + -(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) + -(1 << GLIBTOP_NETLOAD_PACKETS_IN) + -(1 << GLIBTOP_NETLOAD_BYTES_IN); +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1L << GLIBTOP_NETLOAD_PACKETS_IN) + +(1L << GLIBTOP_NETLOAD_BYTES_IN); static const unsigned long _glibtop_sysdeps_netload_out = -(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) + -(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) + -(1 << GLIBTOP_NETLOAD_PACKETS_OUT) + -(1 << GLIBTOP_NETLOAD_BYTES_OUT); +(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) + +(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) + +(1L << GLIBTOP_NETLOAD_PACKETS_OUT) + +(1L << GLIBTOP_NETLOAD_BYTES_OUT); /* Init function. */ @@ -118,47 +118,47 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, strcpy (ifr.ifr_name, interface); if (!ioctl (skfd, SIOCGIFFLAGS, &ifr)) { - buf->flags |= (1 << GLIBTOP_NETLOAD_IF_FLAGS); + buf->flags |= (1L << GLIBTOP_NETLOAD_IF_FLAGS); flags = ifr.ifr_flags; } else flags = 0; if (flags & IFF_UP) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_UP); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP); if (flags & IFF_BROADCAST) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_BROADCAST); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST); if (flags & IFF_DEBUG) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_DEBUG); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG); if (flags & IFF_LOOPBACK) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_LOOPBACK); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK); if (flags & IFF_POINTOPOINT) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_POINTOPOINT); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT); if (flags & IFF_RUNNING) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_RUNNING); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING); if (flags & IFF_NOARP) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_NOARP); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP); if (flags & IFF_PROMISC) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_PROMISC); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC); if (flags & IFF_ALLMULTI) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_ALLMULTI); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI); if (flags & IFF_MULTICAST) - buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_MULTICAST); + buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST); strcpy (ifr.ifr_name, interface); if (!ioctl (skfd, SIOCGIFADDR, &ifr)) { struct sockaddr_in addr = *(struct sockaddr_in *) &ifr.ifr_addr; buf->address = addr.sin_addr.s_addr; - buf->flags |= (1 << GLIBTOP_NETLOAD_ADDRESS); + buf->flags |= (1L << GLIBTOP_NETLOAD_ADDRESS); } strcpy (ifr.ifr_name, interface); @@ -166,13 +166,13 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, struct sockaddr_in addr = *(struct sockaddr_in *) &ifr.ifr_addr; buf->subnet = addr.sin_addr.s_addr; - buf->flags |= (1 << GLIBTOP_NETLOAD_SUBNET); + buf->flags |= (1L << GLIBTOP_NETLOAD_SUBNET); } strcpy (ifr.ifr_name, interface); if (!ioctl (skfd, SIOCGIFMTU, &ifr)) { buf->mtu = ifr.ifr_mtu; - buf->flags |= (1 << GLIBTOP_NETLOAD_MTU); + buf->flags |= (1L << GLIBTOP_NETLOAD_MTU); } close (skfd); diff --git a/sysdeps/linux/ppp.c b/sysdeps/linux/ppp.c index 145d163f..f450b281 100644 --- a/sysdeps/linux/ppp.c +++ b/sysdeps/linux/ppp.c @@ -34,8 +34,8 @@ #include static const unsigned long _glibtop_sysdeps_ppp = -(1 << GLIBTOP_PPP_STATE) + (1 << GLIBTOP_PPP_BYTES_IN) + -(1 << GLIBTOP_PPP_BYTES_OUT); +(1L << GLIBTOP_PPP_STATE) + (1L << GLIBTOP_PPP_BYTES_IN) + +(1L << GLIBTOP_PPP_BYTES_OUT); /* Init function. */ @@ -187,13 +187,13 @@ glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device) if (is_ISDN_on (server, &online)) { buf->state = online ? GLIBTOP_PPP_STATE_ONLINE : GLIBTOP_PPP_STATE_HANGUP; - buf->flags |= (1 << GLIBTOP_PPP_STATE); + buf->flags |= (1L << GLIBTOP_PPP_STATE); } if (get_ISDN_stats (server, &in, &out)) { buf->bytes_in = in; buf->bytes_out = out; - buf->flags |= (1 << GLIBTOP_PPP_BYTES_IN) | - (1 << GLIBTOP_PPP_BYTES_OUT); + buf->flags |= (1L << GLIBTOP_PPP_BYTES_IN) | + (1L << GLIBTOP_PPP_BYTES_OUT); } } diff --git a/sysdeps/linux/procargs.c b/sysdeps/linux/procargs.c index b8b18892..6924aee8 100644 --- a/sysdeps/linux/procargs.c +++ b/sysdeps/linux/procargs.c @@ -27,7 +27,7 @@ #include static const unsigned long _glibtop_sysdeps_proc_args = -(1 << GLIBTOP_PROC_ARGS_SIZE); +(1L << GLIBTOP_PROC_ARGS_SIZE); /* Init function. */ diff --git a/sysdeps/linux/prockernel.c b/sysdeps/linux/prockernel.c index 4e4a9d7b..46a82ec6 100644 --- a/sysdeps/linux/prockernel.c +++ b/sysdeps/linux/prockernel.c @@ -26,10 +26,10 @@ #include static const unsigned long _glibtop_sysdeps_proc_kernel = -(1 << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1 << GLIBTOP_PROC_KERNEL_MIN_FLT) + -(1 << GLIBTOP_PROC_KERNEL_MAJ_FLT) + (1 << GLIBTOP_PROC_KERNEL_CMIN_FLT) + -(1 << GLIBTOP_PROC_KERNEL_CMAJ_FLT) + (1 << GLIBTOP_PROC_KERNEL_KSTK_ESP) + -(1 << GLIBTOP_PROC_KERNEL_KSTK_EIP) + (1 << GLIBTOP_PROC_KERNEL_WCHAN); +(1L << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1L << GLIBTOP_PROC_KERNEL_MIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) + (1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) + +(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT) + (1L << GLIBTOP_PROC_KERNEL_KSTK_ESP) + +(1L << GLIBTOP_PROC_KERNEL_KSTK_EIP) + (1L << GLIBTOP_PROC_KERNEL_WCHAN); /* Init function. */ diff --git a/sysdeps/linux/proclist.c b/sysdeps/linux/proclist.c index 4e049d00..cb6a664d 100644 --- a/sysdeps/linux/proclist.c +++ b/sysdeps/linux/proclist.c @@ -34,8 +34,8 @@ #include 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. */ @@ -122,28 +122,28 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf, case GLIBTOP_KERN_PROC_PGRP: /* Do you really, really need this ? */ glibtop_get_proc_uid_s (server, &procuid, pid); - if (procuid.flags & (1 << GLIBTOP_PROC_UID_PGRP)) + if (procuid.flags & (1L << GLIBTOP_PROC_UID_PGRP)) if ((int) arg != procuid.pgrp) continue; break; case GLIBTOP_KERN_PROC_SESSION: /* Do you really, really need this ? */ glibtop_get_proc_uid_s (server, &procuid, pid); - if (procuid.flags & (1 << GLIBTOP_PROC_UID_SESSION)) + if (procuid.flags & (1L << GLIBTOP_PROC_UID_SESSION)) if ((int) arg != procuid.session) continue; break; case GLIBTOP_KERN_PROC_TTY: /* Do you really, really need this ? */ glibtop_get_proc_uid_s (server, &procuid, pid); - if (procuid.flags & (1 << GLIBTOP_PROC_UID_TTY)) + if (procuid.flags & (1L << GLIBTOP_PROC_UID_TTY)) if ((int) arg != procuid.tty) continue; break; case GLIBTOP_KERN_PROC_RUID: /* Do you really, really need this ? */ glibtop_get_proc_uid_s (server, &procuid, pid); - if (procuid.flags & (1 << GLIBTOP_PROC_UID_EUID)) + if (procuid.flags & (1L << GLIBTOP_PROC_UID_EUID)) if ((int) arg != procuid.euid) continue; break; @@ -151,19 +151,19 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf, if (which & GLIBTOP_EXCLUDE_NOTTY) { glibtop_get_proc_uid_s (server, &procuid, pid); - if (procuid.flags & (1 << GLIBTOP_PROC_UID_TTY)) + if (procuid.flags & (1L << GLIBTOP_PROC_UID_TTY)) if (procuid.tty == -1) continue; } if (which & GLIBTOP_EXCLUDE_IDLE) { glibtop_get_proc_state_s (server, &procstate, pid); - if (procstate.flags & (1 << GLIBTOP_PROC_STATE_STATE)) + if (procstate.flags & (1L << GLIBTOP_PROC_STATE_STATE)) if (procstate.state != 'R') continue; } if (which & GLIBTOP_EXCLUDE_SYSTEM) { glibtop_get_proc_uid_s (server, &procuid, pid); - if (procuid.flags & (1 << GLIBTOP_PROC_UID_UID)) + if (procuid.flags & (1L << GLIBTOP_PROC_UID_UID)) if (procuid.uid == 0) continue; } diff --git a/sysdeps/linux/procmap.c b/sysdeps/linux/procmap.c index d77dd912..9052c84a 100644 --- a/sysdeps/linux/procmap.c +++ b/sysdeps/linux/procmap.c @@ -27,14 +27,14 @@ #include static const unsigned long _glibtop_sysdeps_proc_map = -(1 << GLIBTOP_PROC_MAP_NUMBER) + (1 << GLIBTOP_PROC_MAP_TOTAL) + -(1 << GLIBTOP_PROC_MAP_SIZE); +(1L << GLIBTOP_PROC_MAP_NUMBER) + (1L << GLIBTOP_PROC_MAP_TOTAL) + +(1L << GLIBTOP_PROC_MAP_SIZE); static const unsigned long _glibtop_sysdeps_map_entry = -(1 << GLIBTOP_MAP_ENTRY_START) + (1 << GLIBTOP_MAP_ENTRY_END) + -(1 << GLIBTOP_MAP_ENTRY_OFFSET) + (1 << GLIBTOP_MAP_ENTRY_PERM) + -(1 << GLIBTOP_MAP_ENTRY_INODE) + (1 << GLIBTOP_MAP_ENTRY_DEVICE) + -(1 << GLIBTOP_MAP_ENTRY_FILENAME); +(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) + +(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) + +(1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE) + +(1L << GLIBTOP_MAP_ENTRY_FILENAME); /* Init function. */ diff --git a/sysdeps/linux/procmem.c b/sysdeps/linux/procmem.c index baf34323..3e868ee8 100644 --- a/sysdeps/linux/procmem.c +++ b/sysdeps/linux/procmem.c @@ -26,12 +26,12 @@ #include static const unsigned long _glibtop_sysdeps_proc_mem = -(1 << GLIBTOP_PROC_MEM_VSIZE) + (1 << GLIBTOP_PROC_MEM_RSS) + -(1 << GLIBTOP_PROC_MEM_RSS_RLIM); +(1L << GLIBTOP_PROC_MEM_VSIZE) + (1L << GLIBTOP_PROC_MEM_RSS) + +(1L << GLIBTOP_PROC_MEM_RSS_RLIM); static const unsigned long _glibtop_sysdeps_proc_mem_statm = -(1 << GLIBTOP_PROC_MEM_SIZE) + (1 << GLIBTOP_PROC_MEM_RESIDENT) + -(1 << GLIBTOP_PROC_MEM_SHARE); +(1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_RESIDENT) + +(1L << GLIBTOP_PROC_MEM_SHARE); #ifndef LOG1024 #define LOG1024 10 diff --git a/sysdeps/linux/procsegment.c b/sysdeps/linux/procsegment.c index 0a698ad0..3179ae40 100644 --- a/sysdeps/linux/procsegment.c +++ b/sysdeps/linux/procsegment.c @@ -26,16 +26,16 @@ #include static const unsigned long _glibtop_sysdeps_proc_segment = -(1 << GLIBTOP_PROC_SEGMENT_START_CODE) + -(1 << GLIBTOP_PROC_SEGMENT_END_CODE) + -(1 << GLIBTOP_PROC_SEGMENT_START_STACK); +(1L << GLIBTOP_PROC_SEGMENT_START_CODE) + +(1L << GLIBTOP_PROC_SEGMENT_END_CODE) + +(1L << GLIBTOP_PROC_SEGMENT_START_STACK); static const unsigned long _glibtop_sysdeps_proc_segment_statm = -(1 << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + /* Disabled due to bug in the Linux Kernel. */ -/* (1 << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) + */ -(1 << GLIBTOP_PROC_SEGMENT_DATA_RSS) + -(1 << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE); +/* (1L << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) + */ +(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE); #ifndef LOG1024 #define LOG1024 10 diff --git a/sysdeps/linux/procsignal.c b/sysdeps/linux/procsignal.c index 96b24417..7d8fa56c 100644 --- a/sysdeps/linux/procsignal.c +++ b/sysdeps/linux/procsignal.c @@ -26,8 +26,8 @@ #include static const unsigned long _glibtop_sysdeps_proc_signal = -(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1 << GLIBTOP_PROC_SIGNAL_BLOCKED) + -(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1 << GLIBTOP_PROC_SIGNAL_SIGCATCH); +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1L << GLIBTOP_PROC_SIGNAL_SIGCATCH); /* Init function. */ diff --git a/sysdeps/linux/procstate.c b/sysdeps/linux/procstate.c index 9ef987c7..ea56b20c 100644 --- a/sysdeps/linux/procstate.c +++ b/sysdeps/linux/procstate.c @@ -28,10 +28,10 @@ #include 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); } diff --git a/sysdeps/linux/proctime.c b/sysdeps/linux/proctime.c index 1ccbbca1..10d1e3b5 100644 --- a/sysdeps/linux/proctime.c +++ b/sysdeps/linux/proctime.c @@ -26,14 +26,14 @@ #include static const unsigned long _glibtop_sysdeps_proc_time = -(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_CUTIME) + -(1 << GLIBTOP_PROC_TIME_STIME) + (1 << GLIBTOP_PROC_TIME_CSTIME) + -(1 << GLIBTOP_PROC_TIME_RTIME) + (1 << GLIBTOP_PROC_TIME_FREQUENCY) + -(1 << GLIBTOP_PROC_TIME_TIMEOUT) + (1 << GLIBTOP_PROC_TIME_IT_REAL_VALUE) + -(1 << GLIBTOP_PROC_TIME_START_TIME); +(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_CUTIME) + +(1L << GLIBTOP_PROC_TIME_STIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) + +(1L << GLIBTOP_PROC_TIME_RTIME) + (1L << GLIBTOP_PROC_TIME_FREQUENCY) + +(1L << GLIBTOP_PROC_TIME_TIMEOUT) + (1L << GLIBTOP_PROC_TIME_IT_REAL_VALUE) + +(1L << GLIBTOP_PROC_TIME_START_TIME); static const unsigned long _glibtop_sysdeps_proc_time_smp = -(1 << GLIBTOP_PROC_TIME_XCPU_UTIME) + (1 << GLIBTOP_PROC_TIME_XCPU_STIME); +(1L << GLIBTOP_PROC_TIME_XCPU_UTIME) + (1L << GLIBTOP_PROC_TIME_XCPU_STIME); /* Init function. */ diff --git a/sysdeps/linux/procuid.c b/sysdeps/linux/procuid.c index a9cb7179..a7585dcc 100644 --- a/sysdeps/linux/procuid.c +++ b/sysdeps/linux/procuid.c @@ -26,14 +26,14 @@ #include static const unsigned long _glibtop_sysdeps_proc_uid = -(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) + -(1 << GLIBTOP_PROC_UID_GID) + (1 << GLIBTOP_PROC_UID_EGID); +(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) + +(1L << GLIBTOP_PROC_UID_GID) + (1L << GLIBTOP_PROC_UID_EGID); static const unsigned long _glibtop_sysdeps_proc_uid_stat = -(1 << GLIBTOP_PROC_UID_PID) + (1 << GLIBTOP_PROC_UID_PPID) + -(1 << GLIBTOP_PROC_UID_PGRP) + (1 << GLIBTOP_PROC_UID_SESSION) + -(1 << GLIBTOP_PROC_UID_TTY) + (1 << GLIBTOP_PROC_UID_TPGID) + -(1 << GLIBTOP_PROC_UID_PRIORITY) + (1 << GLIBTOP_PROC_UID_NICE); +(1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) + +(1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_SESSION) + +(1L << GLIBTOP_PROC_UID_TTY) + (1L << GLIBTOP_PROC_UID_TPGID) + +(1L << GLIBTOP_PROC_UID_PRIORITY) + (1L << GLIBTOP_PROC_UID_NICE); #define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z) diff --git a/sysdeps/linux/sem_limits.c b/sysdeps/linux/sem_limits.c index bdb566d4..531b5f17 100644 --- a/sysdeps/linux/sem_limits.c +++ b/sysdeps/linux/sem_limits.c @@ -42,11 +42,11 @@ union semun #endif static unsigned long _glibtop_sysdeps_sem_limits = -(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) + -(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) + -(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) + -(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) + -(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM); +(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) + +(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) + +(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) + +(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) + +(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM); /* Init function. */ diff --git a/sysdeps/linux/shm_limits.c b/sysdeps/linux/shm_limits.c index da6ec92d..859160f1 100644 --- a/sysdeps/linux/shm_limits.c +++ b/sysdeps/linux/shm_limits.c @@ -27,9 +27,9 @@ #include static unsigned long _glibtop_sysdeps_shm_limits = -(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) + -(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG) + -(1 << GLIBTOP_IPC_SHMALL); +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + +(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) + +(1L << GLIBTOP_IPC_SHMALL); /* Init function. */ diff --git a/sysdeps/linux/swap.c b/sysdeps/linux/swap.c index 47637832..2a7d639b 100644 --- a/sysdeps/linux/swap.c +++ b/sysdeps/linux/swap.c @@ -28,11 +28,11 @@ #include static unsigned long _glibtop_sysdeps_swap = -(1 << GLIBTOP_SWAP_TOTAL) + (1 << GLIBTOP_SWAP_USED) + -(1 << GLIBTOP_SWAP_FREE); +(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) + +(1L << GLIBTOP_SWAP_FREE); static unsigned long _glibtop_sysdeps_swap_paging = -(1 << GLIBTOP_SWAP_PAGEIN) + (1 << GLIBTOP_SWAP_PAGEOUT); +(1L << GLIBTOP_SWAP_PAGEIN) + (1L << GLIBTOP_SWAP_PAGEOUT); /* Init function. */ diff --git a/sysdeps/linux/sysinfo.c b/sysdeps/linux/sysinfo.c index 49f374c4..d4a19bf3 100644 --- a/sysdeps/linux/sysinfo.c +++ b/sysdeps/linux/sysinfo.c @@ -26,7 +26,7 @@ #include static const unsigned long _glibtop_sysdeps_sysinfo = -(1 << GLIBTOP_SYSINFO_CPUINFO); +(1L << GLIBTOP_SYSINFO_CPUINFO); static glibtop_sysinfo sysinfo; diff --git a/sysdeps/linux/uptime.c b/sysdeps/linux/uptime.c index eab840ae..e347a74e 100644 --- a/sysdeps/linux/uptime.c +++ b/sysdeps/linux/uptime.c @@ -26,7 +26,7 @@ #include static unsigned long _glibtop_sysdeps_uptime = -(1 << GLIBTOP_UPTIME_UPTIME) + (1 << GLIBTOP_UPTIME_IDLETIME); +(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME); /* Init function. */ diff --git a/sysdeps/osf1/cpu.c b/sysdeps/osf1/cpu.c index bb1dacf1..680c11f8 100644 --- a/sysdeps/osf1/cpu.c +++ b/sysdeps/osf1/cpu.c @@ -26,9 +26,9 @@ #include static const unsigned long _glibtop_sysdeps_cpu = -(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) + -(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) + -(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY); +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) + +(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY); /* Init function. */ diff --git a/sysdeps/osf1/loadavg.c b/sysdeps/osf1/loadavg.c index 5dd7f56f..abf88ec7 100644 --- a/sysdeps/osf1/loadavg.c +++ b/sysdeps/osf1/loadavg.c @@ -26,7 +26,7 @@ #include static const unsigned long _glibtop_sysdeps_loadavg = -(1 << GLIBTOP_LOADAVG_LOADAVG); +(1L << GLIBTOP_LOADAVG_LOADAVG); /* Init function. */ diff --git a/sysdeps/osf1/mem.c b/sysdeps/osf1/mem.c index 156f0b60..d76e595c 100644 --- a/sysdeps/osf1/mem.c +++ b/sysdeps/osf1/mem.c @@ -32,8 +32,8 @@ #include static const unsigned long _glibtop_sysdeps_mem = -(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) + -(1 << GLIBTOP_MEM_FREE); +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE); /* Init function. */ diff --git a/sysdeps/osf1/msg_limits.c b/sysdeps/osf1/msg_limits.c index da2ab511..2b198963 100644 --- a/sysdeps/osf1/msg_limits.c +++ b/sysdeps/osf1/msg_limits.c @@ -26,9 +26,9 @@ #include static const unsigned long _glibtop_sysdeps_msg_limits = -(1 << GLIBTOP_IPC_MSGMAP) + (1 << GLIBTOP_IPC_MSGMAX) + -(1 << GLIBTOP_IPC_MSGMNB) + (1 << GLIBTOP_IPC_MSGMNI) + -(1 << GLIBTOP_IPC_MSGTQL); +(1L << GLIBTOP_IPC_MSGMAP) + (1L << GLIBTOP_IPC_MSGMAX) + +(1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGMNI) + +(1L << GLIBTOP_IPC_MSGTQL); /* Init function. */ @@ -54,7 +54,7 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf) if (ret != 1) return; - buf->flags += (1 << GLIBTOP_IPC_MSGMAX); + buf->flags += (1L << GLIBTOP_IPC_MSGMAX); buf->msgmax = value; @@ -63,7 +63,7 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf) if (ret != 1) return; - buf->flags += (1 << GLIBTOP_IPC_MSGMNB); + buf->flags += (1L << GLIBTOP_IPC_MSGMNB); buf->msgmnb = value; @@ -72,7 +72,7 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf) if (ret != 1) return; - buf->flags += (1 << GLIBTOP_IPC_MSGMNI); + buf->flags += (1L << GLIBTOP_IPC_MSGMNI); buf->msgmni = value; @@ -81,7 +81,7 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf) if (ret != 1) return; - buf->flags += (1 << GLIBTOP_IPC_MSGTQL); + buf->flags += (1L << GLIBTOP_IPC_MSGTQL); buf->msgtql = value; } diff --git a/sysdeps/osf1/procdata.c b/sysdeps/osf1/procdata.c index 24fc2ae5..96bb1430 100644 --- a/sysdeps/osf1/procdata.c +++ b/sysdeps/osf1/procdata.c @@ -34,7 +34,7 @@ /* Provides detailed information about a process. */ -#define BIT_SHIFT(x) (1 << (x % 32)) +#define BIT_SHIFT(x) (1L << (x % 64)) static const unsigned long _glibtop_sysdeps_procdata_0 = BIT_SHIFT(GLIBTOP_PROCDATA_CMD) + diff --git a/sysdeps/osf1/proclist.c b/sysdeps/osf1/proclist.c index 98c217db..607aeeae 100644 --- a/sysdeps/osf1/proclist.c +++ b/sysdeps/osf1/proclist.c @@ -29,8 +29,8 @@ #include 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. */ diff --git a/sysdeps/osf1/procmem.c b/sysdeps/osf1/procmem.c index d36d1032..05038c5b 100644 --- a/sysdeps/osf1/procmem.c +++ b/sysdeps/osf1/procmem.c @@ -36,8 +36,8 @@ #include static const unsigned long _glibtop_sysdeps_proc_mem = -(1 << GLIBTOP_PROC_MEM_VSIZE) + (1 << GLIBTOP_PROC_MEM_RESIDENT) + -(1 << GLIBTOP_PROC_MEM_RSS); +(1L << GLIBTOP_PROC_MEM_VSIZE) + (1L << GLIBTOP_PROC_MEM_RESIDENT) + +(1L << GLIBTOP_PROC_MEM_RSS); /* Init function. */ @@ -98,6 +98,6 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, buf->share = u.u_ru.ru_ixrss; - buf->flags |= (1 << GLIBTOP_PROC_MEM_RSS_RLIM) | - (1 << GLIBTOP_PROC_MEM_SHARE); + buf->flags |= (1L << GLIBTOP_PROC_MEM_RSS_RLIM) | + (1L << GLIBTOP_PROC_MEM_SHARE); } diff --git a/sysdeps/osf1/procsegment.c b/sysdeps/osf1/procsegment.c index 0aeeaa97..935a1b0b 100644 --- a/sysdeps/osf1/procsegment.c +++ b/sysdeps/osf1/procsegment.c @@ -29,11 +29,11 @@ #include static const unsigned long _glibtop_sysdeps_proc_segment = -(1 << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + -(1 << GLIBTOP_PROC_SEGMENT_DATA_RSS) + -(1 << GLIBTOP_PROC_SEGMENT_START_CODE) + -(1 << GLIBTOP_PROC_SEGMENT_END_CODE) + -(1 << GLIBTOP_PROC_SEGMENT_START_STACK); +(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_START_CODE) + +(1L << GLIBTOP_PROC_SEGMENT_END_CODE) + +(1L << GLIBTOP_PROC_SEGMENT_START_STACK); /* Init function. */ diff --git a/sysdeps/osf1/procsignal.c b/sysdeps/osf1/procsignal.c index 3c6cc8a6..36e1e2b9 100644 --- a/sysdeps/osf1/procsignal.c +++ b/sysdeps/osf1/procsignal.c @@ -28,8 +28,8 @@ #include static const unsigned long _glibtop_sysdeps_proc_signal = -(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1 << GLIBTOP_PROC_SIGNAL_BLOCKED) + -(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1 << GLIBTOP_PROC_SIGNAL_SIGCATCH); +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1L << GLIBTOP_PROC_SIGNAL_SIGCATCH); /* Init function. */ diff --git a/sysdeps/osf1/procstate.c b/sysdeps/osf1/procstate.c index 72e0f8ed..c1abb8ed 100644 --- a/sysdeps/osf1/procstate.c +++ b/sysdeps/osf1/procstate.c @@ -28,8 +28,8 @@ #include static const unsigned long _glibtop_sysdeps_proc_state = -(1 << GLIBTOP_PROC_STATE_CMD) + (1 << GLIBTOP_PROC_STATE_STATE) + -(1 << GLIBTOP_PROC_STATE_UID); +(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_STATE) + +(1L << GLIBTOP_PROC_STATE_UID); /* Init function. */ diff --git a/sysdeps/osf1/proctime.c b/sysdeps/osf1/proctime.c index 86f46def..dc06da42 100644 --- a/sysdeps/osf1/proctime.c +++ b/sysdeps/osf1/proctime.c @@ -30,9 +30,9 @@ #include static const unsigned long _glibtop_sysdeps_proc_time = -(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_CUTIME) + -(1 << GLIBTOP_PROC_TIME_STIME) + (1 << GLIBTOP_PROC_TIME_CSTIME) + -(1 << GLIBTOP_PROC_TIME_START_TIME); +(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_CUTIME) + +(1L << GLIBTOP_PROC_TIME_STIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) + +(1L << GLIBTOP_PROC_TIME_START_TIME); /* Init function. */ diff --git a/sysdeps/osf1/procuid.c b/sysdeps/osf1/procuid.c index 4a494b61..f5ca4636 100644 --- a/sysdeps/osf1/procuid.c +++ b/sysdeps/osf1/procuid.c @@ -36,11 +36,11 @@ /* Provides detailed information about a process. */ static const unsigned long _glibtop_sysdeps_proc_uid = -(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) + -(1 << GLIBTOP_PROC_UID_GID) + (1 << GLIBTOP_PROC_UID_EGID) + -(1 << GLIBTOP_PROC_UID_PID) + (1 << GLIBTOP_PROC_UID_PPID) + -(1 << GLIBTOP_PROC_UID_PGRP) + (1 << GLIBTOP_PROC_UID_SESSION) + -(1 << GLIBTOP_PROC_UID_TTY) + (1 << GLIBTOP_PROC_UID_TPGID); +(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) + +(1L << GLIBTOP_PROC_UID_GID) + (1L << GLIBTOP_PROC_UID_EGID) + +(1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) + +(1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_SESSION) + +(1L << GLIBTOP_PROC_UID_TTY) + (1L << GLIBTOP_PROC_UID_TPGID); /* Init function. */ @@ -118,7 +118,7 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, buf->priority = taskinfo.base_priority; - buf->flags += (1 << GLIBTOP_PROC_UID_PRIORITY); + buf->flags += (1L << GLIBTOP_PROC_UID_PRIORITY); errno = 0; @@ -128,5 +128,5 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, buf->nice = ret; - buf->flags += (1 << GLIBTOP_PROC_UID_NICE); + buf->flags += (1L << GLIBTOP_PROC_UID_NICE); } diff --git a/sysdeps/osf1/sem_limits.c b/sysdeps/osf1/sem_limits.c index 69bb170f..c054c3c2 100644 --- a/sysdeps/osf1/sem_limits.c +++ b/sysdeps/osf1/sem_limits.c @@ -26,9 +26,9 @@ #include static unsigned long _glibtop_sysdeps_sem_limits = -(1 << GLIBTOP_IPC_SEMMNI) + (1 << GLIBTOP_IPC_SEMMSL) + -(1 << GLIBTOP_IPC_SEMOPM) + (1 << GLIBTOP_IPC_SEMVMX) + -(1 << GLIBTOP_IPC_SEMAEM); +(1L << GLIBTOP_IPC_SEMMNI) + (1L << GLIBTOP_IPC_SEMMSL) + +(1L << GLIBTOP_IPC_SEMOPM) + (1L << GLIBTOP_IPC_SEMVMX) + +(1L << GLIBTOP_IPC_SEMAEM); /* Init function. */ @@ -54,7 +54,7 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf) if (ret != 1) return; - buf->flags += (1 << GLIBTOP_IPC_SEMMNI); + buf->flags += (1L << GLIBTOP_IPC_SEMMNI); buf->semmni = value; @@ -64,7 +64,7 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf) if (ret != 1) return; - buf->flags += (1 << GLIBTOP_IPC_SEMMSL); + buf->flags += (1L << GLIBTOP_IPC_SEMMSL); buf->semmsl = value; @@ -74,7 +74,7 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf) if (ret != 1) return; - buf->flags += (1 << GLIBTOP_IPC_SEMOPM); + buf->flags += (1L << GLIBTOP_IPC_SEMOPM); buf->semopm = value; @@ -84,7 +84,7 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf) if (ret != 1) return; - buf->flags += (1 << GLIBTOP_IPC_SEMUME); + buf->flags += (1L << GLIBTOP_IPC_SEMUME); buf->semume = value; @@ -94,7 +94,7 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf) if (ret != 1) return; - buf->flags += (1 << GLIBTOP_IPC_SEMVMX); + buf->flags += (1L << GLIBTOP_IPC_SEMVMX); buf->semvmx = value; @@ -104,7 +104,7 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf) if (ret != 1) return; - buf->flags += (1 << GLIBTOP_IPC_SEMAEM); + buf->flags += (1L << GLIBTOP_IPC_SEMAEM); buf->semaem = value; } diff --git a/sysdeps/osf1/shm_limits.c b/sysdeps/osf1/shm_limits.c index a183c9ea..03069205 100644 --- a/sysdeps/osf1/shm_limits.c +++ b/sysdeps/osf1/shm_limits.c @@ -26,8 +26,8 @@ #include 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; } diff --git a/sysdeps/osf1/swap.c b/sysdeps/osf1/swap.c index 66f15c82..db322413 100644 --- a/sysdeps/osf1/swap.c +++ b/sysdeps/osf1/swap.c @@ -26,8 +26,8 @@ #include static unsigned long _glibtop_sysdeps_swap = -(1 << GLIBTOP_SWAP_TOTAL) + (1 << GLIBTOP_SWAP_USED) + -(1 << GLIBTOP_SWAP_FREE); +(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) + +(1L << GLIBTOP_SWAP_FREE); /* Init function. */ diff --git a/sysdeps/osf1/uptime.c b/sysdeps/osf1/uptime.c index 911acaf9..4e968a1b 100644 --- a/sysdeps/osf1/uptime.c +++ b/sysdeps/osf1/uptime.c @@ -28,7 +28,7 @@ #include static unsigned long _glibtop_sysdeps_uptime = -(1 << GLIBTOP_UPTIME_UPTIME); +(1L << GLIBTOP_UPTIME_UPTIME); /* Init function. */ diff --git a/sysdeps/solaris/proclist.c b/sysdeps/solaris/proclist.c index a3451453..0ae2298e 100644 --- a/sysdeps/solaris/proclist.c +++ b/sysdeps/solaris/proclist.c @@ -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. */ diff --git a/sysdeps/solaris/proctime.c b/sysdeps/solaris/proctime.c index 88dfaf4f..709ebd63 100644 --- a/sysdeps/solaris/proctime.c +++ b/sysdeps/solaris/proctime.c @@ -27,8 +27,8 @@ #include 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. */ diff --git a/sysdeps/stub_suid/procdata.c b/sysdeps/stub_suid/procdata.c index 1f24d61a..1bd5696d 100644 --- a/sysdeps/stub_suid/procdata.c +++ b/sysdeps/stub_suid/procdata.c @@ -28,7 +28,7 @@ #define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z) -#define BIT_SHIFT(x) (1 << (x % 32)) +#define BIT_SHIFT(x) (1L << (x % 32)) static const unsigned long _glibtop_sysdeps_procdata_0 = BIT_SHIFT(GLIBTOP_PROCDATA_CMD) + diff --git a/sysdeps/sun4/cpu.c b/sysdeps/sun4/cpu.c index 9c27e538..a0f40b1e 100644 --- a/sysdeps/sun4/cpu.c +++ b/sysdeps/sun4/cpu.c @@ -27,9 +27,9 @@ #include static const unsigned long _glibtop_sysdeps_cpu = -(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) + -(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) + -(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY); +(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + +(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) + +(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY); /* Provides information about cpu usage. */ @@ -39,7 +39,7 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf) long cp_time [CPUSTATES], mp_time [NCPU][CPUSTATES]; int i; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_CPU), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_CPU), 0); memset (buf, 0, sizeof (glibtop_cpu)); diff --git a/sysdeps/sun4/loadavg.c b/sysdeps/sun4/loadavg.c index 530efb9a..6b36e9eb 100644 --- a/sysdeps/sun4/loadavg.c +++ b/sysdeps/sun4/loadavg.c @@ -27,7 +27,7 @@ #include static const unsigned long _glibtop_sysdeps_loadavg = -(1 << GLIBTOP_LOADAVG_LOADAVG); +(1L << GLIBTOP_LOADAVG_LOADAVG); /* Provides load averange. */ @@ -37,7 +37,7 @@ glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf) load_avg avenrun [3]; int i; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_LOADAVG), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_LOADAVG), 0); memset (buf, 0, sizeof (glibtop_loadavg)); diff --git a/sysdeps/sun4/mem.c b/sysdeps/sun4/mem.c index 6bbac96b..b83b8200 100644 --- a/sysdeps/sun4/mem.c +++ b/sysdeps/sun4/mem.c @@ -27,8 +27,8 @@ #include static const unsigned long _glibtop_sysdeps_mem = -(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) + -(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_LOCKED); +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_LOCKED); /* define pagetok in terms of pageshift */ @@ -39,7 +39,7 @@ static const unsigned long _glibtop_sysdeps_mem = void glibtop_get_mem_p (glibtop *server, glibtop_mem *buf) { - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MEM), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MEM), 0); memset (buf, 0, sizeof (glibtop_mem)); diff --git a/sysdeps/sun4/msg_limits.c b/sysdeps/sun4/msg_limits.c index 7a01740c..6af95b6b 100644 --- a/sysdeps/sun4/msg_limits.c +++ b/sysdeps/sun4/msg_limits.c @@ -34,9 +34,9 @@ #include static const unsigned long _glibtop_sysdeps_msg_limits = -(1 << GLIBTOP_IPC_MSGMAP) + (1 << GLIBTOP_IPC_MSGMAX) + -(1 << GLIBTOP_IPC_MSGMNB) + (1 << GLIBTOP_IPC_MSGMNI) + -(1 << GLIBTOP_IPC_MSGSSZ) + (1 << GLIBTOP_IPC_MSGTQL); +(1L << GLIBTOP_IPC_MSGMAP) + (1L << GLIBTOP_IPC_MSGMAX) + +(1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGMNI) + +(1L << GLIBTOP_IPC_MSGSSZ) + (1L << GLIBTOP_IPC_MSGTQL); /* Provides information about sysv ipc limits. */ @@ -45,7 +45,7 @@ glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) { struct msginfo msginfo; - 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)); diff --git a/sysdeps/sun4/prockernel.c b/sysdeps/sun4/prockernel.c index 603e881b..1b350d8a 100644 --- a/sysdeps/sun4/prockernel.c +++ b/sysdeps/sun4/prockernel.c @@ -27,7 +27,7 @@ #include static const unsigned long _glibtop_sysdeps_proc_kernel = -(1 << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1 << GLIBTOP_PROC_KERNEL_WCHAN); +(1L << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1L << GLIBTOP_PROC_KERNEL_WCHAN); /* Provides detailed information about a process. */ @@ -37,7 +37,7 @@ glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf, { struct proc *pp; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); memset (buf, 0, sizeof (glibtop_proc_kernel)); diff --git a/sysdeps/sun4/proclist.c b/sysdeps/sun4/proclist.c index 4b6fc42e..cca310ec 100644 --- a/sysdeps/sun4/proclist.c +++ b/sysdeps/sun4/proclist.c @@ -28,8 +28,8 @@ #include 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); /* Fetch list of currently running processes. * @@ -47,7 +47,7 @@ glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, unsigned *proc_list = NULL; size_t proc_size; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROCLIST), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROCLIST), 0); memset (buf, 0, sizeof (glibtop_proclist)); diff --git a/sysdeps/sun4/procmem.c b/sysdeps/sun4/procmem.c index 979fc7af..d9fa2233 100644 --- a/sysdeps/sun4/procmem.c +++ b/sysdeps/sun4/procmem.c @@ -27,8 +27,8 @@ #include static const unsigned long _glibtop_sysdeps_proc_mem = -(1 << GLIBTOP_PROC_MEM_SIZE) + (1 << GLIBTOP_PROC_MEM_RSS) + -(1 << GLIBTOP_PROC_MEM_RSS_RLIM); +(1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_RSS) + +(1L << GLIBTOP_PROC_MEM_RSS_RLIM); /* Provides detailed information about a process. */ @@ -38,7 +38,7 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, { struct proc *pp; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MEM), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MEM), 0); memset (buf, 0, sizeof (glibtop_proc_mem)); diff --git a/sysdeps/sun4/procsegment.c b/sysdeps/sun4/procsegment.c index 8dd64bea..a0a91c6d 100644 --- a/sysdeps/sun4/procsegment.c +++ b/sysdeps/sun4/procsegment.c @@ -27,8 +27,8 @@ #include static const unsigned long _glibtop_sysdeps_proc_segment = -(1 << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + -(1 << GLIBTOP_PROC_SEGMENT_DATA_RSS); +(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + +(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS); /* Provides detailed information about a process. */ @@ -38,7 +38,7 @@ glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, { struct proc *pp; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0); memset (buf, 0, sizeof (glibtop_proc_segment)); diff --git a/sysdeps/sun4/procsignal.c b/sysdeps/sun4/procsignal.c index 66a5a2bc..3aa48cc2 100644 --- a/sysdeps/sun4/procsignal.c +++ b/sysdeps/sun4/procsignal.c @@ -27,8 +27,8 @@ #include static const unsigned long _glibtop_sysdeps_proc_signal = -(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1 << GLIBTOP_PROC_SIGNAL_BLOCKED) + -(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1 << GLIBTOP_PROC_SIGNAL_SIGCATCH); +(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED) + +(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1L << GLIBTOP_PROC_SIGNAL_SIGCATCH); /* Provides detailed information about a process. */ @@ -38,7 +38,7 @@ glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf, { struct proc *pp; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); memset (buf, 0, sizeof (glibtop_proc_signal)); diff --git a/sysdeps/sun4/procstate.c b/sysdeps/sun4/procstate.c index 4ce3734d..5e8bcdaa 100644 --- a/sysdeps/sun4/procstate.c +++ b/sysdeps/sun4/procstate.c @@ -27,7 +27,7 @@ #include static const unsigned long _glibtop_sysdeps_proc_state = -(1 << GLIBTOP_PROC_STATE_STATE) + (1 << GLIBTOP_PROC_STATE_UID); +(1L << GLIBTOP_PROC_STATE_STATE) + (1L << GLIBTOP_PROC_STATE_UID); /* Provides detailed information about a process. */ @@ -37,7 +37,7 @@ glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf, { struct proc *pp; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_STATE), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_STATE), 0); memset (buf, 0, sizeof (glibtop_proc_state)); diff --git a/sysdeps/sun4/proctime.c b/sysdeps/sun4/proctime.c index 9541f948..e2a77689 100644 --- a/sysdeps/sun4/proctime.c +++ b/sysdeps/sun4/proctime.c @@ -27,7 +27,7 @@ #include static const unsigned long _glibtop_sysdeps_proc_time = -(1 << GLIBTOP_PROC_TIME_START_TIME) + (1 << GLIBTOP_PROC_TIME_UTIME); +(1L << GLIBTOP_PROC_TIME_START_TIME) + (1L << GLIBTOP_PROC_TIME_UTIME); /* Provides detailed information about a process. */ @@ -37,7 +37,7 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, { struct proc *pp; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_TIME), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_TIME), 0); memset (buf, 0, sizeof (glibtop_proc_time)); diff --git a/sysdeps/sun4/procuid.c b/sysdeps/sun4/procuid.c index 5ff0e5bf..fd0e3af7 100644 --- a/sysdeps/sun4/procuid.c +++ b/sysdeps/sun4/procuid.c @@ -27,11 +27,11 @@ #include static const unsigned long _glibtop_sysdeps_proc_uid = -(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) + -(1 << GLIBTOP_PROC_UID_EGID) + (1 << GLIBTOP_PROC_UID_PID) + -(1 << GLIBTOP_PROC_UID_PPID) + (1 << GLIBTOP_PROC_UID_PGRP) + -(1 << GLIBTOP_PROC_UID_TPGID) + (1 << GLIBTOP_PROC_UID_PRIORITY) + -(1 << GLIBTOP_PROC_UID_NICE); +(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) + +(1L << GLIBTOP_PROC_UID_EGID) + (1L << GLIBTOP_PROC_UID_PID) + +(1L << GLIBTOP_PROC_UID_PPID) + (1L << GLIBTOP_PROC_UID_PGRP) + +(1L << GLIBTOP_PROC_UID_TPGID) + (1L << GLIBTOP_PROC_UID_PRIORITY) + +(1L << GLIBTOP_PROC_UID_NICE); /* Provides detailed information about a process. */ @@ -41,7 +41,7 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, { struct proc *pp; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_UID), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_UID), 0); memset (buf, 0, sizeof (glibtop_proc_uid)); diff --git a/sysdeps/sun4/sem_limits.c b/sysdeps/sun4/sem_limits.c index e6f07c6c..7c4825c6 100644 --- a/sysdeps/sun4/sem_limits.c +++ b/sysdeps/sun4/sem_limits.c @@ -34,11 +34,11 @@ #include static unsigned long _glibtop_sysdeps_sem_limits = -(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) + -(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) + -(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) + -(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) + -(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM); +(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) + +(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) + +(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) + +(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) + +(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM); /* Provides information about sysv sem limits. */ @@ -47,7 +47,7 @@ glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) { struct seminfo seminfo; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); memset (buf, 0, sizeof (glibtop_sem_limits)); diff --git a/sysdeps/sun4/shm_limits.c b/sysdeps/sun4/shm_limits.c index a5f638f2..fe622242 100644 --- a/sysdeps/sun4/shm_limits.c +++ b/sysdeps/sun4/shm_limits.c @@ -34,9 +34,9 @@ #include static unsigned long _glibtop_sysdeps_shm_limits = -(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) + -(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG) + -(1 << GLIBTOP_IPC_SHMALL); +(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + +(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) + +(1L << GLIBTOP_IPC_SHMALL); /* Provides information about sysv ipc limits. */ @@ -45,7 +45,7 @@ glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) { struct shminfo shminfo; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); memset (buf, 0, sizeof (glibtop_shm_limits)); diff --git a/sysdeps/sun4/swap.c b/sysdeps/sun4/swap.c index 3c93e3a7..fd90ad15 100644 --- a/sysdeps/sun4/swap.c +++ b/sysdeps/sun4/swap.c @@ -31,7 +31,7 @@ void glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) { - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SWAP), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SWAP), 0); memset (buf, 0, sizeof (glibtop_swap)); } diff --git a/sysdeps/sun4/uptime.c b/sysdeps/sun4/uptime.c index 023cf3f3..2b89afcc 100644 --- a/sysdeps/sun4/uptime.c +++ b/sysdeps/sun4/uptime.c @@ -28,7 +28,7 @@ #include static const unsigned long _glibtop_sysdeps_uptime = -(1 << GLIBTOP_UPTIME_UPTIME) + (1 << GLIBTOP_UPTIME_IDLETIME); +(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME); /* Provides uptime and idle time. */ @@ -37,7 +37,7 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf) { glibtop_cpu cpu; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_UPTIME), 0); + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_UPTIME), 0); /* Get currect cpu usage. */ @@ -45,9 +45,9 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf) /* Make sure all required fields are present. */ - if (((cpu.flags & (1 << GLIBTOP_CPU_TOTAL)) == 0) || - ((cpu.flags & (1 << GLIBTOP_CPU_IDLE)) == 0) || - ((cpu.flags & (1 << GLIBTOP_CPU_FREQUENCY)) == 0) || + if (((cpu.flags & (1L << GLIBTOP_CPU_TOTAL)) == 0) || + ((cpu.flags & (1L << GLIBTOP_CPU_IDLE)) == 0) || + ((cpu.flags & (1L << GLIBTOP_CPU_FREQUENCY)) == 0) || (cpu.frequency == 0)) return;