diff --git a/lib/inodedb.c b/lib/inodedb.c index 83fd6405..d3faab5a 100644 --- a/lib/inodedb.c +++ b/lib/inodedb.c @@ -33,7 +33,7 @@ glibtop_inodedb * glibtop_inodedb_open_s (glibtop *server, unsigned databases, - unsigned long cachesize) + unsigned long G_GNUC_UNUSED cachesize) { glibtop_inodedb *inodedb; char filename [BUFSIZ]; @@ -76,7 +76,8 @@ glibtop_inodedb_open_s (glibtop *server, unsigned databases, } const char * -glibtop_inodedb_lookup_s (glibtop *server, glibtop_inodedb *inodedb, +glibtop_inodedb_lookup_s (glibtop G_GNUC_UNUSED *server, + glibtop_inodedb *inodedb, u_int64_t device, u_int64_t inode) { glibtop_inodedb_key key; diff --git a/src/daemon/gnuserv.c b/src/daemon/gnuserv.c index 82fd646c..1e80b61f 100644 --- a/src/daemon/gnuserv.c +++ b/src/daemon/gnuserv.c @@ -488,7 +488,7 @@ handle_signal (int sig) } int -main (int argc, char *argv []) +main (int G_GNUC_UNUSED argc, char G_GNUC_UNUSED *argv []) { glibtop *server = glibtop_global_server; diff --git a/src/daemon/server.c b/src/daemon/server.c index 7f35c752..804f0721 100644 --- a/src/daemon/server.c +++ b/src/daemon/server.c @@ -51,10 +51,8 @@ GLIBTOP_SUID_PROC_MAP; #include int -main(int argc, char *argv[]) +main(int G_GNUC_UNUSED argc, char G_GNUC_UNUSED *argv[]) { - int fd, max_fd; - /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ int uid, euid, gid, egid; diff --git a/src/inodedb/file_by_inode.c b/src/inodedb/file_by_inode.c index 5dd4cbab..783da2fd 100644 --- a/src/inodedb/file_by_inode.c +++ b/src/inodedb/file_by_inode.c @@ -54,8 +54,10 @@ main (int argc, const char *argv []) if (!inodedb) exit (1); filename = glibtop_inodedb_lookup (inodedb, device, inode); - if (!filename) exit (0); + if (!filename) exit (2); - fprintf (stderr, "FILENAME: %lu - %lu - '%s'\n", - device, inode, filename); + fprintf (stderr, "FILENAME: %d - %d - '%s'\n", + (int) device, (int) inode, filename); + + exit (0); } diff --git a/src/inodedb/mkinodedb.c b/src/inodedb/mkinodedb.c index 51479d86..383ffd19 100644 --- a/src/inodedb/mkinodedb.c +++ b/src/inodedb/mkinodedb.c @@ -29,7 +29,7 @@ #include int -main (int argc, const char *argv []) +main (int argc, char *argv []) { GDBM_FILE dbf; char dirname [BUFSIZ]; @@ -92,7 +92,7 @@ main (int argc, const char *argv []) directory = opendir (dirname); if (!directory) continue; - while (entry = readdir (directory)) { + while ((entry = readdir (directory))) { glibtop_inodedb_key key; char filename [BUFSIZ]; datum d_key, d_content; @@ -128,4 +128,6 @@ main (int argc, const char *argv []) gdbm_close (dbf); fclose (f); + + exit (0); } diff --git a/sysdeps/common/fsusage.c b/sysdeps/common/fsusage.c index 9e6a84af..1021bf37 100644 --- a/sysdeps/common/fsusage.c +++ b/sysdeps/common/fsusage.c @@ -103,7 +103,7 @@ adjust_blocks (blocks, fromsize, tosize) static int get_fs_usage (path, disk, fsp) const char *path; - const char *disk; + const char G_GNUC_UNUSED *disk; struct fs_usage *fsp; { #ifdef STAT_STATFS3_OSF1 diff --git a/sysdeps/common/inodedb.c b/sysdeps/common/inodedb.c index 83fd6405..d3faab5a 100644 --- a/sysdeps/common/inodedb.c +++ b/sysdeps/common/inodedb.c @@ -33,7 +33,7 @@ glibtop_inodedb * glibtop_inodedb_open_s (glibtop *server, unsigned databases, - unsigned long cachesize) + unsigned long G_GNUC_UNUSED cachesize) { glibtop_inodedb *inodedb; char filename [BUFSIZ]; @@ -76,7 +76,8 @@ glibtop_inodedb_open_s (glibtop *server, unsigned databases, } const char * -glibtop_inodedb_lookup_s (glibtop *server, glibtop_inodedb *inodedb, +glibtop_inodedb_lookup_s (glibtop G_GNUC_UNUSED *server, + glibtop_inodedb *inodedb, u_int64_t device, u_int64_t inode) { glibtop_inodedb_key key; diff --git a/sysdeps/common/mountlist.c b/sysdeps/common/mountlist.c index 77f9755a..895dfce1 100644 --- a/sysdeps/common/mountlist.c +++ b/sysdeps/common/mountlist.c @@ -260,7 +260,7 @@ fstype_to_string (t) static struct mount_entry * read_filesystem_list (need_fs_type, all_fs) - int need_fs_type, all_fs; + int G_GNUC_UNUSED need_fs_type, G_GNUC_UNUSED all_fs; { struct mount_entry *mount_list; struct mount_entry *me; diff --git a/sysdeps/common/xmalloc.c b/sysdeps/common/xmalloc.c index fcf5c96d..afbaf0e4 100644 --- a/sysdeps/common/xmalloc.c +++ b/sysdeps/common/xmalloc.c @@ -64,7 +64,7 @@ glibtop_strdup_r (glibtop *server, const char *string) } void -glibtop_free_r (glibtop *server, const void *ptr) +glibtop_free_r (glibtop G_GNUC_UNUSED *server, const void *ptr) { if (ptr) free ((void *) ptr); } diff --git a/sysdeps/freebsd/close.c b/sysdeps/freebsd/close.c index 55229adf..bf9b2a64 100644 --- a/sysdeps/freebsd/close.c +++ b/sysdeps/freebsd/close.c @@ -19,10 +19,11 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include /* Closes pipe to gtop server. */ void -glibtop_close_l (glibtop *server) +glibtop_close_p (glibtop G_GNUC_UNUSED *server) { } diff --git a/sysdeps/freebsd/mem.c b/sysdeps/freebsd/mem.c index f7b86f89..a0bc55d1 100644 --- a/sysdeps/freebsd/mem.c +++ b/sysdeps/freebsd/mem.c @@ -53,7 +53,7 @@ static struct nlist nlst [] = { }; /* MIB array for sysctl */ -static int mib_length=2; +/* static int mib_length=2; */ static int mib [] = { CTL_VM, VM_METER }; /* Init function. */ diff --git a/sysdeps/freebsd/nosuid.c b/sysdeps/freebsd/nosuid.c index e43e5c9f..1e8b4665 100644 --- a/sysdeps/freebsd/nosuid.c +++ b/sysdeps/freebsd/nosuid.c @@ -21,12 +21,15 @@ #include #include +#include void -glibtop_open_s (glibtop *server, const char *program_name, - const unsigned long features, const unsigned flags) +glibtop_open_s (glibtop G_GNUC_UNUSED *server, + const char G_GNUC_UNUSED *program_name, + const unsigned long G_GNUC_UNUSED features, + const unsigned G_GNUC_UNUSED flags) { } void -glibtop_close_s (glibtop *server) +glibtop_close_s (glibtop G_GNUC_UNUSED *server) { } diff --git a/sysdeps/freebsd/open.c b/sysdeps/freebsd/open.c index 3cea527d..e4f7757d 100644 --- a/sysdeps/freebsd/open.c +++ b/sysdeps/freebsd/open.c @@ -48,7 +48,8 @@ glibtop_init_p (glibtop *server, const unsigned long features, void glibtop_open_p (glibtop *server, const char *program_name, - const unsigned long features, const unsigned flags) + const unsigned long G_GNUC_UNUSED features, + const unsigned G_GNUC_UNUSED flags) { #ifdef DEBUG fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ()); diff --git a/sysdeps/freebsd/prockernel.c b/sysdeps/freebsd/prockernel.c index f278eaf4..7c3a4d61 100644 --- a/sysdeps/freebsd/prockernel.c +++ b/sysdeps/freebsd/prockernel.c @@ -69,7 +69,7 @@ glibtop_get_proc_kernel_p (glibtop *server, struct user *u_addr = (struct user *)USRSTACK; struct pstats pstats; struct pcb pcb; - int f, count; + int count; glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); diff --git a/sysdeps/freebsd/procmap.c b/sysdeps/freebsd/procmap.c index 2cb44efd..eb916b07 100644 --- a/sysdeps/freebsd/procmap.c +++ b/sysdeps/freebsd/procmap.c @@ -58,8 +58,6 @@ static const unsigned long _glibtop_sysdeps_map_entry = void glibtop_init_proc_map_p (glibtop *server) { - register int pagesize; - server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; } @@ -71,7 +69,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, { struct kinfo_proc *pinfo; struct vm_map_entry entry, *first; - struct vmspace *vms, vmspace; + struct vmspace vmspace; struct vm_object object; glibtop_map_entry *maps; struct vnode vnode; diff --git a/sysdeps/freebsd/procmem.c b/sysdeps/freebsd/procmem.c index 56c43aa3..8d446393 100644 --- a/sysdeps/freebsd/procmem.c +++ b/sysdeps/freebsd/procmem.c @@ -88,13 +88,10 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, pid_t pid) { struct kinfo_proc *pinfo; - struct user *u_addr = (struct user *)USRSTACK; struct vm_map_entry entry, *first; struct vmspace *vms, vmspace; struct vm_object object; struct plimit plimit; - struct vnode vnode; - struct inode inode; int count; glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MEM), 0); diff --git a/sysdeps/freebsd/procsegment.c b/sysdeps/freebsd/procsegment.c index 0db0095a..41b4a99a 100644 --- a/sysdeps/freebsd/procsegment.c +++ b/sysdeps/freebsd/procsegment.c @@ -44,11 +44,8 @@ glibtop_init_proc_segment_p (glibtop *server) void glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, - pid_t pid) + pid_t G_GNUC_UNUSED pid) { - struct kinfo_proc *pinfo; - int *count; - glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0); memset (buf, 0, sizeof (glibtop_proc_segment)); diff --git a/sysdeps/freebsd/proctime.c b/sysdeps/freebsd/proctime.c index fc8f49cd..35584ccc 100644 --- a/sysdeps/freebsd/proctime.c +++ b/sysdeps/freebsd/proctime.c @@ -60,7 +60,6 @@ calcru(p, up, sp, ip) quad_t totusec; u_quad_t u, st, ut, it, tot; long sec, usec; - struct timeval tv; st = p->p_sticks; ut = p->p_uticks; @@ -105,9 +104,7 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, struct kinfo_proc *pinfo; struct user *u_addr = (struct user *)USRSTACK; struct pstats pstats; - struct pcb pcb; - int f, count; - quad_t totusec; + int count; glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_TIME), 0); diff --git a/sysdeps/freebsd/swap.c b/sysdeps/freebsd/swap.c index a3baec5d..f12c6e30 100644 --- a/sysdeps/freebsd/swap.c +++ b/sysdeps/freebsd/swap.c @@ -144,7 +144,7 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) sw_size = nswdev * sizeof (*sw); sw = glibtop_malloc_r (server, sw_size); - if (kvm_read (server->machine.kd, ptr, sw, sw_size) != sw_size) + if (kvm_read (server->machine.kd, ptr, sw, sw_size) != (ssize_t) sw_size) glibtop_error_io_r (server, "kvm_read (*swdevt)"); perdev = glibtop_malloc (nswdev * sizeof (*perdev));