summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMartin Baulig <martin@src.gnome.org>1999-05-06 21:35:36 +0000
committerMartin Baulig <martin@src.gnome.org>1999-05-06 21:35:36 +0000
commit6120c5e4a8ce2b53d19650e0d545d5ee49676ada (patch)
tree930bf82bf67a870d1507e5a0b68621bbb2ccb8e7 /examples
parentb252a80b7ed8954beeb28c0be3df20bdd83015e5 (diff)
downloadlibgtop-6120c5e4a8ce2b53d19650e0d545d5ee49676ada.tar.gz
Use `(1L << feature)' instead of `(1 << feature)' to avoid problems
with integer overflows when we add more fields.
Diffstat (limited to 'examples')
-rw-r--r--examples/procmap.c2
-rw-r--r--examples/sysdeps.c2
2 files changed, 2 insertions, 2 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"