cleanup: remove unnecessary (=invisible) leading spaces
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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/
|
||||
|
||||
+3
-3
@@ -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 */
|
||||
|
||||
+4
-4
@@ -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;
|
||||
|
||||
+18
-18
@@ -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;
|
||||
|
||||
+11
-11
@@ -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;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
+3
-3
@@ -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++) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
+1
-1
@@ -195,7 +195,7 @@ sock_shutdown ()
|
||||
retVal = -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user