diff --git a/clients/lcdproc/chrono.c b/clients/lcdproc/chrono.c index 56ee622..360f874 100644 --- a/clients/lcdproc/chrono.c +++ b/clients/lcdproc/chrono.c @@ -4,9 +4,22 @@ #include #include #include -#include -#include "../../shared/sockets.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#include "shared/sockets.h" #include "main.h" #include "mode.h" diff --git a/clients/lcdproc/load.c b/clients/lcdproc/load.c index d316587..71367fc 100644 --- a/clients/lcdproc/load.c +++ b/clients/lcdproc/load.c @@ -4,16 +4,26 @@ #include #include -#include "../../shared/sockets.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#if defined( HAVE_GETLOADAVG ) && defined( HAVE_SYS_LOADAVG_H ) +# define USE_GETLOADAVG +#else +# undef USE_GETLOADAVG +#endif + +#include "shared/sockets.h" #include "main.h" #include "mode.h" #include "load.h" -#ifdef HAVE_GETLOADAVG -#include +#ifdef USE_GETLOADAVG +# include #endif + int loadavg_fd = 0; static double get_loadavg (void); @@ -22,11 +32,11 @@ static double get_loadavg (void) { double load; -#ifdef HAVE_GETLOADAVG +#ifdef USE_GETLOADAVG double loadavg[LOADAVG_NSTATS]; #endif -#ifndef HAVE_GETLOADAVG +#ifndef USE_GETLOADAVG reread (loadavg_fd, "get_load:"); sscanf (buffer, "%lf", &load); #else @@ -39,7 +49,7 @@ get_loadavg (void) int load_init () { -#ifndef SOLARIS +#ifndef USE_GETLOADAVG if (!loadavg_fd) loadavg_fd = open ("/proc/loadavg", O_RDONLY); #endif @@ -49,12 +59,11 @@ load_init () int load_close () { -#ifndef SOLARIS +#ifndef USE_GETLOADAVG if (loadavg_fd) close (loadavg_fd); loadavg_fd = 0; - #endif return 0; } diff --git a/clients/lcdproc/main.c b/clients/lcdproc/main.c index 27128a2..0dc37fc 100644 --- a/clients/lcdproc/main.c +++ b/clients/lcdproc/main.c @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include @@ -15,8 +14,8 @@ #include "main.h" #include "mode.h" -#include "../../shared/sockets.h" -#include "../../shared/debug.h" +#include "shared/sockets.h" +#include "shared/debug.h" // TODO: Commenting... Everything! diff --git a/clients/lcdproc/mem.c b/clients/lcdproc/mem.c index 4f3156a..d142db1 100644 --- a/clients/lcdproc/mem.c +++ b/clients/lcdproc/mem.c @@ -34,8 +34,6 @@ static void get_mem_info (struct meminfo *result); static void get_mem_info (struct meminfo *result) { -// int i, res; char *bufptr; - int pagesize,page; #ifndef SOLARIS reread (meminfo_fd, "get_meminfo:"); diff --git a/clients/lcdproc/mode.c b/clients/lcdproc/mode.c index 55924b4..cbb9dc8 100644 --- a/clients/lcdproc/mode.c +++ b/clients/lcdproc/mode.c @@ -6,17 +6,20 @@ #include #include -#include -#ifdef IRIX -#include -#endif #include #include -#include -#include #include -#include "../../shared/sockets.h" +#include +#if defined( IRIX ) || defined( SOLARIS ) +# include +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "shared/sockets.h" #include "mode.h" #include "main.h" @@ -29,10 +32,6 @@ #include "load.h" #include "mem.h" -#ifdef SOLARIS -#include -#endif - int ELLIPSIS = '-'; // TODO: Clean this up... Support multiple display sizes.. diff --git a/configure.in b/configure.in index 117ecb5..66a5c37 100644 --- a/configure.in +++ b/configure.in @@ -27,7 +27,7 @@ if test $debug = "yes"; then else CFLAGS="-Wno-unused -O6" fi -CFLAGS="-Wall -Wp,-lang-c-c++-comments $CFLAGS" +CFLAGS="-Wall $CFLAGS" export CFLAGS dnl Checks for programs. @@ -48,7 +48,7 @@ AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)]) AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)]) AC_CHECK_LIB(kstat, kstat_open) AC_CHECK_FUNCS(getloadavg swapctl) -AC_CHECK_HEADERS(procfs.h sys/procfs.h, break) +AC_CHECK_HEADERS(procfs.h sys/procfs.h sys/loadavg.h) dnl Some versions of Solaris require -lelf for -lkvm AC_CHECK_LIB(kvm, kvm_open,[ diff --git a/server/drivers/bayrad.c b/server/drivers/bayrad.c index c641983..452161e 100644 --- a/server/drivers/bayrad.c +++ b/server/drivers/bayrad.c @@ -11,12 +11,24 @@ #include #include #include -#include #include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif #include "lcd.h" #include "bayrad.h" #include "drv_base.h" -#include "../../shared/str.h" +#include "shared/str.h" ////////////////////////////////////////////////////////////////////////// ////////////////////// Base "class" to derive from /////////////////////// diff --git a/server/drivers/curses_drv.c b/server/drivers/curses_drv.c index acdb3cb..bb89207 100644 --- a/server/drivers/curses_drv.c +++ b/server/drivers/curses_drv.c @@ -37,7 +37,7 @@ curses_drv_init (struct lcd_logical_driver *driver, char *args) { char *argv[64]; int argc; - int i, j; + int i; argc = get_args (argv, args, 64); diff --git a/server/drivers/glk.c b/server/drivers/glk.c index 4d84505..25b241e 100644 --- a/server/drivers/glk.c +++ b/server/drivers/glk.c @@ -5,10 +5,23 @@ #include #include #include -#include + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif #include "lcd.h" -#include "../../shared/str.h" +#include "shared/str.h" #include "glk.h" #include "glkproto.h" diff --git a/server/drivers/glkproto.h b/server/drivers/glkproto.h index 683901e..d777ef5 100644 --- a/server/drivers/glkproto.h +++ b/server/drivers/glkproto.h @@ -57,6 +57,6 @@ int glkgetc( GLKDisplay * fd ); int glkpoll( GLKDisplay * fd, int timeout ); int glkflow( GLKDisplay * fd, int full, int empty ); -static int glkunget( GLKDisplay * fd, int c ); +int glkunget( GLKDisplay * fd, int c ); #endif diff --git a/server/drivers/hd44780.c b/server/drivers/hd44780.c index 3232295..36fc7c2 100644 --- a/server/drivers/hd44780.c +++ b/server/drivers/hd44780.c @@ -37,6 +37,9 @@ #include #include #include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif // Uncomment one of the lines below to select your desired delay generation // mechanism. If both defines are commented, the original I/O read timing @@ -45,13 +48,22 @@ #define DELAY_NANOSLEEP #if defined DELAY_GETTIMEOFDAY -#include -#include +# if TIME_WITH_SYS_TIME +# include +# include +# else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +# endif + // Only one alternate delay method at a time, please ;-) -#undef DELAY_NANOSLEEP +# undef DELAY_NANOSLEEP #elif defined DELAY_NANOSLEEP -#include -#include +# include +# include #endif #include "../../shared/str.h" @@ -178,7 +190,6 @@ HD44780_init (lcd_logical_driver * driver, char *args) connIdx = j; ++i; } else if (0 == strcmp (argv[i], "-v") || 0 == strcmp (argv[i], "--vspan")) { - int j = 0; if (i + 1 >= argc) { fprintf (stderr, "HD44780_init: %s requires an argument\n", argv[i]); return -1; @@ -810,7 +821,7 @@ parse_span_list (int *spanListArray[], int *spLsize, int *dispOffsets[], int *dO for (++j; spanlist[j] < '1' || spanlist[j] > '9'; ++j); } else { fprintf (stderr, "Error reallocing for span list\n"); - retVal - 1; + retVal = -1; } } else { fprintf (stderr, "Error reading spansize\n"); diff --git a/server/drivers/joy.c b/server/drivers/joy.c index 7479c4f..bdd2573 100644 --- a/server/drivers/joy.c +++ b/server/drivers/joy.c @@ -8,8 +8,6 @@ #include #include -#define __u32 unsigned int -#define __u8 unsigned char #include #include "../../shared/debug.h" @@ -50,7 +48,7 @@ joy_init (struct lcd_logical_driver *driver, char *args) { char device[256]; char *argv[64]; - int argc, i, j; + int argc, i; joy = driver; diff --git a/server/main.c b/server/main.c index c159246..c1d8151 100644 --- a/server/main.c +++ b/server/main.c @@ -70,10 +70,9 @@ main (int argc, char **argv) { // TODO: Use a config file! //char cfgfile[256] = "/etc/LCDd.cf"; - int i, err, tmp; + int i, err; int daemon_mode = 1; int disable_server_screen = 1; - int child; screen *s = NULL; char *str, *ing; // strings for commandline handling // screen_size *size = &sizes[0]; // No longer needed @@ -100,6 +99,7 @@ main (int argc, char **argv) // Now, go into daemon mode... #ifndef DEBUG if (daemon_mode) { + int child; if ((child = fork ()) != 0) { usleep (1500000); // Wait for child to initialize exit (0); /* PARENT EXITS */ diff --git a/server/menu.c b/server/menu.c index 2f3374d..fe0b1e7 100644 --- a/server/menu.c +++ b/server/menu.c @@ -28,7 +28,6 @@ #include "menu.h" // FIXME: Implement this where it is supposed to be... -#include void framedelay () { diff --git a/server/serverscreens.c b/server/serverscreens.c index 636ddce..8f371d0 100644 --- a/server/serverscreens.c +++ b/server/serverscreens.c @@ -1,13 +1,12 @@ #include #include #include -#include #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "../shared/debug.h" +#include "shared/debug.h" #include "drivers/lcd.h" @@ -152,20 +151,21 @@ no_screen_screen (int timer) int goodbye_screen () { - char - *b20 = " ", *t20 = " Thanks for using ", + char *b20 = " "; + char *t20 = " Thanks for using "; #ifdef LINUX - *l20 = " LCDproc and Linux! ", + char *l20 = " LCDproc and Linux! "; #else - *l20 = " LCDproc! ", + char *l20 = " LCDproc! "; #endif - *b16 = " ", *t16 = "Thanks for using", + + char *b16 = " "; + char *t16 = "Thanks for using"; #ifdef LINUX - *l16 = " LCDproc+Linux! ", + char *l16 = " LCDproc+Linux! "; #else - *l16 = " LCDproc! ", + char *l16 = " LCDproc! "; #endif - *nil = ""; lcd.clear (); diff --git a/server/sock.c b/server/sock.c index b343237..dc56cb8 100644 --- a/server/sock.c +++ b/server/sock.c @@ -13,10 +13,10 @@ #include #include -#include "../shared/sockets.h" +#include "shared/sockets.h" #include "sock.h" #include "clients.h" -#include "../shared/debug.h" +#include "shared/debug.h" /************************************************** LCDproc sockets code... diff --git a/shared/sockets.c b/shared/sockets.c index ef80db8..98c0229 100644 --- a/shared/sockets.c +++ b/shared/sockets.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include