[coreboot] r3182 - in trunk/payloads/libpayload: . curses drivers i386 include sample
svn at coreboot.org
svn at coreboot.org
Thu Mar 20 21:46:44 CET 2008
Author: uwe
Date: 2008-03-20 21:46:44 +0100 (Thu, 20 Mar 2008)
New Revision: 3182
Modified:
trunk/payloads/libpayload/Makefile
trunk/payloads/libpayload/curses/colors.c
trunk/payloads/libpayload/curses/keyboard.c
trunk/payloads/libpayload/curses/tinycurses.c
trunk/payloads/libpayload/drivers/vga.c
trunk/payloads/libpayload/i386/coreboot.c
trunk/payloads/libpayload/i386/main.c
trunk/payloads/libpayload/i386/timer.c
trunk/payloads/libpayload/include/libpayload.h
trunk/payloads/libpayload/sample/Makefile
Log:
Fix code to allow usage of -Wall in libpayload and the sample (trivial).
This even fixes two bugs:
- get_cpu_speed() didn't return a value.
- The line
win->_color - PAIR_NUMBER(0);
should actually be
win->_color = PAIR_NUMBER(0);
Signed-off-by: Uwe Hermann <uwe at hermann-uwe.de>
Acked-by: Uwe Hermann <uwe at hermann-uwe.de>
Modified: trunk/payloads/libpayload/Makefile
===================================================================
--- trunk/payloads/libpayload/Makefile 2008-03-20 20:05:22 UTC (rev 3181)
+++ trunk/payloads/libpayload/Makefile 2008-03-20 20:46:44 UTC (rev 3182)
@@ -61,7 +61,7 @@
INCLUDES := -I./include
INCLUDES += -I$(shell $(CC) -print-search-dirs | head -n 1 | cut -d' ' -f2)include
-CFLAGS := -Werror -Os -fno-stack-protector -nostdinc $(INCLUDES)
+CFLAGS := -Wall -Werror -Os -fno-stack-protector -nostdinc $(INCLUDES)
libpayload.a: $(TARGETS-y)
$(AR) rc $@ $(TARGETS-y)
Modified: trunk/payloads/libpayload/curses/colors.c
===================================================================
--- trunk/payloads/libpayload/curses/colors.c 2008-03-20 20:05:22 UTC (rev 3181)
+++ trunk/payloads/libpayload/curses/colors.c 2008-03-20 20:46:44 UTC (rev 3182)
@@ -57,4 +57,6 @@
*bg = (color_pairs[index] >> 4) & 0xF;
*fg = color_pairs[index] & 0xF;
+
+ return 0;
}
Modified: trunk/payloads/libpayload/curses/keyboard.c
===================================================================
--- trunk/payloads/libpayload/curses/keyboard.c 2008-03-20 20:05:22 UTC (rev 3181)
+++ trunk/payloads/libpayload/curses/keyboard.c 2008-03-20 20:46:44 UTC (rev 3182)
@@ -268,6 +268,7 @@
int nodelay(WINDOW *win, NCURSES_BOOL flag)
{
win->_delay = flag ? 0 : -1;
+ return 0;
}
#ifdef CONFIG_VGA_CONSOLE
Modified: trunk/payloads/libpayload/curses/tinycurses.c
===================================================================
--- trunk/payloads/libpayload/curses/tinycurses.c 2008-03-20 20:05:22 UTC (rev 3181)
+++ trunk/payloads/libpayload/curses/tinycurses.c 2008-03-20 20:46:44 UTC (rev 3182)
@@ -145,7 +145,7 @@
}
WINDOW *derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx)
{
- WINDOW *win;
+ WINDOW *win = NULL;
int i;
int flags = _SUBWIN;
@@ -167,6 +167,7 @@
if (orig->_flags & _ISPAD)
flags |= _ISPAD;
+ // FIXME
//// if ((win = _nc_makenew(num_lines, num_columns, orig->_begy + begy,
//// orig->_begx + begx, flags)) == 0)
//// return NULL;
@@ -308,8 +309,8 @@
win->_line = &ldat_list[ldat_count++];
- /* FIXME: Is this right? Should the window attributes be normal? */
- win->_color - PAIR_NUMBER(0);
+ /* FIXME: Is this right? Should the window attributes be normal? */
+ win->_color = PAIR_NUMBER(0);
win->_attrs = A_NORMAL;
for (i = 0; i < num_lines; i++)
Modified: trunk/payloads/libpayload/drivers/vga.c
===================================================================
--- trunk/payloads/libpayload/drivers/vga.c 2008-03-20 20:05:22 UTC (rev 3181)
+++ trunk/payloads/libpayload/drivers/vga.c 2008-03-20 20:46:44 UTC (rev 3182)
@@ -184,7 +184,7 @@
vga_fixup_cursor();
}
-int vga_move_cursor(int x, int y)
+void vga_move_cursor(int x, int y)
{
cursorx = x;
cursory = y;
Modified: trunk/payloads/libpayload/i386/coreboot.c
===================================================================
--- trunk/payloads/libpayload/i386/coreboot.c 2008-03-20 20:05:22 UTC (rev 3181)
+++ trunk/payloads/libpayload/i386/coreboot.c 2008-03-20 20:46:44 UTC (rev 3182)
@@ -83,7 +83,7 @@
for (i = 0; i < len; i += 16, ptr += 16) {
header = (struct cb_header *)ptr;
- if (!strncmp(header->signature, "LBIO", 4))
+ if (!strncmp((const char *)header->signature, "LBIO", 4))
break;
}
Modified: trunk/payloads/libpayload/i386/main.c
===================================================================
--- trunk/payloads/libpayload/i386/main.c 2008-03-20 20:05:22 UTC (rev 3181)
+++ trunk/payloads/libpayload/i386/main.c 2008-03-20 20:46:44 UTC (rev 3182)
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
-#include <arch/types.h>
+#include <libpayload.h>
/*
* This structure seeds the stack. We provide the return address of our main
Modified: trunk/payloads/libpayload/i386/timer.c
===================================================================
--- trunk/payloads/libpayload/i386/timer.c 2008-03-20 20:05:22 UTC (rev 3181)
+++ trunk/payloads/libpayload/i386/timer.c 2008-03-20 20:46:44 UTC (rev 3182)
@@ -62,6 +62,8 @@
* Multiply that by the number of measured clocks to get the kHz value.
*/
cpu_khz = (unsigned int)((end - start) * 1193180U / (1000 * 0xffff));
+
+ return cpu_khz;
}
static inline void _delay(unsigned int delta)
Modified: trunk/payloads/libpayload/include/libpayload.h
===================================================================
--- trunk/payloads/libpayload/include/libpayload.h 2008-03-20 20:05:22 UTC (rev 3181)
+++ trunk/payloads/libpayload/include/libpayload.h 2008-03-20 20:46:44 UTC (rev 3182)
@@ -59,7 +59,7 @@
void vga_clear(void);
void vga_putc(uint8_t row, uint8_t col, unsigned int c);
void vga_putchar(unsigned int ch);
-int vga_move_cursor(int x, int y);
+void vga_move_cursor(int x, int y);
void vga_init(void);
/* libc/console.c */
Modified: trunk/payloads/libpayload/sample/Makefile
===================================================================
--- trunk/payloads/libpayload/sample/Makefile 2008-03-20 20:05:22 UTC (rev 3181)
+++ trunk/payloads/libpayload/sample/Makefile 2008-03-20 20:46:44 UTC (rev 3182)
@@ -37,7 +37,7 @@
LIBPAYLOAD = ../libpayload.a
LIBGCC := $(shell $(CC) $(CROSS_CFLAGS) -print-libgcc-file-name)
-CFLAGS := -Werror -Os -fno-stack-protector -nostdinc $(INCLUDES)
+CFLAGS := -Wall -Werror -Os -fno-stack-protector -nostdinc $(INCLUDES)
all: hello.elf
More information about the coreboot
mailing list