space cleanups

This commit is contained in:
marschap
2005-06-12 17:39:25 +00:00
parent d6971eaec5
commit a597e2cdcf
2 changed files with 33 additions and 29 deletions
+6 -4
View File
@@ -172,11 +172,11 @@ CFontz633_init (Driver *drvthis, char *args)
/* Which size */ /* Which size */
strncpy(size, drvthis->config_get_string (drvthis->name, "Size", 0, DEFAULT_SIZE), sizeof(size)); strncpy(size, drvthis->config_get_string (drvthis->name, "Size", 0, DEFAULT_SIZE), sizeof(size));
size[sizeof(size)-1] = '\0'; size[sizeof(size)-1] = '\0';
if ((sscanf(size, "%dx%d", &w, &h ) != 2) if ((sscanf(size, "%dx%d", &w, &h) != 2)
|| (w <= 0) || (w > LCD_MAX_WIDTH) || (w <= 0) || (w > LCD_MAX_WIDTH)
|| (h <= 0) || (h > LCD_MAX_HEIGHT)) { || (h <= 0) || (h > LCD_MAX_HEIGHT)) {
report (RPT_WARNING, "CFontz633_init: Cannot read size: %s. Using default value.\n", size); report (RPT_WARNING, "CFontz633_init: Cannot read size: %s. Using default value.\n", size);
sscanf( DEFAULT_SIZE, "%dx%d", &w, &h ); sscanf(DEFAULT_SIZE, "%dx%d", &w, &h);
} }
p->width = w; p->width = w;
p->height = h; p->height = h;
@@ -212,7 +212,9 @@ CFontz633_init (Driver *drvthis, char *args)
else if (tmp == 9600) speed = B9600; else if (tmp == 9600) speed = B9600;
else if (tmp == 19200) speed = B19200; else if (tmp == 19200) speed = B19200;
else if (tmp == 115200) speed = B115200; else if (tmp == 115200) speed = B115200;
else { report (RPT_WARNING, "CFontz633_init: Speed must be 1200, 2400, 9600, 19200 or 115200. Using default value.\n", speed); else {
report (RPT_WARNING, "CFontz633_init: Speed must be 1200, 2400, 9600, 19200 or 115200. Using default value.\n");
speed = DEFAULT_SPEED;
} }
/* New firmware version? /* New firmware version?
@@ -251,7 +253,7 @@ CFontz633_init (Driver *drvthis, char *args)
} else { } else {
#ifdef HAVE_CFMAKERAW #ifdef HAVE_CFMAKERAW
/* The easy way */ /* The easy way */
cfmakeraw( &portset ); cfmakeraw(&portset);
#else #else
/* The hard way */ /* The hard way */
portset.c_iflag &= ~( IGNBRK | BRKINT | PARMRK | ISTRIP portset.c_iflag &= ~( IGNBRK | BRKINT | PARMRK | ISTRIP
+6 -4
View File
@@ -228,11 +228,11 @@ CFontz633_init (Driver *drvthis, char *args)
strncpy(size, drvthis->config_get_string (drvthis->name, "Size", 0, default_size), sizeof(size)); strncpy(size, drvthis->config_get_string (drvthis->name, "Size", 0, default_size), sizeof(size));
size[sizeof(size)-1] = '\0'; size[sizeof(size)-1] = '\0';
debug (RPT_INFO,"CFontzPacket_init: Size (in config) is '%s'", size); debug (RPT_INFO,"CFontzPacket_init: Size (in config) is '%s'", size);
if ((sscanf(size, "%dx%d", &w, &h ) != 2) if ((sscanf(size, "%dx%d", &w, &h) != 2)
|| (w <= 0) || (w > LCD_MAX_WIDTH) || (w <= 0) || (w > LCD_MAX_WIDTH)
|| (h <= 0) || (h > LCD_MAX_HEIGHT)) { || (h <= 0) || (h > LCD_MAX_HEIGHT)) {
report (RPT_WARNING, "CFontzPacket_init: Cannot read size: %s. Using default value.\n", size); report (RPT_WARNING, "CFontzPacket_init: Cannot read size: %s. Using default value.\n", size);
sscanf( default_size, "%dx%d", &w, &h ); sscanf(default_size, "%dx%d", &w, &h);
} }
p->width = w; p->width = w;
p->height = h; p->height = h;
@@ -271,7 +271,9 @@ CFontz633_init (Driver *drvthis, char *args)
debug (RPT_INFO,"CFontzPacket_init: Speed (in config) is '%d'", tmp); debug (RPT_INFO,"CFontzPacket_init: Speed (in config) is '%d'", tmp);
if (tmp == 19200) speed = B19200; if (tmp == 19200) speed = B19200;
else if (tmp == 115200) speed = B115200; else if (tmp == 115200) speed = B115200;
else { report (RPT_WARNING, "CFontz633_init: Speed must be 19200 or 11500. Using default value.\n", speed); else {
report (RPT_WARNING, "CFontz633_init: Speed must be 19200 or 11500. Using default value.\n");
speed = DEFAULT_SPEED;
} }
/* New firmware version? /* New firmware version?
@@ -312,7 +314,7 @@ CFontz633_init (Driver *drvthis, char *args)
} else { } else {
#ifdef HAVE_CFMAKERAW #ifdef HAVE_CFMAKERAW
/* The easy way */ /* The easy way */
cfmakeraw( &portset ); cfmakeraw(&portset);
#else #else
/* The hard way */ /* The hard way */
portset.c_iflag &= ~( IGNBRK | BRKINT | PARMRK | ISTRIP portset.c_iflag &= ~( IGNBRK | BRKINT | PARMRK | ISTRIP