aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-01-06 21:26:44 -0800
committerH. Peter Anvin <hpa@zytor.com>2010-01-06 21:26:44 -0800
commitb2c00eb47e4af30b1822af3f66744bfde755c87f (patch)
treed138935c1c001d6a7109a724fa0202bc19a9bc9d
parent85c9fa1a8144edc6264bef88f5a283a4073988b9 (diff)
downloadsyslinux.git-b2c00eb47e4af30b1822af3f66744bfde755c87f.tar.gz
syslinux.git-b2c00eb47e4af30b1822af3f66744bfde755c87f.tar.xz
syslinux.git-b2c00eb47e4af30b1822af3f66744bfde755c87f.zip
Change () prototypes to (void)
() means the same as (...) in C, not the same as (void) as it does in C++. It is generally misused to mean (void), though. Actually write what we mean... this is C, after all. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--com32/cmenu/complex.c2
-rw-r--r--com32/cmenu/libmenu/menu.c10
-rw-r--r--com32/cmenu/libmenu/menu.h8
-rw-r--r--com32/gfxboot/gfxboot.c8
-rw-r--r--com32/hdt/hdt-cli.c6
-rw-r--r--com32/hdt/hdt-cli.h2
-rw-r--r--com32/hdt/hdt-common.c2
-rw-r--r--com32/hdt/hdt-common.h2
-rw-r--r--com32/hdt/hdt-menu.c2
-rw-r--r--com32/hdt/hdt-menu.h2
-rw-r--r--com32/lib/sys/libansi.c34
-rw-r--r--com32/rosh/rosh.c8
12 files changed, 48 insertions, 38 deletions
diff --git a/com32/cmenu/complex.c b/com32/cmenu/complex.c
index 1ac51997..6013e722 100644
--- a/com32/cmenu/complex.c
+++ b/com32/cmenu/complex.c
@@ -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/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/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/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/rosh/rosh.c b/com32/rosh/rosh.c
index 9a4edae2..720d8644 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;