From d4a3e7444d0635021a74962819967866f2e3e924 Mon Sep 17 00:00:00 2001 From: marschap Date: Thu, 27 Apr 2006 15:10:59 +0000 Subject: [PATCH] cleanup: remove unnecessary (=invisible) leading spaces --- CREDITS | 2 +- TODO | 2 +- acinclude.m4 | 76 ++++++++++----------- clients/headlines/lcdheadlines | 20 +++--- clients/lcdproc/batt.c | 4 +- clients/lcdproc/chrono.c | 10 +-- clients/lcdproc/cpu.c | 6 +- clients/lcdproc/disk.c | 4 +- clients/lcdproc/machine_Darwin.c | 56 +++++++-------- clients/lcdproc/machine_FreeBSD.c | 2 +- clients/lcdproc/machine_Linux.c | 2 +- clients/lcdproc/machine_NetBSD.c | 10 +-- clients/lcdproc/machine_OpenBSD.c | 2 +- clients/lcdproc/main.c | 6 +- clients/lcdproc/mem.c | 8 +-- clients/lcdproc/util.c | 2 +- clients/metar/lcdmetar.pl | 10 +-- contrib/interface-demo2/interface.c | 2 +- contrib/interface-demo2/nstrcmp.c | 30 ++++---- contrib/patches/README.ppdev | 2 +- docs/API-v0.5.txt | 8 +-- docs/Seetron/sgxbmp.c | 10 +-- docs/hd44780_howto.txt | 2 +- docs/lcdproc-dev/driver-api.docbook | 12 ++-- docs/lcdproc-user/drivers/CFontz633.docbook | 2 +- docs/lcdproc-user/drivers/joy.docbook | 4 +- docs/lcdproc-user/lcdproc-user.docbook | 2 +- server/commands/menu_commands.c | 18 ++--- server/drivers/curses_drv.c | 2 +- server/main.c | 6 +- server/menu.c | 8 +-- server/menuitem.c | 36 +++++----- server/menuscreens.c | 22 +++--- server/parse.c | 4 +- server/render.c | 6 +- server/serverscreens.c | 2 +- server/sock.c | 2 +- shared/configfile.c | 12 ++-- shared/fileio.c | 4 +- shared/sockets.c | 6 +- 40 files changed, 212 insertions(+), 212 deletions(-) diff --git a/CREDITS b/CREDITS index 6c67233..1e9af1b 100644 --- a/CREDITS +++ b/CREDITS @@ -122,7 +122,7 @@ Rene Wagner : Andre Breiler: - Matrix Orbital driver - + Joris Robijn: - HD44780 driver maintenance and enhancement - Config file stuff diff --git a/TODO b/TODO index d4e0630..475fc0b 100644 --- a/TODO +++ b/TODO @@ -29,7 +29,7 @@ restart LCDproc... Another bonus is that LCDproc will come with a client which can, for example, start up a "client" driver to send "keypresses" from the command line. Or, - + lcdtool -key A would have the same result as pressing a key on the keypad. diff --git a/acinclude.m4 b/acinclude.m4 index 7c7e9e7..d3dfa0c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -69,37 +69,37 @@ for driver in $selectdrivers ; do ;; curses) AC_CHECK_HEADERS(ncurses.h curses.h) - AC_CHECK_LIB(ncurses, main, [ - AC_CHECK_HEADER(ncurses.h, [ - dnl We have ncurses.h and libncurses, add driver. + AC_CHECK_LIB(ncurses, main, [ + AC_CHECK_HEADER(ncurses.h, [ + dnl We have ncurses.h and libncurses, add driver. LIBCURSES="-lncurses" - DRIVERS="$DRIVERS curses${SO}" - actdrivers=["$actdrivers curses"] - ],[ + DRIVERS="$DRIVERS curses${SO}" + actdrivers=["$actdrivers curses"] + ],[ dnl else AC_MSG_WARN([Could not find ncurses.h])], []) - ],[ + ],[ dnl else - AC_CHECK_LIB(curses, main, [ - AC_CHECK_HEADER(curses.h, [ - dnl We have curses.h and libcurses, add driver. - LIBCURSES="-lcurses" - DRIVERS="$DRIVERS curses${SO}" - actdrivers=["$actdrivers curses"] - ],[ + AC_CHECK_LIB(curses, main, [ + AC_CHECK_HEADER(curses.h, [ + dnl We have curses.h and libcurses, add driver. + LIBCURSES="-lcurses" + DRIVERS="$DRIVERS curses${SO}" + actdrivers=["$actdrivers curses"] + ],[ dnl else AC_MSG_WARN([Could not find curses.h])], []) - ],[ + ],[ dnl else - AC_MSG_WARN([The curses driver needs the curses (or ncurses) library.])], - []) - ]) + AC_MSG_WARN([The curses driver needs the curses (or ncurses) library.])], + []) + ]) - AC_CURSES_ACS_ARRAY + AC_CURSES_ACS_ARRAY - AC_CACHE_CHECK([for redrawwin() in curses], ac_cv_curses_redrawwin, + AC_CACHE_CHECK([for redrawwin() in curses], ac_cv_curses_redrawwin, [oldlibs="$LIBS" LIBS="$LIBS $LIBCURSES" AC_TRY_LINK_FUNC(redrawwin, ac_cv_curses_redrawwin=yes, ac_cv_curses_redrawwin=no) @@ -152,10 +152,10 @@ dnl else if test "$enable_libusb" = yes ; then HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-bwct-usb.o" fi - AC_CHECK_HEADER(linux/i2c-dev.h, - HD44780_DRIVERS="$HD44780_DRIVERS hd44780-i2c.o" - AC_DEFINE(HAVE_I2C,[1],[Define to 1 if you have the i2c headers]) - ) + AC_CHECK_HEADER(linux/i2c-dev.h, + HD44780_DRIVERS="$HD44780_DRIVERS hd44780-i2c.o" + AC_DEFINE(HAVE_I2C,[1],[Define to 1 if you have the i2c headers]) + ) DRIVERS="$DRIVERS hd44780${SO}" actdrivers=["$actdrivers hd44780"] ;; @@ -168,22 +168,22 @@ dnl else actdrivers=["$actdrivers imon"] ;; IOWarrior) - if test "$enable_libusb" = yes ; then + if test "$enable_libusb" = yes ; then DRIVERS="$DRIVERS IOWarrior${SO}" actdrivers=["$actdrivers IOWarrior"] else - AC_MSG_WARN([The IOWarrior driver needs the libusb library.]) + AC_MSG_WARN([The IOWarrior driver needs the libusb library.]) fi ;; irman) - AC_CHECK_LIB(irman, main,[ - LIBIRMAN="-lirman" - DRIVERS="$DRIVERS irman${SO}" - actdrivers=["$actdrivers irman"] - ],[ + AC_CHECK_LIB(irman, main,[ + LIBIRMAN="-lirman" + DRIVERS="$DRIVERS irman${SO}" + actdrivers=["$actdrivers irman"] + ],[ dnl else - AC_MSG_WARN([The irman driver needs the irman library.]) - ]) + AC_MSG_WARN([The irman driver needs the irman library.]) + ]) ;; joy) AC_CHECK_HEADER(linux/joystick.h, [ @@ -191,8 +191,8 @@ dnl else actdrivers=["$actdrivers joy"] ],[ dnl else - AC_MSG_WARN([The joy driver needs header file linux/joystick.h.]) - ]) + AC_MSG_WARN([The joy driver needs header file linux/joystick.h.]) + ]) ;; lb216) DRIVERS="$DRIVERS lb216${SO}" @@ -277,7 +277,7 @@ dnl else LIBSVGA="-lvga -lvgagl" DRIVERS="$DRIVERS svga${SO}" actdrivers=["$actdrivers svga"] - ],[ + ],[ dnl else AC_MSG_WARN([The svga driver needs the vga library]) ]) @@ -309,7 +309,7 @@ dnl else LIBFTDI="-lusb -lftdi" DRIVERS="$DRIVERS ula200${SO}" actdrivers=["$actdrivers ula200"] - ],[ + ],[ dnl else AC_MSG_WARN([The ula200 driver needs the ftdi library]) ]) @@ -324,7 +324,7 @@ dnl else LIBXOSD=`xosd-config --libs` DRIVERS="$DRIVERS xosd${SO}" actdrivers=["$actdrivers xosd"] - ],[ + ],[ dnl else AC_MSG_WARN([The xosd driver needs the xosd library]) ]) diff --git a/clients/headlines/lcdheadlines b/clients/headlines/lcdheadlines index e71c48a..be10373 100755 --- a/clients/headlines/lcdheadlines +++ b/clients/headlines/lcdheadlines @@ -147,7 +147,7 @@ if ($twentyfour > 0) { if ($time[2] > 11) { $ampmstring = "PM"; } - + if ($time[2] > 12) { $time[2] = $time[2] - 12; } @@ -197,9 +197,9 @@ $i = 0; my $flag = 0; while (defined($line = )) { $i++; - + if ($line =~ /^%%/) { $i = 1; $flag = 1; } - + if ($flag > 0) { if ($i == 2) { chop($line); @@ -229,10 +229,10 @@ close(TMPFILE); # compare tmpfile with current menufile and possibly update it. if (-e $menufile) { my ($tmpline, $menuline, $linecount); - + open(MENUFILE, $menufile); open(TMPFILE, $tmpfile); - + # read in the first 'headline' menu entry from each file. if ($frontpage eq "top") { $linecount = 3; @@ -243,7 +243,7 @@ if (-e $menufile) { for ($i = 0; $i < $linecount; $i++) { if (eof(TMPFILE)) { if ($forceupdate == 0) { - + close(MENUFILE); close(TMPFILE); unlink($tmpfile); @@ -258,12 +258,12 @@ if (-e $menufile) { $menuline = ; } } - + if (($forceupdate == 0) && (($tmpline =~ /^"$sitename Headlines/) || ($tmpline =~ /^"$sitename Frontpage/) || ($tmpline eq $menuline))) { close(MENUFILE); close(TMPFILE); unlink($tmpfile); - + exit(); } } @@ -280,11 +280,11 @@ sub wmdie { if ($string ne "") { print "$string\n"; } - + close(SOCK); close(TMPFILE); unlink($tmpfile); - + if ($string eq "") { exit(0); } else { diff --git a/clients/lcdproc/batt.c b/clients/lcdproc/batt.c index 8184b2c..a532a4b 100644 --- a/clients/lcdproc/batt.c +++ b/clients/lcdproc/batt.c @@ -34,7 +34,7 @@ ac_status(int status) for (i = 0; ac_table[i].name != NULL; i++) if (status == ac_table[i].status) return ac_table[i].name; - + return ac_table[LCDP_AC_UNKNOWN].name; } @@ -55,7 +55,7 @@ battery_status(int status) for (i = 0; batt_table[i].name != NULL; i++) if (status == batt_table[i].status) return batt_table[i].name; - + return batt_table[LCDP_AC_UNKNOWN].name; } diff --git a/clients/lcdproc/chrono.c b/clients/lcdproc/chrono.c index 7eba8a4..3762d6c 100644 --- a/clients/lcdproc/chrono.c +++ b/clients/lcdproc/chrono.c @@ -156,7 +156,7 @@ time_screen (int rep, int display, int *flags_ptr) hour = ((int) uptime % 86400) / 60 / 60; min = (((int) uptime % 86400) % 3600) / 60; sec = ((int) uptime % 60); - + if (lcd_wid >= 20) sprintf (tmp, "Up %3d day%s %02d%c%02d%c%02d", days, ((days != 1) ? "s" : ""), hour, colon[heartbeat], min, colon[heartbeat], sec); @@ -175,7 +175,7 @@ time_screen (int rep, int display, int *flags_ptr) sprintf (buffer, "widget_set T two %i 3 {%s}\n", xoffs, tmp); if (display) sock_send_string (sock, buffer); - + // display the time & idle time... sprintf (tmp, "%s %3i%% idle", now, (int) idle); xoffs = (lcd_wid > strlen(tmp)) ? ((lcd_wid - strlen(tmp)) / 2) + 1 : 1; @@ -233,7 +233,7 @@ clock_screen (int rep, int display, int *flags_ptr) sprintf (buffer, "widget_set O title {DATE & TIME}\n"); sock_send_string (sock, buffer); - + sprintf (tmp, "%s", get_hostname()); xoffs = (lcd_wid > strlen(tmp)) ? (((lcd_wid - strlen(tmp)) / 2) + 1) : 1; sprintf (buffer, "widget_set O one %i 2 {%s}\n", xoffs, tmp); @@ -323,7 +323,7 @@ uptime_screen (int rep, int display, int *flags_ptr) sock_send_string (sock, "widget_add U three string\n"); sock_send_string (sock, "widget_set U title {SYSTEM UPTIME}\n"); - + sprintf (tmp, "%s", get_hostname()); xoffs = (lcd_wid > strlen(tmp)) ? (((lcd_wid - strlen(tmp)) / 2) + 1) : 1; sprintf (buffer, "widget_set U one %i 2 {%s}\n", xoffs, tmp); @@ -335,7 +335,7 @@ uptime_screen (int rep, int display, int *flags_ptr) sock_send_string (sock, buffer); } else { sock_send_string (sock, "widget_add U one string\n"); - + sprintf (tmp, "widget_set U title {%s %s: %s}\n", get_sysname(), get_sysrelease(), get_hostname()); sock_send_string (sock, tmp); } diff --git a/clients/lcdproc/cpu.c b/clients/lcdproc/cpu.c index 255354c..0bf34e8 100644 --- a/clients/lcdproc/cpu.c +++ b/clients/lcdproc/cpu.c @@ -49,7 +49,7 @@ cpu_screen(int rep, int display, int *flags_ptr) sock_send_string(sock, buffer); if (lcd_hgt >= 4) { gauge_wid = lcd_wid - 6; // room between 0%...100% - + sock_send_string(sock, "widget_add C title title\n"); sock_send_string(sock, "widget_set C title {CPU LOAD}\n"); sock_send_string(sock, "widget_add C one string\n"); @@ -105,14 +105,14 @@ cpu_screen(int rep, int display, int *flags_ptr) // Read new data if (load.total > 0L) { cpu[CPU_BUF_SIZE - 1][0] = 100.0 * ((double) load.user / (double) load.total); - cpu[CPU_BUF_SIZE - 1][1] = 100.0 * ((double) load.system / (double) load.total); + cpu[CPU_BUF_SIZE - 1][1] = 100.0 * ((double) load.system / (double) load.total); cpu[CPU_BUF_SIZE - 1][2] = 100.0 * ((double) load.nice / (double) load.total); cpu[CPU_BUF_SIZE - 1][3] = 100.0 * ((double) load.idle / (double) load.total); cpu[CPU_BUF_SIZE - 1][4] = 100.0 * (((double) load.user + (double) load.system + (double) load.nice) / (double) load.total); } else { cpu[CPU_BUF_SIZE - 1][0] = 0.0; - cpu[CPU_BUF_SIZE - 1][1] = 0.0; + cpu[CPU_BUF_SIZE - 1][1] = 0.0; cpu[CPU_BUF_SIZE - 1][2] = 0.0; cpu[CPU_BUF_SIZE - 1][3] = 0.0; cpu[CPU_BUF_SIZE - 1][4] = 0.0; diff --git a/clients/lcdproc/disk.c b/clients/lcdproc/disk.c index eeb95ab..fd5b17f 100644 --- a/clients/lcdproc/disk.c +++ b/clients/lcdproc/disk.c @@ -101,7 +101,7 @@ disk_screen (int rep, int display, int *flags_ptr) sock_send_string (sock, "widget_set D err2 1 3 {Filesystem Stats}\n"); return 0; } - + // Display stuff... (show for two seconds, then scroll once per // second, then hold at the end for two seconds) sprintf (buffer, "widget_set D f 1 2 %i %i %i %i v 12\n", lcd_wid, lcd_hgt, lcd_wid, count); @@ -111,7 +111,7 @@ disk_screen (int rep, int display, int *flags_ptr) for (i = 0; i < count; i++) { if (table[i].dev[0] == '\0') continue; - + if (i >= num_disks) { // Make sure we have enough lines... sprintf (tmp, "widget_add D s%i string -in f\n", i); sock_send_string (sock, tmp); diff --git a/clients/lcdproc/machine_Darwin.c b/clients/lcdproc/machine_Darwin.c index 81a901f..be89b68 100644 --- a/clients/lcdproc/machine_Darwin.c +++ b/clients/lcdproc/machine_Darwin.c @@ -72,16 +72,16 @@ int machine_init() /* get the page size with "getpagesize" and calculate pageshift from it */ int pagesize = 0; pageshift = 0; - + lcdproc_port = mach_host_self(); host_page_size(lcdproc_port, &pagesize); - + while (pagesize > 1) { pageshift++; pagesize >>= 1; } - + /* we only need the amount of log(2)1024 for our conversion */ pageshift -= 10; @@ -101,11 +101,11 @@ int machine_get_battstat(int *acstat, int *battflag, int *percent) int i; CFDictionaryRef pSource = NULL; const void *psValue; - + *acstat = LCDP_AC_ON; *battflag = LCDP_BATT_ABSENT; *percent = 100; - + if (CFArrayGetCount(sources) == 0) return(FALSE); for (i = 0; i < CFArrayGetCount(sources); i++) @@ -114,11 +114,11 @@ int machine_get_battstat(int *acstat, int *battflag, int *percent) if (!pSource) break; psValue = (CFStringRef)CFDictionaryGetValue(pSource, CFSTR(kIOPSNameKey)); - + if (CFDictionaryGetValueIfPresent(pSource, CFSTR(kIOPSIsPresentKey), &psValue) && (CFBooleanGetValue(psValue) > 0)) { psValue = (CFStringRef)CFDictionaryGetValue(pSource, CFSTR(kIOPSPowerSourceStateKey)); - + if (CFStringCompare(psValue,CFSTR(kIOPSBatteryPowerValue),0)==kCFCompareEqualTo) { /* We are running on a battery power source. */ @@ -135,20 +135,20 @@ int machine_get_battstat(int *acstat, int *battflag, int *percent) else *battflag = LCDP_BATT_UNKNOWN; } - + if (*battflag != LCDP_BATT_ABSENT) { int curCapacity = 0; int maxCapacity = 0; - + psValue = CFDictionaryGetValue(pSource, CFSTR(kIOPSCurrentCapacityKey)); CFNumberGetValue(psValue, kCFNumberSInt32Type, &curCapacity); - + psValue = CFDictionaryGetValue(pSource, CFSTR(kIOPSMaxCapacityKey)); CFNumberGetValue(psValue, kCFNumberSInt32Type, &maxCapacity); - + *percent = (int)((double)curCapacity/(double)maxCapacity * 100); - + /* There is a way to check this through the IOKit, but I am not sure what gets for kIOPSLowWarnLevelKey and kIOPSDeadWarnLevelKey, and this is easier. */ @@ -161,14 +161,14 @@ int machine_get_battstat(int *acstat, int *battflag, int *percent) *battflag = LCDP_BATT_CRITICAL; } /* printf ("powerSource %d of %d: percent: %d/%d %d\n", i, CFArrayGetCount(sources), curCapacity, maxCapacity, *percent);*/ - + } } } - + CFRelease(blob); CFRelease(sources); - + return(TRUE); } @@ -212,7 +212,7 @@ int machine_get_fs(mounts_type fs[], int *cnt) statcnt++; } } - + *cnt = statcnt; return(TRUE); @@ -223,7 +223,7 @@ int machine_get_load(load_type *curr_load) static load_type last_load = { 0, 0, 0, 0, 0 }; static load_type last_ret_load; load_type load; - + host_cpu_load_info_data_t load_info; mach_msg_type_number_t info_count; @@ -233,7 +233,7 @@ int machine_get_load(load_type *curr_load) perror("host_statistics"); return(FALSE); } - + load.user = (unsigned long) (load_info.cpu_ticks[CPU_STATE_USER]); load.nice = (unsigned long) (load_info.cpu_ticks[CPU_STATE_NICE]); load.system = (unsigned long) (load_info.cpu_ticks[CPU_STATE_SYSTEM]); @@ -277,14 +277,14 @@ int machine_get_meminfo(meminfo_type *result) vm_statistics_data_t vm_info; mach_msg_type_number_t info_count; - + info_count = HOST_VM_INFO_COUNT; if (host_statistics(lcdproc_port, HOST_VM_INFO, (host_info_t)&vm_info, &info_count)) { perror("host_statistics"); return(FALSE); } - + result[0].total = pagetok(vm_info.active_count + vm_info.inactive_count + vm_info.free_count + vm_info.wire_count); result[0].free = pagetok(vm_info.free_count); @@ -312,7 +312,7 @@ int machine_get_procs(LinkedList *procs) /* FIX ME */ /* This needs to be finished. */ procinfo_type *p; - + processor_set_t *psets, pset; task_t *tasks; @@ -331,14 +331,14 @@ int machine_get_procs(LinkedList *procs) perror("host_processor_set_priv"); return(FALSE); } - + p = malloc(sizeof(procinfo_type)); if (!p) { perror("mem_top_malloc"); return(FALSE); } - + } return(TRUE); } @@ -406,25 +406,25 @@ static int swapmode(int *rettotal, int *retfree) mib[0] = CTL_VM; mib[1] = VM_SWAPUSAGE; size = sizeof(xsu); - + *rettotal = 0; *retfree = 0; - + if (sysctl(mib, 2, &xsu, &size, NULL, 0) != 0) { perror("sysctl"); return(FALSE); } - + *rettotal = (xsu.xsu_total/1024); *retfree = ((xsu.xsu_total-xsu.xsu_used)/1024); return(TRUE); #endif - + *rettotal = 0; *retfree = 0; - + return(FALSE); } diff --git a/clients/lcdproc/machine_FreeBSD.c b/clients/lcdproc/machine_FreeBSD.c index 63b4ea9..4bcfed0 100644 --- a/clients/lcdproc/machine_FreeBSD.c +++ b/clients/lcdproc/machine_FreeBSD.c @@ -182,7 +182,7 @@ int machine_get_fs(mounts_type fs[], int *cnt) statcnt++; } } - + *cnt = statcnt; return(TRUE); diff --git a/clients/lcdproc/machine_Linux.c b/clients/lcdproc/machine_Linux.c index d82ff86..aa93877 100644 --- a/clients/lcdproc/machine_Linux.c +++ b/clients/lcdproc/machine_Linux.c @@ -499,7 +499,7 @@ int machine_get_smpload(load_type *result, int *numcpus) int machine_get_uptime(double *up, double *idle) { double local_up, local_idle; - + reread(uptime_fd, "get_uptime:"); sscanf(procbuf, "%lf %lf", &local_up, &local_idle); if (up != NULL) diff --git a/clients/lcdproc/machine_NetBSD.c b/clients/lcdproc/machine_NetBSD.c index fd54760..221256f 100644 --- a/clients/lcdproc/machine_NetBSD.c +++ b/clients/lcdproc/machine_NetBSD.c @@ -92,7 +92,7 @@ int machine_get_battstat(int *acstat, int *battflag, int *percent) { int apmd; struct apm_power_info apmi; - + if ((apmd = open("/dev/apm", O_RDONLY)) == -1) { *acstat = LCDP_AC_ON; @@ -100,14 +100,14 @@ int machine_get_battstat(int *acstat, int *battflag, int *percent) *percent = 100; return(TRUE); } - + memset(&apmi, 0, sizeof(apmi)); if (ioctl(apmd, APM_IOC_GETPOWER, &apmi) == -1) { perror("APM_IOC_GETPOWER failed in get_batt_stat()"); return(FALSE); } - + switch(apmi.ac_state) { case APM_AC_OFF: @@ -177,7 +177,7 @@ int machine_get_fs(mounts_type fs[], int *cnt) statcnt++; } } - + *cnt = statcnt; return(TRUE); } @@ -250,7 +250,7 @@ int machine_get_meminfo(meminfo_type *result) perror("sysctl vm.uvmexp2 failed"); return(FALSE); } - + /* memory */ result[0].total = pagetok(uvmexp.npages); result[0].free = pagetok(uvmexp.free); diff --git a/clients/lcdproc/machine_OpenBSD.c b/clients/lcdproc/machine_OpenBSD.c index 6c60435..058059a 100644 --- a/clients/lcdproc/machine_OpenBSD.c +++ b/clients/lcdproc/machine_OpenBSD.c @@ -185,7 +185,7 @@ int machine_get_fs(mounts_type fs[], int *cnt) statcnt++; } } - + *cnt = statcnt; return(TRUE); } diff --git a/clients/lcdproc/main.c b/clients/lcdproc/main.c index 5bf462d..489bbe5 100644 --- a/clients/lcdproc/main.c +++ b/clients/lcdproc/main.c @@ -293,11 +293,11 @@ process_command_line(int argc, char **argv) /* parse arguments */ if (argc > optind) //user specified some modes, so clear all defaults clear_modes(); - + for (i = max(optind, 1); i < argc; i++) { int shortname = (strlen(argv[i]) == 1) ? toupper(argv[i][0]) : '\0'; int found = set_mode(shortname, argv[i], 1); - + if (!found) { fprintf(stderr, "Invalid Mode: %c\n", argv[i][0]); return(EXIT_FAILURE); @@ -491,7 +491,7 @@ main_loop() //for (i=0; i= 18) ? max(2, lcd_wid - 18) : 0; gauge_offs = (lcd_wid - gauge_wid) / 2 + 2; - + sock_send_string(sock, "widget_add M m string\n"); sock_send_string(sock, "widget_add M s string\n"); if (gauge_wid > 0) { @@ -244,20 +244,20 @@ mem_top_screen (int rep, int display, int *flags_ptr) if ((*flags_ptr & INITIALIZED) == 0) { *flags_ptr |= INITIALIZED; - + sock_send_string(sock, "screen_add S\n"); sprintf(buffer, "screen_set S -name {Top Memory Use: %s}\n", get_hostname()); sock_send_string(sock, buffer); sock_send_string(sock, "widget_add S title title\n"); sprintf(buffer, "widget_set S title {TOP MEM: %s}\n", get_hostname()); sock_send_string(sock, buffer); - + // frame from (2nd line, left) to (last line, right) sock_send_string(sock, "widget_add S f frame\n"); sprintf(buffer, "widget_set S f 1 2 %i %i %i 5 v %i\n", lcd_wid, lcd_hgt, lcd_wid, ((lcd_hgt >= 4) ? 8 : 12)); sock_send_string(sock, buffer); - + // frame contents for (i = 1; i <= 5; i++) { sprintf(buffer, "widget_add S %i string -in f\n", i); diff --git a/clients/lcdproc/util.c b/clients/lcdproc/util.c index 5e23bc8..a06a453 100644 --- a/clients/lcdproc/util.c +++ b/clients/lcdproc/util.c @@ -52,7 +52,7 @@ sprintf_memory(char *dst, double value, double roundlimit) format = "%.2f%s"; if (value < 10) format = "%.3f%s"; - + sprintf(dst, format, value, units[offs]); } return dst; diff --git a/clients/metar/lcdmetar.pl b/clients/metar/lcdmetar.pl index 11377ab..bfa7493 100755 --- a/clients/metar/lcdmetar.pl +++ b/clients/metar/lcdmetar.pl @@ -197,14 +197,14 @@ while (1) { # Sanity check die "METAR is too short! Something went wrong." if (length($metar)<1); - + # pass the data to the METAR module. # print("$metar\n"); $m->metar($metar); # ask for the temperature(s) my $temp; my $temp_u; my $dew; my $dew_u; my $wind; my $wind_u; my $wind_dir; - + if ($datasystem eq "nautical") { $temp = $m->C_TEMP; $temp_u = "C"; @@ -231,18 +231,18 @@ while (1) { $wind_u = "km/h"; $wind_dir = $m->WIND_DIR_ENG; } - + my $metartime = $m->TIME; my $sky = $m->SKY; my $visibility = $m->VISIBILITY; - + print $remote sprintf("widget_set metar title {Weather %s %s}\n", $site_code, $metartime); print $remote sprintf("widget_set metar temp 1 2 {Temp %i%s (%i%s Dew)}\n", $temp, $temp_u, $dew, $dew_u) if ($temp and $dew); print $remote sprintf("widget_set metar wind 1 3 {Wind %i%s, %s}\n", $wind, $wind_u, $wind_dir) if ($wind_dir and $wind); print $remote sprintf("widget_set metar visib 1 %i %i %i h 3 {Visibility %s}\n", $lcdheight, $lcdwidth, $lcdheight, $visibility ) if ($visibility); print $remote sprintf("widget_set metar cloud 1 4 {Sky %s}\n", join(',', @{$m->{sky}}) ) if ($m->{sky} and ($lcdheight>4)); } # end else - + # eat all input from LCDd while(defined(my $input = <$remote>)) { } diff --git a/contrib/interface-demo2/interface.c b/contrib/interface-demo2/interface.c index b57a4a6..424809f 100644 --- a/contrib/interface-demo2/interface.c +++ b/contrib/interface-demo2/interface.c @@ -219,7 +219,7 @@ char *get_name(char *name, char *p) break; if (*p == ':') { /* could be an alias */ char *dot = p++; - while (*p && isdigit(*p)) p++; + while (*p && isdigit(*p)) p++; if (*p == ':') { /* Yes it is, backup and copy it. */ p = dot; diff --git a/contrib/interface-demo2/nstrcmp.c b/contrib/interface-demo2/nstrcmp.c index 2797ee9..2c75b66 100644 --- a/contrib/interface-demo2/nstrcmp.c +++ b/contrib/interface-demo2/nstrcmp.c @@ -12,7 +12,7 @@ char* cutalias(char* name) { int digit = 0; int pos; - + for(pos=strlen(name); pos>0; pos--) { if (name[pos-1]==':' && digit) @@ -58,41 +58,41 @@ int nstrcmp(const char *ap, const char *bp) if (res != 0) { free(a); free(b); return res; } - + if (aindex > bindex) { free(a); free(b); return 1; } - + if (aindex < bindex) { free(a); free(b); return -1; } - + an = a+aindex; bn = b+bindex; - + av = atoi(an); bv = atoi(bn); - + if (av < bv) { free(a); free(b); return -1; } - + if (av > bv) { free(a); free(b); return 1; } - + av = -1; if (aalias != NULL) av = atoi(aalias); - + bv = -1; if (balias != NULL) bv = atoi(balias); - + free(a); free(b); - + if (av < bv) return -1; - + if (av > bv) return 1; - + return 0; } @@ -118,7 +118,7 @@ int dotest(char* a, char* b, int exp) int main() { int err = 0; - + err |= dotest("eth1", "eth1", 0); err |= dotest("eth0:1", "eth0:1", 0); err |= dotest("lan", "lan", 0); @@ -139,7 +139,7 @@ int main() err |= dotest("eth1:10", "eth13:10", -1); err |= dotest("eth1:1", "eth1:13", -1); err |= dotest("a", "a:", -1); - + err |= dotest("aa", "a", 1); err |= dotest("eth2", "eth1", 1); err |= dotest("eth13", "eth1", 1); diff --git a/contrib/patches/README.ppdev b/contrib/patches/README.ppdev index 032d73e..1220035 100644 --- a/contrib/patches/README.ppdev +++ b/contrib/patches/README.ppdev @@ -16,7 +16,7 @@ write). And there is something else that is a wrapper to get old functions (port_in, port_out, etc) supported for such drivers that are not modified to use new parallel port functions. - + So, if you have an LCD attached to your parallel port (like my hd44780) without keys attached to it, you can apply this patch and just forget the io access to the parallel port :) diff --git a/docs/API-v0.5.txt b/docs/API-v0.5.txt index a28edb2..83fb2cb 100644 --- a/docs/API-v0.5.txt +++ b/docs/API-v0.5.txt @@ -59,16 +59,16 @@ API_VERSION in the code. //////// Functions to be provided by the driver module //// Mandatory functions (necessary for all drivers) - + // initialize driver: return >= 0 on success int (*init) (Driver *drvthis); - + // close driver void (*close) (Driver *drvthis); //// Essential output functions (necessary for output drivers) - + // get display width & height (in characters) int (*width) (Driver *drvthis); int (*height) (Driver *drvthis); @@ -91,7 +91,7 @@ API_VERSION in the code. // get key from driver: returns a string denoting the key pressed const char *(*get_key) (Driver *drvthis); - + //// Extended output functions (optional; core provides alternatives) // draw a bar from pos (x,y) upward / to the right filling promille of len chars diff --git a/docs/Seetron/sgxbmp.c b/docs/Seetron/sgxbmp.c index 47994cf..149d04b 100644 --- a/docs/Seetron/sgxbmp.c +++ b/docs/Seetron/sgxbmp.c @@ -50,14 +50,14 @@ int main(int ac,char **av) { } else { fd=openRawSerialLine(av[1],atoi(av[2]),FLOW_NONE,O_RDWR); } - + filein=open(av[3], O_RDWR); read(filein, bmpin, 62); - + read(filein, bmpin, 512); close(filein); - + idx=0; for(j=31;j>-1;j--) { for(i=0;i<16;i++) { @@ -72,9 +72,9 @@ int main(int ac,char **av) { idx++; } } - + sprintf(str,"%cDG", 27); - + if(atoi(av[4])==0) { for (idx=0;idx<480;idx++) { gxbits[idx]=gxbits[idx] ^ 255; diff --git a/docs/hd44780_howto.txt b/docs/hd44780_howto.txt index ad9e45b..90ed82c 100644 --- a/docs/hd44780_howto.txt +++ b/docs/hd44780_howto.txt @@ -614,7 +614,7 @@ Send char(0) fanX is a value from 0 to 255, 0 is fan off, 255 is fan full speed. - + 1.5.1 Keypad ------------ diff --git a/docs/lcdproc-dev/driver-api.docbook b/docs/lcdproc-dev/driver-api.docbook index 0c9d1fe..f32a0d0 100644 --- a/docs/lcdproc-dev/driver-api.docbook +++ b/docs/lcdproc-dev/driver-api.docbook @@ -1,6 +1,6 @@ The LCDproc driver API - + This chapter describes the driver API of v0.5 of LCDproc. At time of this writing, this version is not released and some things might @@ -74,16 +74,16 @@ API_VERSION in the code. //////// Functions to be provided by the driver module //// Mandatory functions (necessary for all drivers) - + // initialize driver: returns >= 0 on success int (*init) (Driver *drvthis); - + // close driver void (*close) (Driver *drvthis); //// Essential output functions (necessary for output drivers) - + // get display width / height (in characters; 1-based) int (*width) (Driver *drvthis); int (*height) (Driver *drvthis); @@ -106,7 +106,7 @@ API_VERSION in the code. // get key from driver: returns a string denoting the key pressed const char *(*get_key) (Driver *drvthis); - + //// Extended output functions (optional; core provides alternatives) // draw a bar from pos (x,y) upward / to the right filling promille of len chars @@ -256,7 +256,7 @@ typedef struct my_driver_private { p->fd = -1; p->cellheight = 8; p->cellwidth = 6; - + (... continue with the rest of your init routine) diff --git a/docs/lcdproc-user/drivers/CFontz633.docbook b/docs/lcdproc-user/drivers/CFontz633.docbook index f44145a..b17662d 100644 --- a/docs/lcdproc-user/drivers/CFontz633.docbook +++ b/docs/lcdproc-user/drivers/CFontz633.docbook @@ -22,7 +22,7 @@ CFontz633 chipset. Select the output device to use [default: /dev/lcd] may be serial device or USB device in serial emulation mode. - + diff --git a/docs/lcdproc-user/drivers/joy.docbook b/docs/lcdproc-user/drivers/joy.docbook index b8bf0e2..70584f3 100644 --- a/docs/lcdproc-user/drivers/joy.docbook +++ b/docs/lcdproc-user/drivers/joy.docbook @@ -43,7 +43,7 @@ This section covers the joystick input driver for LCDd. pos determining the direction. The exact numbering of the axes depends on the hardware used. - + KEY can be one of the keys that LCDd recognizes (Left, Right, Up, @@ -68,7 +68,7 @@ This section covers the joystick input driver for LCDd. that represents each button. The exact numbering of the buttons depends on the hardware used. - + KEY can be one of the keys that LCDd recognizes (Left, Right, Up, diff --git a/docs/lcdproc-user/lcdproc-user.docbook b/docs/lcdproc-user/lcdproc-user.docbook index 48b70ef..cc22c30 100644 --- a/docs/lcdproc-user/lcdproc-user.docbook +++ b/docs/lcdproc-user/lcdproc-user.docbook @@ -12,7 +12,7 @@ - + diff --git a/server/commands/menu_commands.c b/server/commands/menu_commands.c index 126029d..ec9ef6d 100644 --- a/server/commands/menu_commands.c +++ b/server/commands/menu_commands.c @@ -189,8 +189,8 @@ menu_add_item_func (Client * c, int argc, char **argv) item = menuitem_create_ip (item_id, menu_commands_handler, text, c, 0, "192.168.1.245"); break; - default: - assert(!"unexpected menuitem type"); + default: + assert(!"unexpected menuitem type"); } menu_add_item (menu, item); menuscreen_inform_item_modified (menu); @@ -213,7 +213,7 @@ menu_add_item_func (Client * c, int argc, char **argv) /* skip "text" */ if (i == 4 && argv[4][0] != '-') continue; - + argv_set[j++] = argv[i]; } menu_set_item_func(c, j, argv_set); @@ -670,7 +670,7 @@ menu_set_item_func (Client * c, int argc, char **argv) new_buf = malloc(item->data.ip.maxlength + 1 ); strncpy( new_buf, item->data.ip.value, item->data.ip.maxlength); - + new_buf[item->data.ip.maxlength] = '\0'; /* terminate */ free( item->data.ip.value ); item->data.ip.value = new_buf; @@ -931,11 +931,11 @@ MenuEventFunc (menu_commands_handler) } } else if (event == MENUEVENT_ENTER - || event == MENUEVENT_LEAVE) + || event == MENUEVENT_LEAVE) { - snprintf (buf, sizeof(buf)-1, "menuevent %s %.40s\n", - menuitem_eventtype_to_eventtypename(event), - item->id); + snprintf (buf, sizeof(buf)-1, "menuevent %s %.40s\n", + menuitem_eventtype_to_eventtypename(event), + item->id); } else { snprintf (buf, sizeof(buf)-1, "menuevent %s %.40s\n", @@ -949,7 +949,7 @@ MenuEventFunc (menu_commands_handler) c = menuitem_get_client(item); if( !c ) { report( RPT_ERR, "%s: Could not find client of item \"%s\"", - __FUNCTION__, item->id ); + __FUNCTION__, item->id ); return -1; } diff --git a/server/drivers/curses_drv.c b/server/drivers/curses_drv.c index 08a6b32..b181778 100644 --- a/server/drivers/curses_drv.c +++ b/server/drivers/curses_drv.c @@ -23,7 +23,7 @@ /* Different implementations of (n)curses available on: OpenBSD: - http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libcurses/ + http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libcurses/ ncurses NetBSD: http://cvsweb.netbsd.org/bsdweb.cgi/basesrc/lib/libcurses/ diff --git a/server/main.c b/server/main.c index 0a895c3..ad72cef 100644 --- a/server/main.c +++ b/server/main.c @@ -219,7 +219,7 @@ main(int argc, char **argv) /* Set reporting settings (will also flush delayed reports) */ set_reporting("LCDd", report_level, report_dest); - report(RPT_INFO, "Set report level to %d, output to %s", report_level, + report(RPT_INFO, "Set report level to %d, output to %s", report_level, ((report_dest == RPT_DEST_SYSLOG) ? "syslog" : "stderr")); CHAIN_END( e, "Critical error while processing settings, abort." ); @@ -464,7 +464,7 @@ process_configfile(char *configfile) if (report_dest == UNSET_INT) { int rs = config_get_bool("server", "reportToSyslog", 0, UNSET_INT); - + if (rs != UNSET_INT) report_dest = (rs) ? RPT_DEST_SYSLOG : RPT_DEST_STDERR; } @@ -781,7 +781,7 @@ do_reload(void) /* Set reporting values */ CHAIN( e, set_reporting("LCDd", report_level, report_dest) ); - CHAIN( e, ( report(RPT_INFO, "Set report level to %d, output to %s", report_level, + CHAIN( e, ( report(RPT_INFO, "Set report level to %d, output to %s", report_level, ((report_dest == RPT_DEST_SYSLOG) ? "syslog" : "stderr")), 0 ) ); /* And restart the drivers */ diff --git a/server/menu.c b/server/menu.c index bbf650d..4d21056 100644 --- a/server/menu.c +++ b/server/menu.c @@ -339,7 +339,7 @@ void menu_build_screen (MenuItem *menu, Screen *s) (w->text)[display_props->width-1] = '\0'; } break; - default: + default: assert(!"unexpected menuitem type"); } } @@ -491,7 +491,7 @@ void menu_update_screen (MenuItem *menu, Screen *s) w->type = (menu->data.menu.scroll > 0) ? WID_ICON : WID_NONE; else report (RPT_ERR, "%s: could not find widget: %s", __FUNCTION__, "upscroller"); - + /* Enable downscroller (if necessary) */ w = screen_find_widget (s, "downscroller"); if (w != NULL) @@ -629,7 +629,7 @@ MenuResult menu_process_input(Menu *menu, MenuToken token, const char * key, boo case MENUTOKEN_LEFT: if (!extended) return MENURESULT_NONE; - + subitem = menu_get_subitem (menu, menu->data.menu.selector_pos); if (subitem == NULL) break; @@ -661,7 +661,7 @@ MenuResult menu_process_input(Menu *menu, MenuToken token, const char * key, boo case MENUTOKEN_RIGHT: if (!extended) return MENURESULT_NONE; - + subitem = menu_get_subitem(menu, menu->data.menu.selector_pos); if (subitem == NULL) break; diff --git a/server/menuitem.c b/server/menuitem.c index b3f95af..f95aac5 100644 --- a/server/menuitem.c +++ b/server/menuitem.c @@ -83,7 +83,7 @@ const IpSstringProperties IPinfo[] = { // IPv6: 39 char long ':'-separated sequence of 4-digit hex strings in range 0000 - ffff { 39, ':', 16, 4, 65535, { 4096, 256, 16, 1, 0 }, "%04x", verify_ipv6, "0:0:0:0:0:0:0:0" } }; - + /******** MENU UTILITY FUNCTIONS ********/ @@ -207,7 +207,7 @@ MenuItem *menuitem_create (MenuItemType type, char *id, MenuEventFunc(*event_fun // report (RPT_ERR, "%s: illegal id or text", __FUNCTION__); return NULL; } - + /* Allocate space and fill struct */ new_item = malloc (sizeof(MenuItem)); if (!new_item) { @@ -392,7 +392,7 @@ MenuItem *menuitem_create_ip (char *id, MenuEventFunc(*event_func), new_item = menuitem_create (MENUITEM_IP, id, event_func, text, client); new_item->data.ip.v6 = v6; ipinfo = (v6) ? &IPinfo[1] : &IPinfo[0]; - + new_item->data.ip.maxlength = ipinfo->maxlen;; new_item->data.ip.value = malloc (new_item->data.ip.maxlength + 1); @@ -646,7 +646,7 @@ void menuitem_rebuild_screen_slider (MenuItem *item, Screen *s) if ((item == NULL) || (s == NULL)) return; - + if (display_props->height >= 2 ) { /* Only add a title if enough space... */ w = widget_create ("text", WID_STRING, s); @@ -699,7 +699,7 @@ void menuitem_rebuild_screen_numeric (MenuItem *item, Screen *s) if ((item == NULL) || (s == NULL)) return; - + if (display_props->height >= 2 ) { /* Only add a title if enough space... */ w = widget_create ("text", WID_STRING, s); @@ -735,7 +735,7 @@ void menuitem_rebuild_screen_alpha (MenuItem *item, Screen *s) if ((item == NULL) || (s == NULL)) return; - + if (display_props->height >= 2 ) { /* Only add a title if enough space... */ w = widget_create ("text", WID_STRING, s); @@ -771,7 +771,7 @@ void menuitem_rebuild_screen_ip (MenuItem *item, Screen *s) if ((item == NULL) || (s == NULL)) return; - + if (display_props->height >= 2 ) { /* Only add a title if enough space... */ w = widget_create ("text", WID_STRING, s); @@ -809,7 +809,7 @@ void menuitem_update_screen (MenuItem *item, Screen *s) if ((item == NULL) || (s == NULL)) return; - + /* Disable the cursor by default */ s->cursor = CURSOR_OFF; @@ -834,7 +834,7 @@ void menuitem_update_screen_slider (MenuItem *item, Screen *s) if ((item == NULL) || (s == NULL)) return; - + /* Calculate the bar position and length by filling buffers */ min_len = strlen (item->data.slider.mintext); max_len = strlen (item->data.slider.maxtext); @@ -876,7 +876,7 @@ void menuitem_update_screen_numeric (MenuItem *item, Screen *s) if ((item == NULL) || (s == NULL)) return; - + w = screen_find_widget (s, "value"); strcpy (w->text, item->data.numeric.edit_str + item->data.numeric.edit_offs); @@ -902,7 +902,7 @@ void menuitem_update_screen_alpha (MenuItem *item, Screen *s) if ((item == NULL) || (s == NULL)) return; - + w = screen_find_widget (s, "value"); if (item->data.alpha.password_char == '\0') { strcpy (w->text, item->data.alpha.edit_str + item->data.alpha.edit_offs); @@ -935,7 +935,7 @@ void menuitem_update_screen_ip (MenuItem *item, Screen *s) if ((item == NULL) || (s == NULL)) return; - + w = screen_find_widget (s, "value"); if (w != NULL) strcpy (w->text, item->data.ip.edit_str + item->data.ip.edit_offs); @@ -1350,7 +1350,7 @@ MenuResult menuitem_process_input_ip (MenuItem *item, MenuToken token, const cha char *start = tmp; memccpy(tmp, str, '\0', sizeof(tmp)); - + while (start != NULL) { char *skip = start; @@ -1360,7 +1360,7 @@ MenuResult menuitem_process_input_ip (MenuItem *item, MenuToken token, const cha skip = strchr(start, ipinfo->sep); start = (skip != NULL) ? (skip + 1) : NULL; } - + // check IP address entered if ((ipinfo->verify != NULL) && (!ipinfo->verify(tmp))) { report(RPT_WARNING, "%s(id=\"%s\") ip address not verified: \"%s\"", @@ -1368,7 +1368,7 @@ MenuResult menuitem_process_input_ip (MenuItem *item, MenuToken token, const cha item->data.ip.error_code = 4; return MENURESULT_NONE; } - + // store value strcpy (item->data.ip.value, tmp); @@ -1464,7 +1464,7 @@ LinkedList * tablist2linkedlist (char *strings) if (strings != NULL) { char *p = strings; char *tabptr, *new_s; - + while ((tabptr = strchr(p, '\t')) != NULL) { int len = (int)(tabptr - p); @@ -1490,7 +1490,7 @@ MenuItemType menuitem_typename_to_type (char *name) { if (name != NULL) { MenuItemType type; - + for (type = 0; type < NUM_ITEMTYPES; type ++) { if (strcmp (menuitemtypenames[type], name) == 0) { return type; @@ -1511,7 +1511,7 @@ MenuEventType menuitem_eventtypename_to_eventtype (char *name) { if (name != NULL) { MenuEventType type; - + for (type = 0; type < NUM_EVENTTYPES; type ++) { if (strcmp (menueventtypenames[type], name) == 0) { return type; diff --git a/server/menuscreens.c b/server/menuscreens.c index c00fe94..7ea8b3f 100644 --- a/server/menuscreens.c +++ b/server/menuscreens.c @@ -90,8 +90,8 @@ int menuscreens_init() tmp = config_get_string ("menu", "RightKey", 0, NULL); if (tmp) right_key = strdup(tmp); - - + + /* Now reserve keys */ input_reserve_key (menu_key, true, NULL); input_reserve_key (enter_key, false, NULL); @@ -202,8 +202,8 @@ void menuscreen_switch_item (MenuItem * new_menuitem) MenuItem * old_menuitem = active_menuitem; debug (RPT_DEBUG, "%s( item=[%s] ) from active_menuitem=[%s]", __FUNCTION__, - ((new_menuitem != NULL) ? new_menuitem->id : "(null)"), - ((old_menuitem != NULL) ? old_menuitem->id : "(null)")); + ((new_menuitem != NULL) ? new_menuitem->id : "(null)"), + ((old_menuitem != NULL) ? old_menuitem->id : "(null)")); /* First we do the switch */ active_menuitem = new_menuitem; @@ -229,9 +229,9 @@ void menuscreen_switch_item (MenuItem * new_menuitem) } if (old_menuitem && old_menuitem->event_func) - old_menuitem->event_func(old_menuitem, MENUEVENT_LEAVE); + old_menuitem->event_func(old_menuitem, MENUEVENT_LEAVE); if (new_menuitem && new_menuitem->event_func) - new_menuitem->event_func(new_menuitem, MENUEVENT_ENTER); + new_menuitem->event_func(new_menuitem, MENUEVENT_ENTER); return; } @@ -466,7 +466,7 @@ void menuscreen_create_menu () menu_add_item (options_menu, driver_menu); if (contrast_avail) { int contrast = driver->get_contrast(driver); - + /* menu's client is NULL since we're in the server */ slider = menuitem_create_slider ("contrast", contrast_handler, "Contrast", NULL, "min", "max", 0, 1000, 25, contrast); @@ -475,7 +475,7 @@ void menuscreen_create_menu () if (brightness_avail) { int onbrightness = driver->get_brightness (driver, BACKLIGHT_ON); int offbrightness = driver->get_brightness (driver, BACKLIGHT_OFF); - + slider = menuitem_create_slider ("onbrightness", brightness_handler, "On Brightness", NULL, "min", "max", 0, 1000, 25, onbrightness); menu_add_item (driver_menu, slider); @@ -661,8 +661,8 @@ int menuscreen_goto (Menu * menu) { debug (RPT_DEBUG, "%s( m=[%s] ): active_menuitem=[%s]", - __FUNCTION__, (menu != NULL) ? menu->id : "(NULL)", - (active_menuitem != NULL) ? active_menuitem->id : "(NULL)"); + __FUNCTION__, (menu != NULL) ? menu->id : "(NULL)", + (active_menuitem != NULL) ? active_menuitem->id : "(NULL)"); menuscreen_switch_item (menu); return 0; } @@ -673,7 +673,7 @@ int menuscreen_set_main (Menu * menu) { debug (RPT_DEBUG, "%s( m=[%s] )", - __FUNCTION__, (menu != NULL) ? menu->id : "(NULL)"); + __FUNCTION__, (menu != NULL) ? menu->id : "(NULL)"); custom_main_menu = menu; return 0; } diff --git a/server/parse.c b/server/parse.c index ec2f72b..fb14d30 100644 --- a/server/parse.c +++ b/server/parse.c @@ -114,7 +114,7 @@ static int parse_message (const char *str, Client *c) const char escape_chars[] = "nrt"; const char escape_trans[] = "\n\r\t"; char *p = strchr( escape_chars, str[pos] ); - + /* Is it wise to have the characters \n, \r & \t expanded ? * Can the displays deal with them ? */ @@ -188,7 +188,7 @@ static int parse_message (const char *str, Client *c) sock_printf_error(c->sock, "Invalid command \"%.40s\"\n", argv[0]); report( RPT_WARNING, "Invalid command from client on socket %d: %.40s", c->sock, str ); } - + free( arg_space ); return 0; } diff --git a/server/render.c b/server/render.c index 4706b8f..a6aab88 100644 --- a/server/render.c +++ b/server/render.c @@ -344,7 +344,7 @@ render_frame (LinkedList * list, drivers_string (w->left, w->top, w->text); } else { int necessaryTimeUnits = 0; - + if (w->speed > 0) { necessaryTimeUnits = length * w->speed; offset = (timer % (length * w->speed)) / w->speed; @@ -422,7 +422,7 @@ render_frame (LinkedList * list, case 'v': { int i = 0; - + length = strlen (w->text); if (length <= screen_width) { /* no scrolling required... */ @@ -431,7 +431,7 @@ render_frame (LinkedList * list, int lines_required = (length / screen_width) + (length % screen_width ? 1 : 0); int available_lines = (w->bottom - w->top + 1); - + if (lines_required <= available_lines) { /* easy...*/ for (i = 0; i < lines_required; i++) { diff --git a/server/serverscreens.c b/server/serverscreens.c index 762c119..10b25c4 100644 --- a/server/serverscreens.c +++ b/server/serverscreens.c @@ -54,7 +54,7 @@ server_screen_init () } server_screen->name = "Server screen"; server_screen->duration = 8; /* 1 second, instead of 4...*/ - + if ((rotate_server_screen == UNSET_INT ) || (rotate_server_screen == 1)) { server_screen->priority = PRI_INFO; } else { diff --git a/server/sock.c b/server/sock.c index 1509e79..bbead3f 100644 --- a/server/sock.c +++ b/server/sock.c @@ -195,7 +195,7 @@ sock_shutdown () retVal = -1; } #endif - + return retVal; } diff --git a/shared/configfile.c b/shared/configfile.c index 5a25711..9a93a48 100644 --- a/shared/configfile.c +++ b/shared/configfile.c @@ -86,7 +86,7 @@ int config_read_file(char *filename) #ifdef WITH_LDAP_SUPPORT if (ldap_is_ldap_url(filename)) { use_ldap = 1; - + if (0 != (retval = ldap_url_parse(filename, &url))) { report(RPT_ERR, "Errors parsing LDAP URL %s: %s", filename, ldap_err2string(retval)); ldap_free_urldesc(url); @@ -302,7 +302,7 @@ connect_to_ldap(void) * } * fprintf(stderr, "LDAP login successful on %s:%d\n", ldap_host, ldap_port); ********************************************************/ - + /* check for the existence of the config object... */ if (LDAP_SUCCESS != (retval = ldap_search_s(ld, ldap_base_dn, LDAP_SCOPE_BASE, "objectClass=lcdprocConfig", NULL, 0, &res))) { report(RPT_ERR, "Could not access LDAP server on %s:%d", ldap_host, ldap_port); @@ -441,12 +441,12 @@ key * find_key(section * s, char * keyname, int skip) return NULL; } - + strcpy(buf, "lcdproc"); strncat(buf, keyname, BUFSIZE); /* debug(RPT_DEBUG, "Key name translated to attribute name: %s", buf); */ vals = ldap_get_values(ld, entry, buf); - + if (skip+1 > ldap_count_values(vals)) { debug(RPT_DEBUG, "No such entry found."); if (NULL != buf) { @@ -474,14 +474,14 @@ key * find_key(section * s, char * keyname, int skip) buf=strdup(vals[skip]); debug(RPT_DEBUG, "Entry found. Value is: %s", buf); ldap_value_free(vals); - + k = (key *) malloc(sizeof(key)); if ( k != NULL) { k->name = strdup(keyname); k->value = strdup(buf); k->next_key = NULL; } - + if (NULL != buf) { free(buf); buf = NULL; diff --git a/shared/fileio.c b/shared/fileio.c index c66114d..4742ee5 100644 --- a/shared/fileio.c +++ b/shared/fileio.c @@ -24,11 +24,11 @@ buffile *buffile_open( const char *path, const char *mode ) { file = malloc(sizeof(*file)); if ( NULL == file ) return NULL; - + file->pos=0; file->bytesread=0; file->buf=NULL; - + file->f = fopen( path, mode ); if( NULL == file->f ) { free(file); diff --git a/shared/sockets.c b/shared/sockets.c index ff022b1..8d3645c 100644 --- a/shared/sockets.c +++ b/shared/sockets.c @@ -90,7 +90,7 @@ sock_connect (char *host, unsigned short int port) #else { unsigned long tmp = 1; - + if (ioctlsocket(sock, FIONBIO, &tmp) == SOCKET_ERROR) report(RPT_ERR, "sock_connect: Error setting socket to non-blocking"); } @@ -130,7 +130,7 @@ sock_printf(int fd, const char *format, .../*args*/ ) } if (size > sizeof(buf)) report(RPT_WARNING, "sock_printf: vsnprintf truncated message"); - + return sock_send_string(fd, buf); } @@ -316,7 +316,7 @@ sock_printf_error(int fd, const char *format, .../*args*/ ) int size = 0; strncpy(buf, huh, sizeof(huh)); // note: sizeof(huh) < MAXMSG - + va_start(ap, format); size = vsnprintf(buf + (sizeof(huh)-1), sizeof(buf) - (sizeof(huh)-1), format, ap); buf[sizeof(buf)-1] = '\0';