a few changes to better support gcc 2.95 (paul_c)

This commit is contained in:
marschap
2007-05-28 17:55:59 +00:00
parent 5e5ee21e37
commit 0e6b1253a9
7 changed files with 24 additions and 16 deletions
+2 -1
View File
@@ -98,9 +98,10 @@ time_screen(int rep, int display, int *flags_ptr)
tickTime(now, heartbeat);
if (lcd_hgt >= 4) {
machine_get_uptime(&uptime, &idle);
char tmp[40]; // should be large enough
machine_get_uptime(&uptime, &idle);
// display the uptime...
days = (int) uptime / 86400;
hour = ((int) uptime % 86400) / 3600;
+7 -3
View File
@@ -239,12 +239,14 @@ initialize_speed_screen(void)
void
format_value (char *buff, double value, char *unit)
{
char *mag;
/* Convert bytes to bits, if necessary */
if (strstr(unit, "b"))
value *= 8;
/* If units are bytes, then divide by 2^10, otherwise by 10^3 */
char *mag = convert_double(&value, (strstr(unit, "B")) ? 1024 : 1000, 1.0f);
mag = convert_double(&value, (strstr(unit, "B")) ? 1024 : 1000, 1.0f);
/* Formatting rules:
* - if original value was < 1000, output decimal value only
@@ -266,10 +268,12 @@ format_value (char *buff, double value, char *unit)
void
format_value_multi_interface (char *buff, double value, char *unit)
{
char *mag;
if (strstr(unit, "b"))
value *= 8;
char *mag = convert_double(&value, (strstr(unit, "B")) ? 1024 : 1000, 1.0f);
mag = convert_double(&value, (strstr(unit, "B")) ? 1024 : 1000, 1.0f);
/* Formatting rules:
* - if original value was < 1000, output decimal value only
@@ -281,7 +285,7 @@ format_value_multi_interface (char *buff, double value, char *unit)
else if (value < 10)
sprintf(buff, "%3.1f%s", value, mag);
else
sprintf(buff, "%3.f%s", value, mag);
sprintf(buff, "%3.0f%s", value, mag);
} /* format_value_multi_interface() */
+2 -2
View File
@@ -433,8 +433,6 @@ menu_set_item_func (Client * c, int argc, char **argv)
{ -1, NULL, -1, -1 }
};
debug (RPT_DEBUG, "%s( Client [%d]: %s)",
__FUNCTION__, c->sock, argv2string(argc, argv));
bool bool_value = false;
CheckboxValue checkbox_value = CHECKBOX_OFF;
short short_value = 0;
@@ -448,6 +446,8 @@ menu_set_item_func (Client * c, int argc, char **argv)
char * item_id;
int argnr;
debug (RPT_DEBUG, "%s( Client [%d]: %s)",
__FUNCTION__, c->sock, argv2string(argc, argv));
if (!c->ack)
return 1;
+6 -6
View File
@@ -569,6 +569,11 @@ MtxOrb_flush (Driver *drvthis)
unsigned char *sp = p->framebuf + (i * p->width);
unsigned char *sq = p->backingstore + (i * p->width);
// set pointers to end of the line in frame buffer & backing store
unsigned char *ep = sp + (p->width - 1);
unsigned char *eq = sq + (p->width - 1);
int length = 0;
debug(RPT_DEBUG, "Framebuf: '%.*s'", p->width, sp);
debug(RPT_DEBUG, "Backingstore: '%.*s'", p->width, sq);
@@ -577,11 +582,6 @@ MtxOrb_flush (Driver *drvthis)
* - leave out leading and trailing parts that are identical
*/
// set pointers to end of the line in frame buffer & backing store
unsigned char *ep = sp + (p->width - 1);
unsigned char *eq = sq + (p->width - 1);
int length = 0;
// skip over leading identical portions of the line
for (j = 0; (sp <= ep) && (*sp == *sq); sp++, sq++, j++)
;
@@ -1193,7 +1193,7 @@ MODULE_EXPORT void
MtxOrb_set_char (Driver *drvthis, int n, unsigned char *dat)
{
PrivateData *p = drvthis->private_data;
unsigned char out[12] = { '\xFE', 'N', 0, 0,0,0,0,0,0,0,0 };;
unsigned char out[12] = { '\xFE', 'N', 0, 0,0,0,0,0,0,0,0 };
unsigned char mask = (1 << p->cellwidth) - 1;
int row;
+1 -1
View File
@@ -378,7 +378,7 @@ serialVFD_set_char (Driver *drvthis, int n, unsigned char *dat)
int posbyte = (pos-1) / 5;
int posbit = 4 - ((pos-1) % 5);
letter |= ((dat[posbyte] >> posbit) & 1) << bit;;
letter |= ((dat[posbyte] >> posbit) & 1) << bit;
}
}
p->custom_char[n][byte] = letter;
+2 -1
View File
@@ -704,10 +704,11 @@ MenuResult menu_process_input(Menu *menu, MenuToken token, const char *key, bool
* hidden or not valid subitem of menu this function does nothing. */
void menu_select_subitem(Menu *menu, char *subitem_id)
{
int position;
assert(menu != NULL);
position = menu_get_index_of(menu, subitem_id);
debug(RPT_DEBUG, "%s(menu=[%s], subitem_id=\"%s\")", __FUNCTION__,
menu->id, subitem_id);
int position = menu_get_index_of(menu, subitem_id);
if (position < 0)
{
debug(RPT_DEBUG, "%s: subitem \"%s\" not found"
+4 -2
View File
@@ -277,13 +277,14 @@ static void handle_enter(void)
static void handle_predecessor(void)
{
MenuItem* predecessor;
MenuItem* item = (active_menuitem->type == MENUITEM_MENU)
? menu_get_item_for_predecessor_check(active_menuitem)
: active_menuitem;
assert(item != NULL);
debug(RPT_DEBUG, "%s: Switching to registered predecessor '%s' of '%s'.",
__FUNCTION__, item->predecessor_id, item->id);
MenuItem *predecessor = menuitem_search(
predecessor = menuitem_search(
item->predecessor_id, (Client*)active_menuitem->client);
if (predecessor == NULL)
{
@@ -318,13 +319,14 @@ static void handle_predecessor(void)
static void handle_successor(void)
{
MenuItem *successor;
MenuItem* item = (active_menuitem->type == MENUITEM_MENU)
? menu_get_item_for_successor_check(active_menuitem)
: active_menuitem;
assert(item != NULL);
debug(RPT_DEBUG, "%s: Switching to registered successor '%s' of '%s'.",
__FUNCTION__, item->successor_id, item->id);
MenuItem *successor = menuitem_search(
successor = menuitem_search(
item->successor_id, (Client*)active_menuitem->client);
if (successor == NULL)
{