diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-01-24 16:25:34 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-01-24 16:25:34 -0800 |
commit | 95e6215b6f1d31eebdb1ddeb4c13007c5af30c23 (patch) | |
tree | 5dbce6408bb350b242e5c4dd592da103ed6cfb86 | |
parent | 8f189531a58aef0655cd04a620931da3a0157eaa (diff) | |
parent | 1da816e5101d61edc8a01e3c76a1b89933a8b863 (diff) | |
download | syslinux-95e6215b6f1d31eebdb1ddeb4c13007c5af30c23.tar.gz syslinux-95e6215b6f1d31eebdb1ddeb4c13007c5af30c23.tar.xz syslinux-95e6215b6f1d31eebdb1ddeb4c13007c5af30c23.zip |
Merge branch 'master' into fsc
Conflicts:
com32/lib/MCONFIG
com32/lib/readdir.c
48 files changed, 114 insertions, 124 deletions
@@ -62,6 +62,11 @@ WGET = wget com32 = $(topdir)/com32 +# Common warnings we want for all gcc-generated code +GCCWARN := -W -Wall -Wstrict-prototypes +# Extremely useful variant for debugging... +#GCCWARN += -Wno-clobbered -Werror + # Common stanza to make gcc generate .*.d dependency files MAKEDEPS = -Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d diff --git a/MCONFIG.embedded b/MCONFIG.embedded index bb718963..e8879fc5 100644 --- a/MCONFIG.embedded +++ b/MCONFIG.embedded @@ -35,7 +35,7 @@ GCCOPT += $(call gcc_ok,-mpreferred-stack-boundary=2,) LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc) LD += -m elf_i386 -CFLAGS = $(GCCOPT) -g -W -Wall -Wno-sign-compare $(OPTFLAGS) $(INCLUDES) +CFLAGS = $(GCCOPT) -g $(GCCWARN) -Wno-sign-compare $(OPTFLAGS) $(INCLUDES) SFLAGS = $(CFLAGS) -D__ASSEMBLY__ .SUFFIXES: .c .o .S .s .i .elf .com .bin .asm .lst .c32 .lss @@ -10,6 +10,8 @@ Changes in 3.85: prompt with an error message (if NOESCAPE is set, we stop with a "boot failed" message; this is also the case for PXELINUX if the configuration file is not found.) + * chain.c32: support chainloading Grub4DOS; patch by Gert + Hulselmans. Changes in 3.84: * SYSLINUX: make the DOS installer work for MS-DOS 7.x/8.x @@ -25,7 +25,7 @@ for details. SYSLINUX is: - Copyright 1994-2008 H. Peter Anvin - All Rights Reserved + Copyright 1994-2010 H. Peter Anvin et al - All Rights Reserved This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/com32/MCONFIG b/com32/MCONFIG index 3af015e1..80f92f6c 100644 --- a/com32/MCONFIG +++ b/com32/MCONFIG @@ -44,11 +44,11 @@ GPLLIB = GPLINCLUDE = endif -CFLAGS = $(GCCOPT) -W -Wall -march=i386 \ +CFLAGS = $(GCCOPT) $(GCCWARN) -march=i386 \ -fomit-frame-pointer -D__COM32__ \ -nostdinc -iwithprefix include \ -I$(com32)/libutil/include -I$(com32)/include $(GPLINCLUDE) -SFLAGS = $(GCCOPT) -W -Wall -march=i386 \ +SFLAGS = $(GCCOPT) $(GCCWARN) -march=i386 \ -fomit-frame-pointer -D__COM32__ \ -nostdinc -iwithprefix include \ -I$(com32)/libutil/include -I$(com32)/include $(GPLINCLUDE) @@ -57,7 +57,7 @@ COM32LD = $(com32)/lib/com32.ld LDFLAGS = -m elf_i386 --emit-relocs -T $(COM32LD) LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc) -LNXCFLAGS = -I$(com32)/libutil/include -W -Wall -O -g -D_GNU_SOURCE +LNXCFLAGS = -I$(com32)/libutil/include $(GCCWARN) -O -g -D_GNU_SOURCE LNXSFLAGS = -g LNXLDFLAGS = -g diff --git a/com32/cmenu/adv_menu.tpl b/com32/cmenu/adv_menu.tpl index be3c558e..a1a5d96a 100644 --- a/com32/cmenu/adv_menu.tpl +++ b/com32/cmenu/adv_menu.tpl @@ -183,12 +183,12 @@ TIMEOUTCODE timeout(const char *cmd) } } -TIMEOUTCODE ontimeout() +TIMEOUTCODE ontimeout(void) { return timeout(timeoutcmd); } -TIMEOUTCODE ontotaltimeout() +TIMEOUTCODE ontotaltimeout(void) { return timeout(totaltimeoutcmd); } diff --git a/com32/cmenu/complex.c b/com32/cmenu/complex.c index 1ac51997..f5175fa9 100644 --- a/com32/cmenu/complex.c +++ b/com32/cmenu/complex.c @@ -54,7 +54,7 @@ char username[12]; // Name of user currently using the system /* End globals */ -TIMEOUTCODE ontimeout() +TIMEOUTCODE ontimeout(void) { beep(); return CODE_WAIT; @@ -244,7 +244,7 @@ t_handler_return checkbox_handler(t_menusystem * ms, t_menuitem * mi) return rv; } -int main() +int main(void) { t_menuitem *curr; char cmd[160]; diff --git a/com32/cmenu/libmenu/menu.c b/com32/cmenu/libmenu/menu.c index de4a1ee2..13754768 100644 --- a/com32/cmenu/libmenu/menu.c +++ b/com32/cmenu/libmenu/menu.c @@ -40,7 +40,7 @@ int isvisible(pt_menu menu, int first, int curr); // This is same as inputc except it honors the ontimeout handler // and calls it when needed. For the callee, there is no difference // as this will not return unless a key has been pressed. -static int getch() +static int getch(void) { t_timeout_handler th; int key; @@ -615,7 +615,7 @@ uchar find_menu_num(const char *name) // Run through all items and if they are submenus // with a non-trivial "action" and trivial submenunum // replace submenunum with the menu with name "action" -void fix_submenus() +void fix_submenus(void) { int i, j; pt_menu m; @@ -874,7 +874,7 @@ void reg_ontimeout(t_timeout_handler handler, unsigned int numsteps, ms->tm_stepsize = stepsize; } -void unreg_ontimeout() +void unreg_ontimeout(void) { ms->ontimeout = NULL; } @@ -889,7 +889,7 @@ void reg_ontotaltimeout(t_timeout_handler handler, } } -void unreg_ontotaltimeout() +void unreg_ontotaltimeout(void) { ms->ontotaltimeout = NULL; } @@ -1084,7 +1084,7 @@ void set_menu_pos(uchar row, uchar col) // Set the position of this menu. m->col = col; } -pt_menuitem add_sep() // Add a separator to current menu +pt_menuitem add_sep(void) // Add a separator to current menu { pt_menuitem mi; pt_menu m; diff --git a/com32/cmenu/libmenu/menu.h b/com32/cmenu/libmenu/menu.h index a1356020..141d2ef0 100644 --- a/com32/cmenu/libmenu/menu.h +++ b/com32/cmenu/libmenu/menu.h @@ -225,7 +225,7 @@ pt_menuitem showmenus(uchar startmenu); pt_menusystem init_menusystem(const char *title); -void close_menusystem(); // Deallocate memory used +void close_menusystem(void); // Deallocate memory used void set_normal_attr(uchar normal, uchar selected, uchar inactivenormal, uchar inactiveselected); @@ -253,10 +253,10 @@ void reg_ontimeout(t_timeout_handler, unsigned int numsteps, unsigned int stepsize); // Set timeout handler, set 0 for default values. // So stepsize=0 means numsteps is measured in centiseconds. -void unreg_ontimeout(); +void unreg_ontimeout(void); void reg_ontotaltimeout(t_timeout_handler, unsigned long numcentiseconds); -void unreg_ontotaltimeout(); +void unreg_ontotaltimeout(void); // Find the number of the menu given the name // Returns -1 if not found @@ -284,7 +284,7 @@ static inline void set_shortcut(uchar shortcut) } // Add a separator to the "current" menu -pt_menuitem add_sep(); +pt_menuitem add_sep(void); // Generate string based on state of checkboxes and radioitem in given menu // and append string to existing contents of "line" diff --git a/com32/cmenu/libmenu/passwords.c b/com32/cmenu/libmenu/passwords.c index 06f4cfb3..44ce461f 100644 --- a/com32/cmenu/libmenu/passwords.c +++ b/com32/cmenu/libmenu/passwords.c @@ -148,7 +148,7 @@ void init_passwords(const char *filename) fclose(f); } -void close_passwords() +void close_passwords(void) { int i; diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c index 3937e305..bfdd8cce 100644 --- a/com32/gfxboot/gfxboot.c +++ b/com32/gfxboot/gfxboot.c @@ -573,7 +573,7 @@ int gfx_init(char *file) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int gfx_menu_init() +int gfx_menu_init(void) { com32sys_t r; @@ -585,7 +585,7 @@ int gfx_menu_init() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void gfx_done() +void gfx_done(void) { com32sys_t r; @@ -599,7 +599,7 @@ void gfx_done() // return: // boot menu index (-1: go to text mode prompt) // -int gfx_input() +int gfx_input(void) { com32sys_t r; @@ -688,7 +688,7 @@ void *load_one(char *file, ssize_t *file_size) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Locate menu entry and boot. // -void boot() +void boot(void) { char *label, *arg, *s; menu_t *menu_ptr; diff --git a/com32/gplinclude/disk/bootloaders.h b/com32/gplinclude/disk/bootloaders.h index 5a6ff9d9..56a0f4e3 100644 --- a/com32/gplinclude/disk/bootloaders.h +++ b/com32/gplinclude/disk/bootloaders.h @@ -14,6 +14,6 @@ #include <disk/geom.h> #include <disk/partition.h> -int get_bootloader_string(const struct driveinfo *, const struct part_entry *, +int get_bootloader_string(struct driveinfo *, const struct part_entry *, char *, const int); #endif /* __BOOTLOADERS_H_ */ diff --git a/com32/gpllib/disk/ata.c b/com32/gpllib/disk/ata.c index b0c2b63c..78f669ec 100644 --- a/com32/gpllib/disk/ata.c +++ b/com32/gpllib/disk/ata.c @@ -55,7 +55,7 @@ void ata_id_c_string(const uint16_t * id, unsigned char *s, ata_id_string(id, s, ofs, len - 1); - p = s + strnlen(s, len - 1); + p = s + strnlen((const char *)s, len - 1); while (p > s && p[-1] == ' ') p--; *p = '\0'; diff --git a/com32/gpllib/disk/bootloaders.c b/com32/gpllib/disk/bootloaders.c index 29aecbd4..188dd64b 100644 --- a/com32/gpllib/disk/bootloaders.c +++ b/com32/gpllib/disk/bootloaders.c @@ -22,7 +22,7 @@ * @buffer: pre-allocated buffer * @buffer_size: @buffer size **/ -int get_bootloader_string(const struct driveinfo *d, const struct part_entry *p, +int get_bootloader_string(struct driveinfo *d, const struct part_entry *p, char *buffer, const int buffer_size) { char boot_sector[SECTOR * sizeof(char)]; diff --git a/com32/gpllib/dmi/dmi_processor.c b/com32/gpllib/dmi/dmi_processor.c index fd007da3..1cd9d1ba 100644 --- a/com32/gpllib/dmi/dmi_processor.c +++ b/com32/gpllib/dmi/dmi_processor.c @@ -49,7 +49,7 @@ const char *dmi_processor_type(uint8_t code) const char *dmi_processor_family(uint8_t code, char *manufacturer) { /* 3.3.5.2 */ - static const char *family[] = { + static const char *family[256] = { NULL, /* 0x00 */ "Other", "Unknown", @@ -306,54 +306,6 @@ const char *dmi_processor_family(uint8_t code, char *manufacturer) NULL, NULL, NULL, /* 0xFF */ - NULL, - NULL, - NULL, - NULL, - "SH-3", - "SH-4", - NULL, /*0x106*/ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, /*0x110*/ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - "ARM", - "StrongARM", - NULL, /*0x19A*/ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, /*0x120*/ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, /*0x12A*/ - NULL, - "6x86", - "MediaGX", - "MII" /*0x12E*/ - /* master.mif has values beyond that, but they can't be used for DMI */ }; /* Special case for ambiguous value 0xBE */ if (code == 0xBE) { @@ -367,7 +319,7 @@ const char *dmi_processor_family(uint8_t code, char *manufacturer) return "Core 2 or K7"; } - if ((code<=0x12E) && (family[code] != NULL)) { + if (family[code] != NULL) { return family[code]; } return out_of_spec; diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c index 69a2b61f..76aed784 100644 --- a/com32/hdt/hdt-cli.c +++ b/com32/hdt/hdt-cli.c @@ -96,7 +96,7 @@ static void autocomplete_add_token_to_list(const char *token) autocomplete_tail = new; } -static void autocomplete_destroy_list() +static void autocomplete_destroy_list(void) { struct autocomplete_list *tmp = NULL; @@ -727,7 +727,7 @@ out: free(argv); } -static void reset_prompt() +static void reset_prompt(void) { /* No need to display the prompt if we exit */ if (hdt_cli.mode != EXIT_MODE) { @@ -779,7 +779,7 @@ void start_auto_mode(struct s_hardware *hardware) more_printf("\n"); } -void print_history() +void print_history(void) { reset_more_printf(); for (int i = 1; i <= MAX_HISTORY_SIZE; i++) { diff --git a/com32/hdt/hdt-cli.h b/com32/hdt/hdt-cli.h index 898b53f8..b55d108a 100644 --- a/com32/hdt/hdt-cli.h +++ b/com32/hdt/hdt-cli.h @@ -160,7 +160,7 @@ void start_auto_mode(struct s_hardware *hardware); void main_show(char *item, struct s_hardware *hardware); #define CLI_HISTORY "history" -void print_history(); +void print_history(void); // DMI STUFF #define CLI_DMI_BASE_BOARD "base_board" diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c index 59175cec..736d9b6e 100644 --- a/com32/hdt/hdt-common.c +++ b/com32/hdt/hdt-common.c @@ -649,7 +649,7 @@ char *del_multi_spaces(char *p) } /* Reset the more_printf counter */ -void reset_more_printf() +void reset_more_printf(void) { display_line_nb = 0; } diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index d7a58e2f..0a0c8c4e 100644 --- a/com32/hdt/hdt-common.h +++ b/com32/hdt/hdt-common.h @@ -201,7 +201,7 @@ struct s_hardware { char vesa_background[255]; }; -void reset_more_printf(); +void reset_more_printf(void); const char *find_argument(const char **argv, const char *argument); char *remove_spaces(char *p); char *remove_trailing_lf(char *p); diff --git a/com32/hdt/hdt-menu.c b/com32/hdt/hdt-menu.c index 1aa0906f..4629ee58 100644 --- a/com32/hdt/hdt-menu.c +++ b/com32/hdt/hdt-menu.c @@ -79,7 +79,7 @@ int start_menu_mode(struct s_hardware *hardware, char *version_string) } /* In the menu system, what to do on keyboard timeout */ -TIMEOUTCODE ontimeout() +TIMEOUTCODE ontimeout(void) { // beep(); return CODE_WAIT; diff --git a/com32/hdt/hdt-menu.h b/com32/hdt/hdt-menu.h index f10e5290..c8c91243 100644 --- a/com32/hdt/hdt-menu.h +++ b/com32/hdt/hdt-menu.h @@ -82,7 +82,7 @@ struct s_hdt_menu { int total_menu_count; // Sum of all menus we have }; -TIMEOUTCODE ontimeout(); +TIMEOUTCODE ontimeout(void); void keys_handler(t_menusystem * ms __attribute__ ((unused)), t_menuitem * mi, int scancode); diff --git a/com32/lib/MCONFIG b/com32/lib/MCONFIG index 7e092df3..44278bd1 100644 --- a/com32/lib/MCONFIG +++ b/com32/lib/MCONFIG @@ -33,8 +33,9 @@ LIBFLAGS = -DDYNAMIC_CRC_TABLE -DPNG_NO_CONSOLE_IO \ REQFLAGS = $(GCCOPT) -g -mregparm=3 -DREGPARM=3 -D__COM32__ \ -nostdinc -iwithprefix include -I. -I./sys -I../include -OPTFLAGS = -Os -march=i386 -ffast-math -fomit-frame-pointer -WARNFLAGS = -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline +OPTFLAGS = -Os -march=i386 -falign-functions=0 -falign-jumps=0 \ + -falign-labels=0 -ffast-math -fomit-frame-pointer +WARNFLAGS = $(GCCWARN) -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline CFLAGS = $(OPTFLAGS) $(REQFLAGS) $(WARNFLAGS) $(LIBFLAGS) LDFLAGS = -m elf32_i386 diff --git a/com32/lib/chdir.c b/com32/lib/chdir.c index 6f92d668..6a365f3b 100644 --- a/com32/lib/chdir.c +++ b/com32/lib/chdir.c @@ -8,6 +8,10 @@ int chdir(const char *path) { + /* Actually implement something here... */ + + (void)path; + errno = ENOSYS; return -1; } diff --git a/com32/lib/closedir.c b/com32/lib/closedir.c index b3f55642..f4de67ae 100644 --- a/com32/lib/closedir.c +++ b/com32/lib/closedir.c @@ -10,6 +10,7 @@ #include <string.h> #include <unistd.h> #include <fcntl.h> +#include <stdlib.h> int closedir(DIR * dir) { diff --git a/com32/lib/fdopendir.c b/com32/lib/fdopendir.c index 5fe11617..4fc31388 100644 --- a/com32/lib/fdopendir.c +++ b/com32/lib/fdopendir.c @@ -8,6 +8,8 @@ DIR *fdopendir(int __fd) { + (void)__fd; + errno = ENOSYS; return NULL; } diff --git a/com32/lib/libgcc/__moddi3.c b/com32/lib/libgcc/__moddi3.c index ac8d3af7..4fc55884 100644 --- a/com32/lib/libgcc/__moddi3.c +++ b/com32/lib/libgcc/__moddi3.c @@ -21,7 +21,7 @@ int64_t __moddi3(int64_t num, int64_t den) minus ^= 1; } - (void)__udivmoddi4(num, den, &v); + (void)__udivmoddi4(num, den, (uint64_t *)&v); if (minus) v = -v; diff --git a/com32/lib/opendir.c b/com32/lib/opendir.c index 6f91032b..c5e9aa05 100644 --- a/com32/lib/opendir.c +++ b/com32/lib/opendir.c @@ -10,6 +10,7 @@ #include <string.h> #include <unistd.h> #include <fcntl.h> +#include <stdlib.h> DIR *opendir(const char *pathname) { diff --git a/com32/lib/readdir.c b/com32/lib/readdir.c index 07ca3955..d59ad3a2 100644 --- a/com32/lib/readdir.c +++ b/com32/lib/readdir.c @@ -10,6 +10,7 @@ #include <string.h> #include <unistd.h> #include <fcntl.h> +#include <stdlib.h> struct dirent *readdir(DIR * dir) { @@ -21,6 +22,6 @@ struct dirent *readdir(DIR * dir) regs.esi.l = (uint32_t)dir; __com32.cs_intcall(0x22, ®s, ®s); newde = (struct dirent *)(regs.eax.l); - + return newde; } diff --git a/com32/lib/strcasecmp.c b/com32/lib/strcasecmp.c index 849c21fd..30949a09 100644 --- a/com32/lib/strcasecmp.c +++ b/com32/lib/strcasecmp.c @@ -7,7 +7,8 @@ int strcasecmp(const char *s1, const char *s2) { - const unsigned char *c1 = s1, *c2 = s2; + const unsigned char *c1 = (const unsigned char *)s1; + const unsigned char *c2 = (const unsigned char *)s2; unsigned char ch; int d = 0; diff --git a/com32/lib/strcmp.c b/com32/lib/strcmp.c index 77bb2b41..47a4aad8 100644 --- a/com32/lib/strcmp.c +++ b/com32/lib/strcmp.c @@ -6,7 +6,8 @@ int strcmp(const char *s1, const char *s2) { - const unsigned char *c1 = s1, *c2 = s2; + const unsigned char *c1 = (const unsigned char *)s1; + const unsigned char *c2 = (const unsigned char *)s2; unsigned char ch; int d = 0; diff --git a/com32/lib/strncasecmp.c b/com32/lib/strncasecmp.c index 8b8b967a..2caac0a5 100644 --- a/com32/lib/strncasecmp.c +++ b/com32/lib/strncasecmp.c @@ -7,7 +7,8 @@ int strncasecmp(const char *s1, const char *s2, size_t n) { - const unsigned char *c1 = s1, *c2 = s2; + const unsigned char *c1 = (const unsigned char *)s1; + const unsigned char *c2 = (const unsigned char *)s2; unsigned char ch; int d = 0; diff --git a/com32/lib/strncmp.c b/com32/lib/strncmp.c index f2f2f022..e41b9e36 100644 --- a/com32/lib/strncmp.c +++ b/com32/lib/strncmp.c @@ -6,7 +6,8 @@ int strncmp(const char *s1, const char *s2, size_t n) { - const unsigned char *c1 = s1, *c2 = s2; + const unsigned char *c1 = (const unsigned char *)s1; + const unsigned char *c2 = (const unsigned char *)s2; unsigned char ch; int d = 0; diff --git a/com32/lib/sys/argv.c b/com32/lib/sys/argv.c index b325f26d..8e9aabdb 100644 --- a/com32/lib/sys/argv.c +++ b/com32/lib/sys/argv.c @@ -75,7 +75,7 @@ int __parse_argv(char ***argv, const char *str) } /* Now create argv */ - arg = ALIGN_UP_FOR(q, char *); + arg = (char **)ALIGN_UP_FOR(q, char *); *argv = arg; *arg++ = argv0; /* argv[0] */ diff --git a/com32/lib/sys/colortable.c b/com32/lib/sys/colortable.c index df6d9782..ab1c4246 100644 --- a/com32/lib/sys/colortable.c +++ b/com32/lib/sys/colortable.c @@ -4,6 +4,6 @@ static struct color_table default_color_table[] = { {"default", "0", 0xffffffff, 0x00000000, SHADOW_NORMAL} }; -struct color_table *console_color_table = &default_color_table; +struct color_table *console_color_table = default_color_table; int console_color_table_size = (sizeof default_color_table / sizeof(struct color_table)); diff --git a/com32/lib/sys/libansi.c b/com32/lib/sys/libansi.c index 5bc0026e..a011cb87 100644 --- a/com32/lib/sys/libansi.c +++ b/com32/lib/sys/libansi.c @@ -46,18 +46,21 @@ void display_cursor(bool status) } } -void clear_end_of_line() { +void clear_end_of_line(void) +{ fputs(CSI "0K", stdout); } -void move_cursor_left(int count) { +void move_cursor_left(int count) +{ char buffer[10]; memset(buffer,0,sizeof(buffer)); sprintf(buffer,CSI "%dD",count); fputs(buffer, stdout); } -void move_cursor_right(int count) { +void move_cursor_right(int count) +{ char buffer[10]; memset(buffer,0,sizeof(buffer)); sprintf(buffer, CSI "%dC", count); @@ -71,38 +74,45 @@ void set_cursor_blink(bool status) { fputs("\033[0m",stdout); } -void clear_line() { +void clear_line(void) +{ fputs(CSI "2K", stdout); } -void clear_beginning_of_line() { +void clear_beginning_of_line(void) +{ fputs(CSI "1K", stdout); } -void move_cursor_to_column(int count) { +void move_cursor_to_column(int count) +{ char buffer[10]; memset(buffer,0,sizeof(buffer)); sprintf(buffer, CSI "%dG", count); fputs(buffer, stdout); } -void move_cursor_to_next_line() { +void move_cursor_to_next_line(void) +{ fputs("\033e", stdout); } -void disable_utf8() { +void disable_utf8(void) +{ fputs("\033%@", stdout); } -void set_g1_special_char(){ +void set_g1_special_char(void){ fputs("\033)0", stdout); } -void set_us_g0_charset() { +void set_us_g0_charset(void) +{ fputs("\033(B\1#0", stdout); } -void clear_entire_screen() { +void clear_entire_screen(void) +{ fputs(CSI "2J", stdout); } @@ -186,7 +196,7 @@ void cls(void) cprint_vga2ansi('0', '0'); } -void reset_colors() +void reset_colors(void) { csprint(CSI "1D", 0x07); } diff --git a/com32/lib/sys/vesaserial_write.c b/com32/lib/sys/vesaserial_write.c index 47527c3a..775ca19e 100644 --- a/com32/lib/sys/vesaserial_write.c +++ b/com32/lib/sys/vesaserial_write.c @@ -38,7 +38,7 @@ #include <console.h> #include "file.h" -extern int __vesacon_open(void); +extern int __vesacon_open(struct file_info *); extern int __vesacon_close(struct file_info *); extern ssize_t __vesacon_write(struct file_info *, const void *, size_t); extern ssize_t __xserial_write(struct file_info *, const void *, size_t); diff --git a/com32/lib/syslinux/getadv.c b/com32/lib/syslinux/getadv.c index 456084b0..5578313e 100644 --- a/com32/lib/syslinux/getadv.c +++ b/com32/lib/syslinux/getadv.c @@ -39,7 +39,7 @@ const void *syslinux_getadv(int tag, size_t * size) { const uint8_t *p; - size_t left, len; + size_t left; p = syslinux_adv_ptr(); left = syslinux_adv_size(); diff --git a/com32/lib/zlib/crc32.c b/com32/lib/zlib/crc32.c index 447f138e..67e6f31e 100644 --- a/com32/lib/zlib/crc32.c +++ b/com32/lib/zlib/crc32.c @@ -100,7 +100,7 @@ local void make_crc_table() /* make exclusive-or pattern from polynomial (0xedb88320UL) */ poly = 0UL; - for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) + for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++) poly |= 1UL << (31 - p[n]); /* generate a crc for every 8-bit value */ diff --git a/com32/modules/chain.c b/com32/modules/chain.c index da64707f..2dd80746 100644 --- a/com32/modules/chain.c +++ b/com32/modules/chain.c @@ -781,7 +781,6 @@ int main(int argc, char *argv[]) regs.ebx.b[0] = regs.edx.b[0] = drive; whichpart = 0; /* Default */ - if (partition) whichpart = strtoul(partition, NULL, 0); @@ -789,6 +788,14 @@ int main(int argc, char *argv[]) error("Warning: Partitions of floppy devices may not work\n"); } + /* + * grldr of Grub4dos wants the partition number in DH: + * -1: whole drive (default) + * 0-3: primary partitions + * 4-*: logical partitions + */ + regs.edx.b[1] = whichpart-1; + /* Get the disk geometry and disk access setup */ if (get_disk_params(drive)) { error("Cannot get disk parameters\n"); diff --git a/com32/rosh/MCONFIG b/com32/rosh/MCONFIG index 30029d15..25c41396 100644 --- a/com32/rosh/MCONFIG +++ b/com32/rosh/MCONFIG @@ -17,11 +17,11 @@ ## Include the COM32 common configurables include ../MCONFIG -# CFLAGS = $(GCCOPT) -W -Wall -march=i386 \ +# CFLAGS = $(GCCOPT) $(GCCWARN) -march=i386 \ # -fomit-frame-pointer -D__COM32__ \ # -nostdinc -iwithprefix include \ # -I$(com32)/libutil/include -I$(com32)/include # -g3 -dD -# LNXCFLAGS = -I$(com32)/libutil/include -W -Wall -O -g3 -D_GNU_SOURCE -dD +# LNXCFLAGS = -I$(com32)/libutil/include $(GCCWARN) -O -g3 -D_GNU_SOURCE -dD # -U__GNUC__ diff --git a/com32/rosh/rosh.c b/com32/rosh/rosh.c index 2221bb0a..13e8ffbd 100644 --- a/com32/rosh/rosh.c +++ b/com32/rosh/rosh.c @@ -37,7 +37,7 @@ #define APP_YEAR "2008" #define APP_VER "beta-b032" -void rosh_version() +void rosh_version(void) { printf("%s v %s; (c) %s %s.\n", APP_LONGNAME, APP_VER, APP_YEAR, APP_AUTHOR); @@ -224,7 +224,7 @@ void rosh_print_tc(struct termios *tio) * Switches console over to raw input mode. Allows get_key to get just * 1 key sequence (without delay or display) */ -void rosh_console_raw() +void rosh_console_raw(void) { // struct termios itio, ntio; // tcgetattr(0, &itio); @@ -241,7 +241,7 @@ void rosh_console_raw() /* * Switches back to standard getline mode. */ -void rosh_console_std() +void rosh_console_std(void) { // struct termios itio, ntio; console_ansi_std(); @@ -252,7 +252,7 @@ void rosh_console_std() * Attempts to get a single key from the console * returns key pressed */ -int rosh_getkey() +int rosh_getkey(void) { int inc; diff --git a/extlinux/Makefile b/extlinux/Makefile index 48105338..23ffd400 100644 --- a/extlinux/Makefile +++ b/extlinux/Makefile @@ -19,7 +19,7 @@ include $(topdir)/MCONFIG OPTFLAGS = -g -Os INCLUDES = -I. -I.. -I../libinstaller -CFLAGS = -W -Wall -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \ +CFLAGS = $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \ $(OPTFLAGS) $(INCLUDES) LDFLAGS = # -s diff --git a/linux/Makefile b/linux/Makefile index a469cefd..8872c0fc 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -19,7 +19,7 @@ include $(topdir)/MCONFIG OPTFLAGS = -g -Os INCLUDES = -I. -I.. -I../libinstaller -CFLAGS = -W -Wall -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) +CFLAGS = $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) LDFLAGS = -s SRCS = syslinux.c \ diff --git a/memdisk/Makefile b/memdisk/Makefile index 09f17c8e..2e6330f9 100644 --- a/memdisk/Makefile +++ b/memdisk/Makefile @@ -91,7 +91,7 @@ memdisk: memdisk16.bin memdisk32.bin postprocess.pl $(PERL) postprocess.pl $@ memdisk16.bin memdisk32.bin e820test: e820test.c e820func.c msetup.c - $(CC) -m32 -g -W -Wall -DTEST -o $@ $^ + $(CC) -m32 -g $(GCCWARN) -DTEST -o $@ $^ # This file contains the version number, so add a dependency for it setup.s: ../version diff --git a/memdisk/inflate.c b/memdisk/inflate.c index 30df244d..e7825f0c 100644 --- a/memdisk/inflate.c +++ b/memdisk/inflate.c @@ -998,7 +998,7 @@ static void makecrc(void) /* * Do the uncompression! */ -int gunzip() +int gunzip(void) { int res; diff --git a/mtools/Makefile b/mtools/Makefile index b5517805..91b68527 100644 --- a/mtools/Makefile +++ b/mtools/Makefile @@ -3,7 +3,7 @@ include $(topdir)/MCONFIG OPTFLAGS = -g -Os INCLUDES = -I. -I.. -I../libfat -I../libinstaller -CFLAGS = -W -Wall -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) +CFLAGS = $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) LDFLAGS = -s SRCS = syslinux.c \ diff --git a/utils/Makefile b/utils/Makefile index 39adf7d3..7fdf631d 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -17,7 +17,7 @@ topdir = .. include $(topdir)/MCONFIG -CFLAGS = -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 +CFLAGS = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 LDFLAGS = -O2 -s TARGETS = mkdiskimage isohybrid gethostip diff --git a/win32/Makefile b/win32/Makefile index 964b74c5..a0be1d46 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -21,7 +21,7 @@ OSTYPE = $(shell uname -msr) ifeq ($(findstring CYGWIN,$(OSTYPE)),CYGWIN) ## Compiling on Cygwin WINPREFIX := -WINCFLAGS := -mno-cygwin -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 +WINCFLAGS := -mno-cygwin $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 WINLDFLAGS := -mno-cygwin -Os -s else ## Compiling on some variant of MinGW @@ -30,7 +30,7 @@ WINPREFIX := else WINPREFIX := $(shell ./find-mingw.sh gcc) endif -WINCFLAGS := -W -Wall -Wno-sign-compare -Os -fomit-frame-pointer \ +WINCFLAGS := $(GCCWARN) -Wno-sign-compare -Os -fomit-frame-pointer \ -D_FILE_OFFSET_BITS=64 WINLDFLAGS := -Os -s endif |