ctk-curses: style fixes

This commit is contained in:
François Revol 2013-03-30 23:26:22 +01:00
parent 8daf2b6659
commit a03334a59d

View File

@ -101,6 +101,7 @@ console_init(void)
mmask_t oldmask;
#endif
static unsigned char done;
int bg, fg;
if(done) {
return;
@ -129,14 +130,12 @@ console_init(void)
screensize(&width, &height);
/* curses color handling is weird... */
{
int bg, fg;
for(fg = 0; fg < 8; fg++)
for(bg = 0; bg < 8; bg++)
/* we must declare all possible color pairs */
for(fg = 0; fg < 8; fg++) {
for(bg = 0; bg < 8; bg++) {
init_pair(MKPAIR(bg, fg), fg, bg);
}
}
/* set window title */
putp("\033]0;Contiki\a");
@ -195,8 +194,9 @@ setcolor(void)
bg = (color & 0xF0) >> 4;
attrs = COLOR_PAIR(MKPAIR(bg, fg));
if(reversed)
if(reversed) {
attrs |= WA_REVERSE;
}
attrset(attrs);
}
/*-----------------------------------------------------------------------------------*/
@ -443,8 +443,9 @@ console_read(void)
int k;
k = getch();
if(k != ERR)
if(k != ERR) {
console_readkey(k);
}
}
/*-----------------------------------------------------------------------------------*/
char