Various tiny fixes (trivial):

- Show PCI IDs as 4-digit numbers always.

 - Cosmetic changes to make UI look more consistent.

 - Drop MODULE_COUNT #define and use ARRAY_SIZE() where needed.

 - Small fix to improve build system (create build/ when not there).

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3191 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Uwe Hermann
2008-03-27 20:46:49 +00:00
parent 408c4e1784
commit a0c0093a09
4 changed files with 18 additions and 20 deletions

View File

@ -26,12 +26,10 @@ extern struct coreinfo_module cpuinfo_module;
extern struct coreinfo_module pci_module;
extern struct coreinfo_module coreboot_module;
#define MODULE_COUNT 3
struct coreinfo_module *modules[MODULE_COUNT] = {
struct coreinfo_module *modules[] = {
&cpuinfo_module,
&pci_module,
&coreboot_module
&coreboot_module,
};
static WINDOW *modwin;
@ -61,7 +59,7 @@ static void print_menu(void)
for (j = 0; j < SCREEN_X; j++)
waddch(stdscr, ' ');
for (i = 0; i < MODULE_COUNT; i++)
for (i = 0; i < ARRAY_SIZE(modules); i++)
ptr += sprintf(ptr, "F%d: %s ", i + 1, modules[i]->name);
mvprintw(23, 0, menu);
@ -127,7 +125,7 @@ static void loop(void)
if (key >= KEY_F(1) && key <= KEY_F(9)) {
unsigned char ch = key - KEY_F(1);
if (ch < MODULE_COUNT) {
if (ch < ARRAY_SIZE(modules)) {
curwin = ch;
redraw_module();
continue;
@ -167,7 +165,7 @@ int main(void)
refresh();
for (i = 0; i < MODULE_COUNT; i++)
for (i = 0; i < ARRAY_SIZE(modules); i++)
modules[i]->init();
loop();