From 91524799817c968c54d969dfdb17f2893de0ac57 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Fri, 30 Jul 1999 21:03:22 +0000 Subject: [PATCH] Fixed all warnings. --- examples/netload.c | 2 +- examples/smp.c | 2 +- examples/sysdeps.c | 2 +- examples/timings.c | 7 ++----- src/daemon/gnuserv.c | 2 +- src/daemon/slave.c | 14 +++++++------- sysdeps/guile/names/guile-names.pl | 1 - sysdeps/kernel/netload.c | 2 -- sysdeps/kernel/ppp.c | 2 ++ sysdeps/kernel/procdata.c | 2 +- sysdeps/kernel/sysinfo.c | 2 ++ sysdeps/linux/netload.c | 2 -- sysdeps/linux/ppp.c | 2 ++ 13 files changed, 20 insertions(+), 22 deletions(-) diff --git a/examples/netload.c b/examples/netload.c index 6e905e2b..a16527ec 100644 --- a/examples/netload.c +++ b/examples/netload.c @@ -43,7 +43,7 @@ int main (int argc, char *argv []) { glibtop_netload netload; - unsigned method, count, port, i; + unsigned method, count, port; struct in_addr addr, subnet; char *address_string, *subnet_string; char buffer [BUFSIZ]; diff --git a/examples/smp.c b/examples/smp.c index 78e993e9..b8f88b4e 100644 --- a/examples/smp.c +++ b/examples/smp.c @@ -67,7 +67,7 @@ main (int argc, char *argv []) memset (separator, '-', 91); separator [92] = '\0'; - sprintf (buffer, _("Ticks (%d per second):"), frequency); + sprintf (buffer, _("Ticks (%ld per second):"), frequency); printf ("\n\n%-26s %12s %12s %12s %12s %12s\n%s\n", buffer, _("Total"), _("User"), _("Nice"), _("Sys"), _("Idle"), separator); diff --git a/examples/sysdeps.c b/examples/sysdeps.c index a884f797..f2a40c51 100644 --- a/examples/sysdeps.c +++ b/examples/sysdeps.c @@ -38,7 +38,7 @@ int main (int argc, char *argv []) { glibtop_sysdeps sysdeps; - unsigned method, count, port, i; + unsigned method, count, port; char buffer [BUFSIZ]; count = PROFILE_COUNT; diff --git a/examples/timings.c b/examples/timings.c index c131c6cf..10adff74 100644 --- a/examples/timings.c +++ b/examples/timings.c @@ -70,14 +70,11 @@ int main (int argc, char *argv []) { glibtop_union data; - glibtop_sysdeps sysdeps; - unsigned c, count, port, i, *ptr; + unsigned c, count, *ptr; struct rusage total_start, total_end; struct rusage rusage_start, rusage_end; struct timeval elapsed_utime, elapsed_stime; - char buffer [BUFSIZ]; - pid_t pid, ppid; - char *args; + pid_t pid; count = PROFILE_COUNT; diff --git a/src/daemon/gnuserv.c b/src/daemon/gnuserv.c index 7df0a7ef..a1e64f1e 100644 --- a/src/daemon/gnuserv.c +++ b/src/daemon/gnuserv.c @@ -243,7 +243,7 @@ permitted (u_long host_addr, int fd) if (enable_debug) syslog_message (LOG_DEBUG, "Trying %lx - %lx", host_addr, permitted_hosts [i]); - if (permitted_hosts [i] == NULL) + if (permitted_hosts [i] == 0L) return (FALSE); if (host_addr == permitted_hosts [i]) return (TRUE); diff --git a/src/daemon/slave.c b/src/daemon/slave.c index 1658596f..62fffd01 100644 --- a/src/daemon/slave.c +++ b/src/daemon/slave.c @@ -26,12 +26,12 @@ void handle_slave_connection (int input, int output) { - glibtop *server = glibtop_global_server; - int64_t *param_ptr; - const void *ptr; + glibtop *server G_GNUC_UNUSED = glibtop_global_server; + int64_t *param_ptr G_GNUC_UNUSED; + const void *ptr G_GNUC_UNUSED; - unsigned short max_len; - pid_t pid; + unsigned short max_len G_GNUC_UNUSED; + pid_t pid G_GNUC_UNUSED; glibtop_response _resp, *resp = &_resp; glibtop_command _cmnd, *cmnd = &_cmnd; @@ -119,8 +119,8 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp, const void *parameter) { glibtop *server = glibtop_global_server; - unsigned device; - pid_t pid; + unsigned device G_GNUC_UNUSED; + pid_t pid G_GNUC_UNUSED; switch (cmnd->command) { case GLIBTOP_CMND_SYSDEPS: diff --git a/sysdeps/guile/names/guile-names.pl b/sysdeps/guile/names/guile-names.pl index 07fcdffc..bdfb2941 100644 --- a/sysdeps/guile/names/guile-names.pl +++ b/sysdeps/guile/names/guile-names.pl @@ -113,7 +113,6 @@ sub output { print 'static SCM'; print 'glibtop_guile_types_' . $feature . ' (void)'; print '{'; - print "\tint i;"; print "\tSCM list;"; print ''; diff --git a/sysdeps/kernel/netload.c b/sysdeps/kernel/netload.c index 8205d4eb..3043ef54 100644 --- a/sysdeps/kernel/netload.c +++ b/sysdeps/kernel/netload.c @@ -88,8 +88,6 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, if (skfd) { struct ifreq ifr; - struct sockaddr_in addr; - char *address; unsigned flags; strcpy (ifr.ifr_name, interface); diff --git a/sysdeps/kernel/ppp.c b/sysdeps/kernel/ppp.c index f450b281..ca476f8e 100644 --- a/sysdeps/kernel/ppp.c +++ b/sysdeps/kernel/ppp.c @@ -31,6 +31,8 @@ #include #include +#include + #include static const unsigned long _glibtop_sysdeps_ppp = diff --git a/sysdeps/kernel/procdata.c b/sysdeps/kernel/procdata.c index d00dae3a..02aae052 100644 --- a/sysdeps/kernel/procdata.c +++ b/sysdeps/kernel/procdata.c @@ -187,7 +187,7 @@ glibtop_get_proc_data_netload_s (glibtop *server, int name [2] = { CTL_LIBGTOP, LIBGTOP_NETLOAD }; size_t size = sizeof (libgtop_netload_t); - if (sysctl (name, 2, netload, &size, device, strlen (device)+1)) { + if (sysctl (name, 2, netload, &size, (char *) device, strlen (device)+1)) { glibtop_warn_io_r (server, "sysctl (libgtop/netload)"); return -1; } diff --git a/sysdeps/kernel/sysinfo.c b/sysdeps/kernel/sysinfo.c index d4a19bf3..08de5db2 100644 --- a/sysdeps/kernel/sysinfo.c +++ b/sysdeps/kernel/sysinfo.c @@ -25,6 +25,8 @@ #include #include +#include + static const unsigned long _glibtop_sysdeps_sysinfo = (1L << GLIBTOP_SYSINFO_CPUINFO); diff --git a/sysdeps/linux/netload.c b/sysdeps/linux/netload.c index feff1815..f8b1c8ec 100644 --- a/sysdeps/linux/netload.c +++ b/sysdeps/linux/netload.c @@ -112,8 +112,6 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, skfd = socket (AF_INET, SOCK_DGRAM, 0); if (skfd) { struct ifreq ifr; - struct sockaddr_in addr; - char *address; unsigned flags; strcpy (ifr.ifr_name, interface); diff --git a/sysdeps/linux/ppp.c b/sysdeps/linux/ppp.c index f450b281..ca476f8e 100644 --- a/sysdeps/linux/ppp.c +++ b/sysdeps/linux/ppp.c @@ -31,6 +31,8 @@ #include #include +#include + #include static const unsigned long _glibtop_sysdeps_ppp =