Fixed all warnings.

This commit is contained in:
Martin Baulig
1999-07-30 21:03:22 +00:00
parent 2814206ffa
commit 9152479981
13 changed files with 20 additions and 22 deletions

View File

@@ -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];

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);

View File

@@ -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:

View File

@@ -113,7 +113,6 @@ sub output {
print 'static SCM';
print 'glibtop_guile_types_' . $feature . ' (void)';
print '{';
print "\tint i;";
print "\tSCM list;";
print '';

View File

@@ -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);

View File

@@ -31,6 +31,8 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#include <glib.h>
static const unsigned long _glibtop_sysdeps_ppp =

View File

@@ -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;
}

View File

@@ -25,6 +25,8 @@
#include <glibtop/cpu.h>
#include <glibtop/sysinfo.h>
#include <ctype.h>
static const unsigned long _glibtop_sysdeps_sysinfo =
(1L << GLIBTOP_SYSINFO_CPUINFO);

View File

@@ -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);

View File

@@ -31,6 +31,8 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#include <glib.h>
static const unsigned long _glibtop_sysdeps_ppp =