diff options
author | Martin Baulig <martin@src.gnome.org> | 1999-05-06 21:35:36 +0000 |
---|---|---|
committer | Martin Baulig <martin@src.gnome.org> | 1999-05-06 21:35:36 +0000 |
commit | 6120c5e4a8ce2b53d19650e0d545d5ee49676ada (patch) | |
tree | 930bf82bf67a870d1507e5a0b68621bbb2ccb8e7 /sysdeps/linux/ppp.c | |
parent | b252a80b7ed8954beeb28c0be3df20bdd83015e5 (diff) | |
download | libgtop-6120c5e4a8ce2b53d19650e0d545d5ee49676ada.tar.gz |
Use `(1L << feature)' instead of `(1 << feature)' to avoid problems
with integer overflows when we add more fields.
Diffstat (limited to 'sysdeps/linux/ppp.c')
-rw-r--r-- | sysdeps/linux/ppp.c | 10 |
1 files changed, 5 insertions, 5 deletions
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 <glib.h> 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); } } |