From 68c2f638e65d914dc6e84eb7ce2624f08af525c0 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 30 Jan 2016 17:24:07 +0100 Subject: patch 7.4.1208 Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi) --- src/gui_photon.c | 15 +- src/gui_w32.c | 54 +++----- src/gui_w48.c | 15 +- src/gui_x11.c | 404 +++++++++++++++++++++++------------------------------- src/hangulin.c | 84 ++++-------- src/hardcopy.c | 313 ++++++++++++++++-------------------------- src/hashtab.c | 64 +++------ src/if_cscope.c | 203 ++++++++++++--------------- src/if_mzsch.c | 2 +- src/if_perlsfio.c | 12 +- src/if_python.c | 4 +- src/if_python3.c | 6 +- src/if_ruby.c | 19 ++- src/if_sniff.c | 59 +++----- src/if_tcl.c | 247 +++++++++++++++------------------ src/if_xcmdsrv.c | 159 ++++++++++----------- src/integration.c | 6 +- src/version.c | 2 + 18 files changed, 687 insertions(+), 981 deletions(-) diff --git a/src/gui_photon.c b/src/gui_photon.c index aa99dd74af..67ddc628a3 100644 --- a/src/gui_photon.c +++ b/src/gui_photon.c @@ -1111,9 +1111,7 @@ gui_ph_encoding_changed(int new_encoding) /****************************************************************************/ void -gui_mch_prepare(argc, argv) - int *argc; - char **argv; +gui_mch_prepare(int *argc, char **argv) { PtInit(NULL); } @@ -1720,7 +1718,7 @@ gui_mch_iconify(void) * Bring the Vim window to the foreground. */ void -gui_mch_set_foreground() +gui_mch_set_foreground(void) { PhWindowEvent_t event; @@ -1860,8 +1858,7 @@ static int mshape_ids[] = }; void -mch_set_mouse_shape(shape) - int shape; +mch_set_mouse_shape(int shape) { int id; @@ -2184,7 +2181,7 @@ gui_mch_clear_block(int row1, int col1, int row2, int col2) } void -gui_mch_clear_all() +gui_mch_clear_all(void) { PhRect_t text_rect = { { gui.border_width, gui.border_width }, @@ -3078,9 +3075,7 @@ gui_mch_get_font(char_u *vim_font_name, int report_error) * Don't know how to get the actual name, thus use the provided name. */ char_u * -gui_mch_get_fontname(font, name) - GuiFont font; - char_u *name; +gui_mch_get_fontname(GuiFont font, char_u *name) { if (name == NULL) return NULL; diff --git a/src/gui_w32.c b/src/gui_w32.c index 5fce6e06d5..6a0e0a3594 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -2246,7 +2246,7 @@ im_set_active(int active) * Get IM status. When IM is on, return not 0. Else return 0. */ int -im_get_status() +im_get_status(void) { int status = 0; HIMC hImc; @@ -4525,10 +4525,7 @@ typedef struct _signicon_t } signicon_t; void -gui_mch_drawsign(row, col, typenr) - int row; - int col; - int typenr; +gui_mch_drawsign(int row, int col, int typenr) { signicon_t *sign; int x, y, w, h; @@ -4605,8 +4602,7 @@ close_signicon_image(signicon_t *sign) } void * -gui_mch_register_sign(signfile) - char_u *signfile; +gui_mch_register_sign(char_u *signfile) { signicon_t sign, *psign; char_u *ext; @@ -4661,8 +4657,7 @@ gui_mch_register_sign(signfile) } void -gui_mch_destroy_sign(sign) - void *sign; +gui_mch_destroy_sign(void *sign) { if (sign) { @@ -4766,10 +4761,7 @@ multiline_balloon_available(void) } static void -make_tooltip(beval, text, pt) - BalloonEval *beval; - char *text; - POINT pt; +make_tooltip(BalloonEval *beval, char *text, POINT pt) { TOOLINFO *pti; int ToolInfoSize; @@ -4833,19 +4825,18 @@ make_tooltip(beval, text, pt) } static void -delete_tooltip(beval) - BalloonEval *beval; +delete_tooltip(BalloonEval *beval) { PostMessage(beval->balloon, WM_CLOSE, 0, 0); } /*ARGSUSED*/ static VOID CALLBACK -BevalTimerProc(hwnd, uMsg, idEvent, dwTime) - HWND hwnd; - UINT uMsg; - UINT_PTR idEvent; - DWORD dwTime; +BevalTimerProc( + HWND hwnd, + UINT uMsg, + UINT_PTR idEvent, + DWORD dwTime) { POINT pt; RECT rect; @@ -4883,8 +4874,7 @@ BevalTimerProc(hwnd, uMsg, idEvent, dwTime) /*ARGSUSED*/ void -gui_mch_disable_beval_area(beval) - BalloonEval *beval; +gui_mch_disable_beval_area(BalloonEval *beval) { // TRACE0("gui_mch_disable_beval_area {{{"); KillTimer(s_textArea, BevalTimerId); @@ -4893,8 +4883,7 @@ gui_mch_disable_beval_area(beval) /*ARGSUSED*/ void -gui_mch_enable_beval_area(beval) - BalloonEval *beval; +gui_mch_enable_beval_area(BalloonEval *beval) { // TRACE0("gui_mch_enable_beval_area |||"); if (beval == NULL) @@ -4905,9 +4894,7 @@ gui_mch_enable_beval_area(beval) } void -gui_mch_post_balloon(beval, mesg) - BalloonEval *beval; - char_u *mesg; +gui_mch_post_balloon(BalloonEval *beval, char_u *mesg) { POINT pt; // TRACE0("gui_mch_post_balloon {{{"); @@ -4928,11 +4915,11 @@ gui_mch_post_balloon(beval, mesg) /*ARGSUSED*/ BalloonEval * -gui_mch_create_beval_area(target, mesg, mesgCB, clientData) - void *target; /* ignored, always use s_textArea */ - char_u *mesg; - void (*mesgCB)(BalloonEval *, int); - void *clientData; +gui_mch_create_beval_area( + void *target, /* ignored, always use s_textArea */ + char_u *mesg, + void (*mesgCB)(BalloonEval *, int), + void *clientData) { /* partially stolen from gui_beval.c */ BalloonEval *beval; @@ -5010,8 +4997,7 @@ TrackUserActivity(UINT uMsg) } void -gui_mch_destroy_beval_area(beval) - BalloonEval *beval; +gui_mch_destroy_beval_area(BalloonEval *beval) { vim_free(beval); } diff --git a/src/gui_w48.c b/src/gui_w48.c index dfcc288b2f..7789ef26fd 100644 --- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -1144,7 +1144,7 @@ gui_mch_new_colors(void) * Set the colors to their default values. */ void -gui_mch_def_colors() +gui_mch_def_colors(void) { gui.norm_pixel = GetSysColor(COLOR_WINDOWTEXT); gui.back_pixel = GetSysColor(COLOR_WINDOW); @@ -1390,9 +1390,7 @@ gui_mch_get_font( */ /*ARGSUSED*/ char_u * -gui_mch_get_fontname(font, name) - GuiFont font; - char_u *name; +gui_mch_get_fontname(GuiFont font, char_u *name) { if (name == NULL) return NULL; @@ -2623,8 +2621,7 @@ gui_mch_update_tabline(void) * Set the current tab to "nr". First tab is 1. */ void -gui_mch_set_curtab(nr) - int nr; +gui_mch_set_curtab(int nr) { if (s_tabhwnd == NULL) return; @@ -3258,7 +3255,7 @@ update_im_font(void) * Handler of gui.wide_font (p_guifontwide) changed notification. */ void -gui_mch_wide_font_changed() +gui_mch_wide_font_changed(void) { # ifndef MSWIN16_FASTTEXT LOGFONT lf; @@ -3385,7 +3382,7 @@ gui_mch_init_font(char_u *font_name, int fontset) * Return TRUE if the GUI window is maximized, filling the whole screen. */ int -gui_mch_maximized() +gui_mch_maximized(void) { WINDOWPLACEMENT wp; @@ -3403,7 +3400,7 @@ gui_mch_maximized() * new Rows and Columns. This is like resizing the window. */ void -gui_mch_newfont() +gui_mch_newfont(void) { RECT rect; diff --git a/src/gui_x11.c b/src/gui_x11.c index 01e9394b8a..af3c3a919d 100644 --- a/src/gui_x11.c +++ b/src/gui_x11.c @@ -571,19 +571,19 @@ static char **gui_argv = NULL; */ static void -gui_x11_timer_cb(timed_out, interval_id) - XtPointer timed_out; - XtIntervalId *interval_id UNUSED; +gui_x11_timer_cb( + XtPointer timed_out, + XtIntervalId *interval_id UNUSED) { *((int *)timed_out) = TRUE; } static void -gui_x11_visibility_cb(w, dud, event, dum) - Widget w UNUSED; - XtPointer dud UNUSED; - XEvent *event; - Boolean *dum UNUSED; +gui_x11_visibility_cb( + Widget w UNUSED, + XtPointer dud UNUSED, + XEvent *event, + Boolean *dum UNUSED) { if (event->type != VisibilityNotify) return; @@ -602,11 +602,11 @@ gui_x11_visibility_cb(w, dud, event, dum) } static void -gui_x11_expose_cb(w, dud, event, dum) - Widget w UNUSED; - XtPointer dud UNUSED; - XEvent *event; - Boolean *dum UNUSED; +gui_x11_expose_cb( + Widget w UNUSED, + XtPointer dud UNUSED, + XEvent *event, + Boolean *dum UNUSED) { XExposeEvent *gevent; int new_x; @@ -678,11 +678,11 @@ shellRectangle(Widget shell, XRectangle *r) #endif static void -gui_x11_resize_window_cb(w, dud, event, dum) - Widget w UNUSED; - XtPointer dud UNUSED; - XEvent *event; - Boolean *dum UNUSED; +gui_x11_resize_window_cb( + Widget w UNUSED, + XtPointer dud UNUSED, + XEvent *event, + Boolean *dum UNUSED) { static int lastWidth, lastHeight; @@ -724,31 +724,31 @@ gui_x11_resize_window_cb(w, dud, event, dum) } static void -gui_x11_focus_change_cb(w, data, event, dum) - Widget w UNUSED; - XtPointer data UNUSED; - XEvent *event; - Boolean *dum UNUSED; +gui_x11_focus_change_cb( + Widget w UNUSED, + XtPointer data UNUSED, + XEvent *event, + Boolean *dum UNUSED) { gui_focus_change(event->type == FocusIn); } static void -gui_x11_enter_cb(w, data, event, dum) - Widget w UNUSED; - XtPointer data UNUSED; - XEvent *event UNUSED; - Boolean *dum UNUSED; +gui_x11_enter_cb( + Widget w UNUSED, + XtPointer data UNUSED, + XEvent *event UNUSED, + Boolean *dum UNUSED) { gui_focus_change(TRUE); } static void -gui_x11_leave_cb(w, data, event, dum) - Widget w UNUSED; - XtPointer data UNUSED; - XEvent *event UNUSED; - Boolean *dum UNUSED; +gui_x11_leave_cb( + Widget w UNUSED, + XtPointer data UNUSED, + XEvent *event UNUSED, + Boolean *dum UNUSED) { gui_focus_change(FALSE); } @@ -760,11 +760,11 @@ gui_x11_leave_cb(w, data, event, dum) #endif void -gui_x11_key_hit_cb(w, dud, event, dum) - Widget w UNUSED; - XtPointer dud UNUSED; - XEvent *event; - Boolean *dum UNUSED; +gui_x11_key_hit_cb( + Widget w UNUSED, + XtPointer dud UNUSED, + XEvent *event, + Boolean *dum UNUSED) { XKeyPressedEvent *ev_press; #ifdef FEAT_XIM @@ -1071,11 +1071,11 @@ theend: } static void -gui_x11_mouse_cb(w, dud, event, dum) - Widget w UNUSED; - XtPointer dud UNUSED; - XEvent *event; - Boolean *dum UNUSED; +gui_x11_mouse_cb( + Widget w UNUSED, + XtPointer dud UNUSED, + XEvent *event, + Boolean *dum UNUSED) { static XtIntervalId timer = (XtIntervalId)0; static int timed_out = TRUE; @@ -1166,10 +1166,10 @@ gui_x11_mouse_cb(w, dud, event, dum) #ifdef FEAT_SNIFF /* ARGSUSED */ static void -gui_x11_sniff_request_cb(closure, source, id) - XtPointer closure UNUSED; - int *source UNUSED; - XtInputId *id UNUSED; +gui_x11_sniff_request_cb( + XtPointer closure UNUSED, + int *source UNUSED, + XtInputId *id UNUSED) { static char_u bytes[3] = {CSI, (int)KS_EXTRA, (int)KE_SNIFF}; @@ -1187,9 +1187,7 @@ gui_x11_sniff_request_cb(closure, source, id) * when vim is started, whether or not the GUI has been started. */ void -gui_mch_prepare(argc, argv) - int *argc; - char **argv; +gui_mch_prepare(int *argc, char **argv) { int arg; int i; @@ -1285,7 +1283,7 @@ gui_mch_prepare(argc, argv) * Return OK or FAIL. */ int -gui_mch_init_check() +gui_mch_init_check(void) { #ifdef FEAT_XIM XtSetLanguageProc(NULL, NULL, NULL); @@ -1315,10 +1313,10 @@ static XtInputId _xsmp_xtinputid; static void local_xsmp_handle_requests(XtPointer c, int *s, XtInputId *i); static void -local_xsmp_handle_requests(c, s, i) - XtPointer c UNUSED; - int *s UNUSED; - XtInputId *i UNUSED; +local_xsmp_handle_requests( + XtPointer c UNUSED, + int *s UNUSED, + XtInputId *i UNUSED) { if (xsmp_handle_requests() == FAIL) XtRemoveInput(_xsmp_xtinputid); @@ -1331,7 +1329,7 @@ local_xsmp_handle_requests(c, s, i) * Returns OK for success, FAIL when the GUI can't be started. */ int -gui_mch_init() +gui_mch_init(void) { XtGCMask gc_mask; XGCValues gc_vals; @@ -1575,7 +1573,7 @@ gui_mch_init() * Called when starting the GUI fails after calling gui_mch_init(). */ void -gui_mch_uninit() +gui_mch_uninit(void) { gui_x11_destroy_widgets(); XtCloseDisplay(gui.dpy); @@ -1589,7 +1587,7 @@ gui_mch_uninit() * Called when the foreground or background color has been changed. */ void -gui_mch_new_colors() +gui_mch_new_colors(void) { long_u gc_mask; XGCValues gc_vals; @@ -1619,7 +1617,7 @@ gui_mch_new_colors() * Open the GUI window which was created by a call to gui_mch_init(). */ int -gui_mch_open() +gui_mch_open(void) { /* Actually open the window */ XtRealizeWidget(vimShell); @@ -1700,7 +1698,7 @@ gui_mch_open() * Convert the tooltip fontset name to an XFontSet. */ void -gui_init_tooltip_font() +gui_init_tooltip_font(void) { XrmValue from, to; @@ -1719,7 +1717,7 @@ gui_init_tooltip_font() #if defined(FEAT_MENU) || defined(PROTO) /* Convert the menu font/fontset name to an XFontStruct/XFontset */ void -gui_init_menu_font() +gui_init_menu_font(void) { XrmValue from, to; @@ -1748,8 +1746,7 @@ gui_init_menu_font() #endif void -gui_mch_exit(rc) - int rc UNUSED; +gui_mch_exit(int rc UNUSED) { #if 0 /* Lesstif gives an error message here, and so does Solaris. The man page @@ -1764,8 +1761,7 @@ gui_mch_exit(rc) * Get the position of the top left corner of the window. */ int -gui_mch_get_winpos(x, y) - int *x, *y; +gui_mch_get_winpos(int *x, *y) { Dimension xpos, ypos; @@ -1783,8 +1779,7 @@ gui_mch_get_winpos(x, y) * coordinates. */ void -gui_mch_set_winpos(x, y) - int x, y; +gui_mch_set_winpos(int x, y) { XtVaSetValues(vimShell, XtNx, x, @@ -1793,15 +1788,14 @@ gui_mch_set_winpos(x, y) } void -gui_mch_set_shellsize(width, height, min_width, min_height, - base_width, base_height, direction) - int width; - int height; - int min_width; - int min_height; - int base_width; - int base_height; - int direction UNUSED; +gui_mch_set_shellsize( + int width, + int height, + int min_width, + int min_height, + int base_width, + int base_height, + int direction UNUSED) { #ifdef FEAT_XIM height += xim_get_status_area_height(), @@ -1825,9 +1819,9 @@ gui_mch_set_shellsize(width, height, min_width, min_height, * Is there no way in X to find out how wide the borders really are? */ void -gui_mch_get_screen_dimensions(screen_w, screen_h) - int *screen_w; - int *screen_h; +gui_mch_get_screen_dimensions( + int *screen_w, + int *screen_h) { *screen_w = DisplayWidth(gui.dpy, DefaultScreen(gui.dpy)) - 10; *screen_h = DisplayHeight(gui.dpy, DefaultScreen(gui.dpy)) - p_ghr; @@ -1840,9 +1834,9 @@ gui_mch_get_screen_dimensions(screen_w, screen_h) * Return FAIL if the font could not be loaded, OK otherwise. */ int -gui_mch_init_font(font_name, do_fontset) - char_u *font_name; - int do_fontset UNUSED; +gui_mch_init_font( + char_u *font_name, + int do_fontset UNUSED) { XFontStruct *font = NULL; @@ -1970,9 +1964,7 @@ gui_mch_init_font(font_name, do_fontset) * Get a font structure for highlighting. */ GuiFont -gui_mch_get_font(name, giveErrorIfMissing) - char_u *name; - int giveErrorIfMissing; +gui_mch_get_font(char_u *name, int giveErrorIfMissing) { XFontStruct *font; @@ -2021,9 +2013,7 @@ gui_mch_get_font(name, giveErrorIfMissing) * Don't know how to get the actual name, thus use the provided name. */ char_u * -gui_mch_get_fontname(font, name) - GuiFont font UNUSED; - char_u *name; +gui_mch_get_fontname(GuiFont font UNUSED, char_u *name) { if (name == NULL) return NULL; @@ -2035,7 +2025,7 @@ gui_mch_get_fontname(font, name) * Adjust gui.char_height (after 'linespace' was changed). */ int -gui_mch_adjust_charheight() +gui_mch_adjust_charheight(void) { #ifdef FEAT_XFONTSET if (gui.fontset != NOFONTSET) @@ -2059,8 +2049,7 @@ gui_mch_adjust_charheight() * Set the current text font. */ void -gui_mch_set_font(font) - GuiFont font; +gui_mch_set_font(GuiFont font) { static Font prev_font = (Font)-1; Font fid = ((XFontStruct *)font)->fid; @@ -2083,8 +2072,7 @@ gui_mch_set_font(font) * Adjust the ascent, in case it's different. */ void -gui_mch_set_fontset(fontset) - GuiFontset fontset; +gui_mch_set_fontset(GuiFontset fontset) { current_fontset = (XFontSet)fontset; gui.char_ascent = fontset_ascent(current_fontset) + p_linespace / 2; @@ -2095,8 +2083,7 @@ gui_mch_set_fontset(fontset) * If a font is not going to be used, free its structure. */ void -gui_mch_free_font(font) - GuiFont font; +gui_mch_free_font(GuiFont font) { if (font != NOFONT) XFreeFont(gui.dpy, (XFontStruct *)font); @@ -2107,8 +2094,7 @@ gui_mch_free_font(font) * If a fontset is not going to be used, free its structure. */ void -gui_mch_free_fontset(fontset) - GuiFontset fontset; +gui_mch_free_fontset(GuiFontset fontset) { if (fontset != NOFONTSET) XFreeFontSet(gui.dpy, (XFontSet)fontset); @@ -2119,10 +2105,10 @@ gui_mch_free_fontset(fontset) * Return a reference to the fontset, or NOFONTSET when failing. */ GuiFontset -gui_mch_get_fontset(name, giveErrorIfMissing, fixed_width) - char_u *name; - int giveErrorIfMissing; - int fixed_width; +gui_mch_get_fontset( + char_u *name, + int giveErrorIfMissing, + int fixed_width) { XFontSet fontset; char **missing, *def_str; @@ -2165,8 +2151,7 @@ gui_mch_get_fontset(name, giveErrorIfMissing, fixed_width) * Check if fontset "fs" is fixed width. */ static int -check_fontset_sanity(fs) - XFontSet fs; +check_fontset_sanity(XFontSet fs) { XFontStruct **xfs; char **font_name; @@ -2216,15 +2201,14 @@ check_fontset_sanity(fs) } static int -fontset_width(fs) - XFontSet fs; +fontset_width(XFontSet fs) { - return XmbTextEscapement(fs, "Vim", 3) / 3; + return XmbTextEscapement(fs, "Vim", 3) / 3; } int -fontset_height(fs) - XFontSet fs; +fontset_height( + XFontSet fs) { XFontSetExtents *extents; @@ -2239,8 +2223,7 @@ fontset_height(fs) * characters in all fonts of the fontset. */ int -fontset_height2(fs) - XFontSet fs; +fontset_height2(XFontSet fs) { XFontSetExtents *extents; @@ -2262,8 +2245,7 @@ fontset_descent(fs) */ static int -fontset_ascent(fs) - XFontSet fs; +fontset_ascent(XFontSet fs) { XFontSetExtents *extents; @@ -2278,8 +2260,7 @@ fontset_ascent(fs) * Return INVALCOLOR for error. */ guicolor_T -gui_mch_get_color(reqname) - char_u *reqname; +gui_mch_get_color(char_u *reqname) { int i; char_u *name = reqname; @@ -2382,9 +2363,7 @@ gui_mch_get_color(reqname) * Return FAIL if not able to find or allocate a color. */ static int -find_closest_color(colormap, colorPtr) - Colormap colormap; - XColor *colorPtr; +find_closest_color(Colormap colormap, XColor *colorPtr) { double tmp, distance, closestDistance; int i, closest, numFound, cmap_size; @@ -2452,8 +2431,7 @@ find_closest_color(colormap, colorPtr) * Set the current text foreground color. */ void -gui_mch_set_fg_color(color) - guicolor_T color; +gui_mch_set_fg_color(guicolor_T color) { if (color != prev_fg_color) { @@ -2466,8 +2444,7 @@ gui_mch_set_fg_color(color) * Set the current text background color. */ void -gui_mch_set_bg_color(color) - guicolor_T color; +gui_mch_set_bg_color(guicolor_T color) { if (color != prev_bg_color) { @@ -2480,8 +2457,7 @@ gui_mch_set_bg_color(color) * Set the current text special color. */ void -gui_mch_set_sp_color(color) - guicolor_T color; +gui_mch_set_sp_color(guicolor_T color) { prev_sp_color = color; } @@ -2490,7 +2466,7 @@ gui_mch_set_sp_color(color) * create a mouse pointer that is blank */ static Cursor -gui_x11_create_blank_mouse() +gui_x11_create_blank_mouse(void) { Pixmap blank_pixmap = XCreatePixmap(gui.dpy, gui.wid, 1, 1, 1); GC gc = XCreateGC(gui.dpy, blank_pixmap, (unsigned long)0, (XGCValues*)0); @@ -2504,10 +2480,7 @@ gui_x11_create_blank_mouse() * Draw a curled line at the bottom of the character cell. */ static void -draw_curl(row, col, cells) - int row; - int col; - int cells; +draw_curl(int row, int col, int cells) { int i; int offset; @@ -2524,12 +2497,12 @@ draw_curl(row, col, cells) } void -gui_mch_draw_string(row, col, s, len, flags) - int row; - int col; - char_u *s; - int len; - int flags; +gui_mch_draw_string( + int row, + int col, + char_u *s, + int len, + int flags) { int cells = len; #ifdef FEAT_MBYTE @@ -2691,8 +2664,7 @@ gui_mch_draw_string(row, col, s, len, flags) * Return OK if the key with the termcap name "name" is supported. */ int -gui_mch_haskey(name) - char_u *name; +gui_mch_haskey(char_u *name) { int i; @@ -2707,9 +2679,7 @@ gui_mch_haskey(name) * Return the text window-id and display. Only required for X-based GUI's */ int -gui_get_x11_windis(win, dis) - Window *win; - Display **dis; +gui_get_x11_windis(Window *win, Display **dis) { *win = XtWindow(vimShell); *dis = gui.dpy; @@ -2717,14 +2687,13 @@ gui_get_x11_windis(win, dis) } void -gui_mch_beep() +gui_mch_beep(void) { XBell(gui.dpy, 0); } void -gui_mch_flash(msec) - int msec; +gui_mch_flash(int msec) { /* Do a visual beep by reversing the foreground and background colors */ XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0, @@ -2741,11 +2710,11 @@ gui_mch_flash(msec) * Invert a rectangle from row r, column c, for nr rows and nc columns. */ void -gui_mch_invert_rectangle(r, c, nr, nc) - int r; - int c; - int nr; - int nc; +gui_mch_invert_rectangle( + int r, + int c, + int nr, + int nc) { XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, FILL_X(c), FILL_Y(r), (nc) * gui.char_width, (nr) * gui.char_height); @@ -2755,7 +2724,7 @@ gui_mch_invert_rectangle(r, c, nr, nc) * Iconify the GUI window. */ void -gui_mch_iconify() +gui_mch_iconify(void) { XIconifyWindow(gui.dpy, XtWindow(vimShell), DefaultScreen(gui.dpy)); } @@ -2765,7 +2734,7 @@ gui_mch_iconify() * Bring the Vim window to the foreground. */ void -gui_mch_set_foreground() +gui_mch_set_foreground(void) { XMapRaised(gui.dpy, XtWindow(vimShell)); } @@ -2775,8 +2744,7 @@ gui_mch_set_foreground() * Draw a cursor without focus. */ void -gui_mch_draw_hollow_cursor(color) - guicolor_T color; +gui_mch_draw_hollow_cursor(guicolor_T color) { int w = 1; @@ -2794,10 +2762,7 @@ gui_mch_draw_hollow_cursor(color) * color "color". */ void -gui_mch_draw_part_cursor(w, h, color) - int w; - int h; - guicolor_T color; +gui_mch_draw_part_cursor(int w, int h, guicolor_T color) { gui_mch_set_fg_color(color); @@ -2818,7 +2783,7 @@ gui_mch_draw_part_cursor(w, h, color) * immediately. */ void -gui_mch_update() +gui_mch_update(void) { XtInputMask mask, desired; @@ -2843,8 +2808,7 @@ gui_mch_update() * or FAIL otherwise. */ int -gui_mch_wait_for_chars(wtime) - long wtime; +gui_mch_wait_for_chars(long wtime) { int focus; @@ -2930,7 +2894,7 @@ gui_mch_wait_for_chars(wtime) /* Flush any output to the screen */ void -gui_mch_flush() +gui_mch_flush(void) { XFlush(gui.dpy); } @@ -2940,11 +2904,11 @@ gui_mch_flush() * (row2, col2) inclusive. */ void -gui_mch_clear_block(row1, col1, row2, col2) - int row1; - int col1; - int row2; - int col2; +gui_mch_clear_block( + int row1, + int col1, + int row2, + int col2) { int x; @@ -2958,7 +2922,7 @@ gui_mch_clear_block(row1, col1, row2, col2) } void -gui_mch_clear_all() +gui_mch_clear_all(void) { XClearArea(gui.dpy, gui.wid, 0, 0, 0, 0, False); } @@ -2968,9 +2932,7 @@ gui_mch_clear_all() * text further down within the scroll region. */ void -gui_mch_delete_lines(row, num_lines) - int row; - int num_lines; +gui_mch_delete_lines(int row, int num_lines) { if (gui.visibility == VisibilityFullyObscured) return; /* Can't see the window */ @@ -2995,9 +2957,7 @@ gui_mch_delete_lines(row, num_lines) * following text within the scroll region. */ void -gui_mch_insert_lines(row, num_lines) - int row; - int num_lines; +gui_mch_insert_lines(int row, int num_lines) { if (gui.visibility == VisibilityFullyObscured) return; /* Can't see the window */ @@ -3020,7 +2980,7 @@ gui_mch_insert_lines(row, num_lines) * Update the region revealed by scrolling up/down. */ static void -gui_x11_check_copy_area() +gui_x11_check_copy_area(void) { XEvent event; XGraphicsExposeEvent *gevent; @@ -3052,29 +3012,26 @@ gui_x11_check_copy_area() */ void -clip_mch_lose_selection(cbd) - VimClipboard *cbd; +clip_mch_lose_selection(VimClipboard *cbd) { clip_x11_lose_selection(vimShell, cbd); } int -clip_mch_own_selection(cbd) - VimClipboard *cbd; +clip_mch_own_selection(VimClipboard *cbd) { return clip_x11_own_selection(vimShell, cbd); } void -clip_mch_request_selection(cbd) - VimClipboard *cbd; +clip_mch_request_selection(VimClipboard *cbd) { - clip_x11_request_selection(vimShell, gui.dpy, cbd); + clip_x11_request_selection(vimShell, gui.dpy, cbd); } void -clip_mch_set_selection(cbd) - VimClipboard *cbd; +clip_mch_set_selection( + VimClipboard *cbd) { clip_x11_set_selection(cbd); } @@ -3088,9 +3045,7 @@ clip_mch_set_selection(cbd) * Make a menu either grey or not grey. */ void -gui_mch_menu_grey(menu, grey) - vimmenu_T *menu; - int grey; +gui_mch_menu_grey(vimmenu_T *menu, int grey) { if (menu->id != (Widget)0) { @@ -3110,9 +3065,7 @@ gui_mch_menu_grey(menu, grey) * Make menu item hidden or not hidden */ void -gui_mch_menu_hidden(menu, hidden) - vimmenu_T *menu; - int hidden; +gui_mch_menu_hidden(vimmenu_T *menu, int hidden) { if (menu->id != (Widget)0) { @@ -3127,16 +3080,16 @@ gui_mch_menu_hidden(menu, hidden) * This is called after setting all the menus to grey/hidden or not. */ void -gui_mch_draw_menubar() +gui_mch_draw_menubar(void) { /* Nothing to do in X */ } void -gui_x11_menu_cb(w, client_data, call_data) - Widget w UNUSED; - XtPointer client_data; - XtPointer call_data UNUSED; +gui_x11_menu_cb( + Widget w UNUSED, + XtPointer client_data, + XtPointer call_data UNUSED) { gui_menu_cb((vimmenu_T *)client_data); } @@ -3150,11 +3103,11 @@ gui_x11_menu_cb(w, client_data, call_data) * Should put up a requester! */ static void -gui_x11_wm_protocol_handler(w, client_data, event, dum) - Widget w UNUSED; - XtPointer client_data UNUSED; - XEvent *event; - Boolean *dum UNUSED; +gui_x11_wm_protocol_handler( + Widget w UNUSED, + XtPointer client_data UNUSED, + XEvent *event, + Boolean *dum UNUSED) { /* * Only deal with Client messages. @@ -3192,11 +3145,11 @@ gui_x11_wm_protocol_handler(w, client_data, event, dum) * Function called when property changed. Check for incoming commands */ static void -gui_x11_send_event_handler(w, client_data, event, dum) - Widget w UNUSED; - XtPointer client_data UNUSED; - XEvent *event; - Boolean *dum UNUSED; +gui_x11_send_event_handler( + Widget w UNUSED, + XtPointer client_data UNUSED, + XEvent *event, + Boolean *dum UNUSED) { XPropertyEvent *e = (XPropertyEvent *) event; @@ -3228,8 +3181,7 @@ static long_u blink_offtime = 250; static XtIntervalId blink_timer = (XtIntervalId)0; void -gui_mch_set_blinking(waittime, on, off) - long waittime, on, off; +gui_mch_set_blinking(long waittime, on, off) { blink_waittime = waittime; blink_ontime = on; @@ -3240,7 +3192,7 @@ gui_mch_set_blinking(waittime, on, off) * Stop the cursor blinking. Show the cursor if it wasn't shown. */ void -gui_mch_stop_blink() +gui_mch_stop_blink(void) { if (blink_timer != (XtIntervalId)0) { @@ -3257,7 +3209,7 @@ gui_mch_stop_blink() * waiting time and shows the cursor. */ void -gui_mch_start_blink() +gui_mch_start_blink(void) { if (blink_timer != (XtIntervalId)0) XtRemoveTimeOut(blink_timer); @@ -3272,9 +3224,9 @@ gui_mch_start_blink() } static void -gui_x11_blink_cb(timed_out, interval_id) - XtPointer timed_out UNUSED; - XtIntervalId *interval_id UNUSED; +gui_x11_blink_cb( + XtPointer timed_out UNUSED, + XtIntervalId *interval_id UNUSED) { if (blink_state == BLINK_ON) { @@ -3296,8 +3248,7 @@ gui_x11_blink_cb(timed_out, interval_id) * Return the RGB value of a pixel as a long. */ long_u -gui_mch_get_rgb(pixel) - guicolor_T pixel; +gui_mch_get_rgb(guicolor_T pixel) { XColor xc; Colormap colormap; @@ -3314,9 +3265,7 @@ gui_mch_get_rgb(pixel) * Add the callback functions. */ void -gui_x11_callbacks(textArea, vimForm) - Widget textArea; - Widget vimForm; +gui_x11_callbacks(Widget textArea, Widget vimForm) { XtAddEventHandler(textArea, VisibilityChangeMask, FALSE, gui_x11_visibility_cb, (XtPointer)0); @@ -3379,9 +3328,7 @@ gui_mch_getmouse(int *x, int *y) } void -gui_mch_setmouse(x, y) - int x; - int y; +gui_mch_setmouse(int x, int y) { if (gui.wid) XWarpPointer(gui.dpy, (Window)0, gui.wid, 0, 0, 0, 0, x, y); @@ -3389,7 +3336,7 @@ gui_mch_setmouse(x, y) #if (defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)) || defined(PROTO) XButtonPressedEvent * -gui_x11_get_last_mouse_event() +gui_x11_get_last_mouse_event(void) { return &last_mouse_event; } @@ -3402,10 +3349,7 @@ gui_x11_get_last_mouse_event() # define SIGN_WIDTH (gui.char_width * 2) void -gui_mch_drawsign(row, col, typenr) - int row; - int col; - int typenr; +gui_mch_drawsign(int row, int col, int typenr) { XImage *sign; @@ -3421,8 +3365,7 @@ gui_mch_drawsign(row, col, typenr) } void * -gui_mch_register_sign(signfile) - char_u *signfile; +gui_mch_register_sign(char_u *signfile) { XpmAttributes attrs; XImage *sign = NULL; @@ -3462,8 +3405,7 @@ gui_mch_register_sign(signfile) } void -gui_mch_destroy_sign(sign) - void *sign; +gui_mch_destroy_sign(void *sign) { XDestroyImage((XImage*)sign); } @@ -3480,8 +3422,8 @@ static int last_shape = 0; * Use the blank mouse pointer or not. */ void -gui_mch_mousehide(hide) - int hide; /* TRUE = use blank ptr, FALSE = use parent ptr */ +gui_mch_mousehide( + int hide) /* TRUE = use blank ptr, FALSE = use parent ptr */ { if (gui.pointer_hidden != hide) { @@ -3523,8 +3465,7 @@ static int mshape_ids[] = }; void -mch_set_mouse_shape(shape) - int shape; +mch_set_mouse_shape(int shape) { int id; @@ -3560,8 +3501,7 @@ mch_set_mouse_shape(shape) * passing a normal menu item here. Can't explain that, but better avoid it. */ void -gui_mch_menu_set_tip(menu) - vimmenu_T *menu; +gui_mch_menu_set_tip(vimmenu_T *menu) { if (menu->id != NULL && menu->parent != NULL && menu_is_toolbar(menu->parent->name)) diff --git a/src/hangulin.c b/src/hangulin.c index 540161ad08..d799305bf6 100644 --- a/src/hangulin.c +++ b/src/hangulin.c @@ -96,9 +96,7 @@ static short_u kind_table_for_3[] = */ static int -comfcon3(v, c) - int v; - int c; +comfcon3(int v, int c) { if (v == 2 && c == 2) return 3; @@ -118,9 +116,7 @@ comfcon3(v, c) */ static int -comvow3(v, c) - int v; - int c; +comvow3(int v, int c) { switch (v) { @@ -159,9 +155,7 @@ comvow3(v, c) */ static int -comcon3(k, c) - int k; - int c; +comcon3(int k, int c) { switch (k) { @@ -217,8 +211,7 @@ comcon3(k, c) /**********************************************************************/ static int -kind_table_for_2(c) - int c; +kind_table_for_2(int c) { static char_u table[] = { @@ -241,8 +234,7 @@ kind_table_for_2(c) * °á°ú: ÃʼºÀÌ ¾Æ´Ï¸é 0 (If it is not initial sound, return 0). */ static int -fcon(c) - int c; +fcon(int c) { static char_u table[] = { @@ -266,8 +258,7 @@ fcon(c) * °á°ú: Áß¼ºÀÌ ¾Æ´Ï¸é 0 (If it is not medial vowel, return 0). */ static int -vow(c) - int c; +vow(int c) { static char_u table[] = { @@ -289,8 +280,7 @@ vow(c) * °á°ú: ¹ÞħÀÌ ¾Æ´Ï¸é 0 (If not prop, return 0) */ static int -lcon(c) - int c; +lcon(int c) { static char_u table[] = { @@ -312,9 +302,7 @@ lcon(c) */ static int -comcon2(k, c) - int k; - int c; +comcon2(int k, int c) { switch (k) { @@ -369,9 +357,7 @@ comcon2(k, c) */ static int -comvow2(v, c) - int v; - int c; +comvow2(int v, int c) { switch (v) { @@ -408,27 +394,26 @@ comvow2(v, c) } int -hangul_input_state_get() +hangul_input_state_get(void) { return hangul_input_state; } void -hangul_input_state_set(state) - int state; +hangul_input_state_set(int state) { hangul_input_state = state; hangul_input_clear(); } int -im_get_status() +im_get_status(void) { return hangul_input_state_get(); } void -hangul_input_state_toggle() +hangul_input_state_toggle(void) { if (hangul_input_state_get()) { @@ -452,9 +437,7 @@ hangul_input_state_toggle() } static int -hangul_automata2(buf, c) - char_u *buf; - int_u *c; +hangul_automata2(char_u *buf, int_u *c) { int t,t2; @@ -614,9 +597,7 @@ hangul_automata2(buf, c) } static int -hangul_automata3(buf, c) - char_u *buf; - int_u *c; +hangul_automata3(char_u *buf, int_u *c) { int t, t2; @@ -725,7 +706,7 @@ hangul_automata3(buf, c) } void -hangul_keyboard_set() +hangul_keyboard_set(void) { int keyboard; char *s; @@ -746,9 +727,7 @@ hangul_keyboard_set() } int -hangul_input_process(s, len) - char_u *s; - int len; +hangul_input_process(char_u *s, int len) { int n; unsigned int c; @@ -831,7 +810,7 @@ hangul_input_process(s, len) } void -hangul_input_clear() +hangul_input_clear(void) { sp = 0; f = F_NULL; @@ -1503,11 +1482,11 @@ static const char_u johab_lcon_to_wan[] = }; static void -convert_ks_to_3(src, fp, mp, lp) - const char_u *src; - int *fp; - int *mp; - int *lp; +convert_ks_to_3( + const char_u *src, + int *fp, + int *mp, + int *lp) { int h = *src; int low = *(src + 1); @@ -1539,11 +1518,11 @@ convert_ks_to_3(src, fp, mp, lp) } static int -convert_3_to_ks(fv, mv, lv, des) - int fv; - int mv; - int lv; - char_u *des; +convert_3_to_ks( + int fv, + int mv, + int lv, + char_u *des) { char_u key[3]; register int hi, lo, mi = 0, result, found; @@ -1621,9 +1600,7 @@ convert_3_to_ks(fv, mv, lv, des) } char_u * -hangul_string_convert(buf, p_len) - char_u *buf; - int *p_len; +hangul_string_convert(char_u *buf, int *p_len) { char_u *tmpbuf = NULL; vimconv_T vc; @@ -1642,8 +1619,7 @@ hangul_string_convert(buf, p_len) } char_u * -hangul_composing_buffer_get(p_len) - int *p_len; +hangul_composing_buffer_get(int *p_len) { char_u *tmpbuf = NULL; diff --git a/src/hardcopy.c b/src/hardcopy.c index 235b46b2fa..b6fa95bebe 100644 --- a/src/hardcopy.c +++ b/src/hardcopy.c @@ -157,7 +157,7 @@ static void prt_get_attr(int hl_id, prt_text_attr_T* pattr, int modec); * Returns an error message or NULL; */ char_u * -parse_printoptions() +parse_printoptions(void) { return parse_list_options(p_popt, printer_opts, OPT_PRINT_NUM_OPTIONS); } @@ -168,7 +168,7 @@ parse_printoptions() * Returns an error message or NULL; */ char_u * -parse_printmbfont() +parse_printmbfont(void) { return parse_list_options(p_pmfn, mbfont_opts, OPT_MBFONT_NUM_OPTIONS); } @@ -184,10 +184,10 @@ parse_printmbfont() * Only used for the printer at the moment... */ static char_u * -parse_list_options(option_str, table, table_size) - char_u *option_str; - option_table_T *table; - int table_size; +parse_list_options( + char_u *option_str, + option_table_T *table, + int table_size) { char_u *stringp; char_u *colonp; @@ -250,8 +250,7 @@ parse_list_options(option_str, table, table_size) * up well on white paper, so reduce their brightness. */ static long_u -darken_rgb(rgb) - long_u rgb; +darken_rgb(long_u rgb) { return ((rgb >> 17) << 16) + (((rgb & 0xff00) >> 9) << 8) @@ -259,8 +258,7 @@ darken_rgb(rgb) } static long_u -prt_get_term_color(colorindex) - int colorindex; +prt_get_term_color(int colorindex) { /* TODO: Should check for xterm with 88 or 256 colors. */ if (t_colors > 8) @@ -269,10 +267,10 @@ prt_get_term_color(colorindex) } static void -prt_get_attr(hl_id, pattr, modec) - int hl_id; - prt_text_attr_T *pattr; - int modec; +prt_get_attr( + int hl_id, + prt_text_attr_T *pattr, + int modec) { int colorindex; long_u fg_color; @@ -321,8 +319,7 @@ prt_get_attr(hl_id, pattr, modec) #endif /* FEAT_SYN_HL */ static void -prt_set_fg(fg) - long_u fg; +prt_set_fg(long_u fg) { if (fg != curr_fg) { @@ -332,8 +329,7 @@ prt_set_fg(fg) } static void -prt_set_bg(bg) - long_u bg; +prt_set_bg(long_u bg) { if (bg != curr_bg) { @@ -343,10 +339,7 @@ prt_set_bg(bg) } static void -prt_set_font(bold, italic, underline) - int bold; - int italic; - int underline; +prt_set_font(int bold, int italic, int underline) { if (curr_bold != bold || curr_italic != italic @@ -363,10 +356,10 @@ prt_set_font(bold, italic, underline) * Print the line number in the left margin. */ static void -prt_line_number(psettings, page_line, lnum) - prt_settings_T *psettings; - int page_line; - linenr_T lnum; +prt_line_number( + prt_settings_T *psettings, + int page_line, + linenr_T lnum) { int i; char_u tbuf[20]; @@ -400,7 +393,7 @@ prt_line_number(psettings, page_line, lnum) * Get the currently effective header height. */ int -prt_header_height() +prt_header_height(void) { if (printer_opts[OPT_PRINT_HEADERHEIGHT].present) return printer_opts[OPT_PRINT_HEADERHEIGHT].number; @@ -411,7 +404,7 @@ prt_header_height() * Return TRUE if using a line number for printing. */ int -prt_use_number() +prt_use_number(void) { return (printer_opts[OPT_PRINT_NUMBER].present && TOLOWER_ASC(printer_opts[OPT_PRINT_NUMBER].string[0]) == 'y'); @@ -422,8 +415,7 @@ prt_use_number() * Returns PRT_UNIT_NONE if not recognized. */ int -prt_get_unit(idx) - int idx; +prt_get_unit(int idx) { int u = PRT_UNIT_NONE; int i; @@ -443,10 +435,10 @@ prt_get_unit(idx) * Print the page header. */ static void -prt_header(psettings, pagenum, lnum) - prt_settings_T *psettings; - int pagenum; - linenr_T lnum UNUSED; +prt_header( + prt_settings_T *psettings, + int pagenum, + linenr_T lnum UNUSED) { int width = psettings->chars_per_line; int page_line; @@ -549,8 +541,7 @@ prt_header(psettings, pagenum, lnum) * Display a print status message. */ static void -prt_message(s) - char_u *s; +prt_message(char_u *s) { screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0); screen_puts(s, (int)Rows - 1, 0, hl_attr(HLF_R)); @@ -558,8 +549,7 @@ prt_message(s) } void -ex_hardcopy(eap) - exarg_T *eap; +ex_hardcopy(exarg_T *eap) { linenr_T lnum; int collated_copies, uncollated_copies; @@ -825,10 +815,10 @@ print_fail_no_begin: * Return the next column to print, or zero if the line is finished. */ static colnr_T -hardcopy_line(psettings, page_line, ppos) - prt_settings_T *psettings; - int page_line; - prt_pos_T *ppos; +hardcopy_line( + prt_settings_T *psettings, + int page_line, + prt_pos_T *ppos) { colnr_T col; char_u *line; @@ -1458,9 +1448,7 @@ static char_u prt_hexchar[] = "0123456789abcdef"; # endif static void -prt_write_file_raw_len(buffer, bytes) - char_u *buffer; - int bytes; +prt_write_file_raw_len(char_u *buffer, int bytes) { if (!prt_file_error && fwrite(buffer, sizeof(char_u), bytes, prt_ps_fd) @@ -1472,16 +1460,13 @@ prt_write_file_raw_len(buffer, bytes) } static void -prt_write_file(buffer) - char_u *buffer; +prt_write_file(char_u *buffer) { prt_write_file_len(buffer, (int)STRLEN(buffer)); } static void -prt_write_file_len(buffer, bytes) - char_u *buffer; - int bytes; +prt_write_file_len(char_u *buffer, int bytes) { #ifdef EBCDIC ebcdic2ascii(buffer, bytes); @@ -1493,8 +1478,7 @@ prt_write_file_len(buffer, bytes) * Write a string. */ static void -prt_write_string(s) - char *s; +prt_write_string(char *s) { vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer), "%s", s); prt_write_file(prt_line_buffer); @@ -1504,8 +1488,7 @@ prt_write_string(s) * Write an int and a space. */ static void -prt_write_int(i) - int i; +prt_write_int(int i) { sprintf((char *)prt_line_buffer, "%d ", i); prt_write_file(prt_line_buffer); @@ -1515,8 +1498,7 @@ prt_write_int(i) * Write a boolean and a space. */ static void -prt_write_boolean(b) - int b; +prt_write_boolean(int b) { sprintf((char *)prt_line_buffer, "%s ", (b ? "T" : "F")); prt_write_file(prt_line_buffer); @@ -1526,11 +1508,11 @@ prt_write_boolean(b) * Write PostScript to re-encode and define the font. */ static void -prt_def_font(new_name, encoding, height, font) - char *new_name; - char *encoding; - int height; - char *font; +prt_def_font( + char *new_name, + char *encoding, + int height, + char *font) { vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer), "/_%s /VIM-%s /%s ref\n", new_name, encoding, font); @@ -1551,10 +1533,7 @@ prt_def_font(new_name, encoding, height, font) * Write a line to define the CID font. */ static void -prt_def_cidfont(new_name, height, cidfont) - char *new_name; - int height; - char *cidfont; +prt_def_cidfont(char *new_name, int height, char *cidfont) { vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer), "/_%s /%s[/%s] vim_composefont\n", new_name, prt_cmap, cidfont); @@ -1568,9 +1547,7 @@ prt_def_cidfont(new_name, height, cidfont) * Write a line to define a duplicate of a CID font */ static void -prt_dup_cidfont(original_name, new_name) - char *original_name; - char *new_name; +prt_dup_cidfont(char *original_name, char *new_name) { vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer), "/%s %s d\n", new_name, original_name); @@ -1584,11 +1561,11 @@ prt_dup_cidfont(original_name, new_name) * is also rounded based on the precision + 1'th fractional digit. */ static void -prt_real_bits(real, precision, pinteger, pfraction) - double real; - int precision; - int *pinteger; - int *pfraction; +prt_real_bits( + double real, + int precision, + int *pinteger, + int *pfraction) { int i; int integer; @@ -1611,9 +1588,7 @@ prt_real_bits(real, precision, pinteger, pfraction) * what decimal point character to use, but PS always requires a '.'. */ static void -prt_write_real(val, prec) - double val; - int prec; +prt_write_real(double val, int prec) { int integer; int fraction; @@ -1643,10 +1618,7 @@ prt_write_real(val, prec) * Write a line to define a numeric variable. */ static void -prt_def_var(name, value, prec) - char *name; - double value; - int prec; +prt_def_var(char *name, double value, int prec) { vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer), "/%s ", name); @@ -1660,7 +1632,7 @@ prt_def_var(name, value, prec) #define PRT_PS_FONT_TO_USER(scale, size) ((size) * ((scale)/1000.0)) static void -prt_flush_buffer() +prt_flush_buffer(void) { if (prt_ps_buffer.ga_len > 0) { @@ -1742,9 +1714,7 @@ prt_flush_buffer() static void -prt_resource_name(filename, cookie) - char_u *filename; - void *cookie; +prt_resource_name(char_u *filename, void *cookie) { char_u *resource_filename = cookie; @@ -1755,9 +1725,7 @@ prt_resource_name(filename, cookie) } static int -prt_find_resource(name, resource) - char *name; - struct prt_ps_resource_S *resource; +prt_find_resource(char *name, struct prt_ps_resource_S *resource) { char_u *buffer; int retval; @@ -1798,7 +1766,7 @@ struct prt_resfile_buffer_S static struct prt_resfile_buffer_S prt_resfile; static int -prt_resfile_next_line() +prt_resfile_next_line(void) { int idx; @@ -1824,10 +1792,7 @@ prt_resfile_next_line() } static int -prt_resfile_strncmp(offset, string, len) - int offset; - char *string; - int len; +prt_resfile_strncmp(int offset, char *string, int len) { /* Force not equal if string is longer than remainder of line */ if (len > (prt_resfile.line_end - (prt_resfile.line_start + offset))) @@ -1838,8 +1803,7 @@ prt_resfile_strncmp(offset, string, len) } static int -prt_resfile_skip_nonws(offset) - int offset; +prt_resfile_skip_nonws(int offset) { int idx; @@ -1854,8 +1818,7 @@ prt_resfile_skip_nonws(offset) } static int -prt_resfile_skip_ws(offset) - int offset; +prt_resfile_skip_ws(int offset) { int idx; @@ -1872,8 +1835,7 @@ prt_resfile_skip_ws(offset) /* prt_next_dsc() - returns detail on next DSC comment line found. Returns true * if a DSC comment is found, else false */ static int -prt_next_dsc(p_dsc_line) - struct prt_dsc_line_S *p_dsc_line; +prt_next_dsc(struct prt_dsc_line_S *p_dsc_line) { int comment; int offset; @@ -1922,8 +1884,7 @@ prt_next_dsc(p_dsc_line) * PS resource file so the file details can be added to the DSC header comments. */ static int -prt_open_resource(resource) - struct prt_ps_resource_S *resource; +prt_open_resource(struct prt_ps_resource_S *resource) { int offset; int seen_all; @@ -2048,9 +2009,7 @@ prt_open_resource(resource) } static int -prt_check_resource(resource, version) - struct prt_ps_resource_S *resource; - char_u *version; +prt_check_resource(struct prt_ps_resource_S *resource, char_u *version) { /* Version number m.n should match, the revision number does not matter */ if (STRNCMP(resource->version, version, STRLEN(version))) @@ -2065,14 +2024,13 @@ prt_check_resource(resource, version) } static void -prt_dsc_start() +prt_dsc_start(void) { prt_write_string("%!PS-Adobe-3.0\n"); } static void -prt_dsc_noarg(comment) - char *comment; +prt_dsc_noarg(char *comment) { vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer), "%%%%%s\n", comment); @@ -2080,9 +2038,7 @@ prt_dsc_noarg(comment) } static void -prt_dsc_textline(comment, text) - char *comment; - char *text; +prt_dsc_textline(char *comment, char *text) { vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer), "%%%%%s: %s\n", comment, text); @@ -2090,9 +2046,7 @@ prt_dsc_textline(comment, text) } static void -prt_dsc_text(comment, text) - char *comment; - char *text; +prt_dsc_text(char *comment, char *text) { /* TODO - should scan 'text' for any chars needing escaping! */ vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer), @@ -2103,10 +2057,7 @@ prt_dsc_text(comment, text) #define prt_dsc_atend(c) prt_dsc_text((c), "atend") static void -prt_dsc_ints(comment, count, ints) - char *comment; - int count; - int *ints; +prt_dsc_ints(char *comment, int count, int *ints) { int i; @@ -2124,10 +2075,10 @@ prt_dsc_ints(comment, count, ints) } static void -prt_dsc_resources(comment, type, string) - char *comment; /* if NULL add to previous */ - char *type; - char *string; +prt_dsc_resources( + char *comment, /* if NULL add to previous */ + char *type, + char *string) { if (comment != NULL) vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer), @@ -2143,9 +2094,7 @@ prt_dsc_resources(comment, type, string) } static void -prt_dsc_font_resource(resource, ps_font) - char *resource; - struct prt_ps_font_S *ps_font; +prt_dsc_font_resource(char *resource, struct prt_ps_font_S *ps_font) { int i; @@ -2157,12 +2106,12 @@ prt_dsc_font_resource(resource, ps_font) } static void -prt_dsc_requirements(duplex, tumble, collate, color, num_copies) - int duplex; - int tumble; - int collate; - int color; - int num_copies; +prt_dsc_requirements( + int duplex, + int tumble, + int collate, + int color, + int num_copies) { /* Only output the comment if we need to. * Note: tumble is ignored if we are not duplexing @@ -2195,13 +2144,13 @@ prt_dsc_requirements(duplex, tumble, collate, color, num_copies) } static void -prt_dsc_docmedia(paper_name, width, height, weight, colour, type) - char *paper_name; - double width; - double height; - double weight; - char *colour; - char *type; +prt_dsc_docmedia( + char *paper_name, + double width, + double height, + double weight, + char *colour, + char *type) { vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer), "%%%%DocumentMedia: %s ", paper_name); @@ -2222,7 +2171,7 @@ prt_dsc_docmedia(paper_name, width, height, weight, colour, type) } void -mch_print_cleanup() +mch_print_cleanup(void) { #ifdef FEAT_MBYTE if (prt_out_mbyte) @@ -2261,10 +2210,7 @@ mch_print_cleanup() } static float -to_device_units(idx, physsize, def_number) - int idx; - double physsize; - int def_number; +to_device_units(int idx, double physsize, int def_number) { float ret; int u; @@ -2303,13 +2249,13 @@ to_device_units(idx, physsize, def_number) * Calculate margins for given width and height from printoptions settings. */ static void -prt_page_margins(width, height, left, right, top, bottom) - double width; - double height; - double *left; - double *right; - double *top; - double *bottom; +prt_page_margins( + double width, + double height, + double *left, + double *right, + double *top, + double *bottom) { *left = to_device_units(OPT_PRINT_LEFT, width, 10); *right = width - to_device_units(OPT_PRINT_RIGHT, width, 5); @@ -2318,8 +2264,7 @@ prt_page_margins(width, height, left, right, top, bottom) } static void -prt_font_metrics(font_scale) - int font_scale; +prt_font_metrics(int font_scale) { prt_line_height = (float)font_scale; prt_char_width = (float)PRT_PS_FONT_TO_USER(font_scale, prt_ps_font->wx); @@ -2327,7 +2272,7 @@ prt_font_metrics(font_scale) static int -prt_get_cpl() +prt_get_cpl(void) { if (prt_use_number()) { @@ -2349,10 +2294,7 @@ prt_get_cpl() #ifdef FEAT_MBYTE static int -prt_build_cid_fontname(font, name, name_len) - int font; - char_u *name; - int name_len; +prt_build_cid_fontname(int font, char_u *name, int name_len) { char *fontname; @@ -2370,7 +2312,7 @@ prt_build_cid_fontname(font, name, name_len) * Get number of lines of text that fit on a page (excluding the header). */ static int -prt_get_lpp() +prt_get_lpp(void) { int lpp; @@ -2402,10 +2344,10 @@ prt_get_lpp() #ifdef FEAT_MBYTE static int -prt_match_encoding(p_encoding, p_cmap, pp_mbenc) - char *p_encoding; - struct prt_ps_mbfont_S *p_cmap; - struct prt_ps_encoding_S **pp_mbenc; +prt_match_encoding( + char *p_encoding, + struct prt_ps_mbfont_S *p_cmap, + struct prt_ps_encoding_S **pp_mbenc) { int mbenc; int enc_len; @@ -2428,10 +2370,10 @@ prt_match_encoding(p_encoding, p_cmap, pp_mbenc) } static int -prt_match_charset(p_charset, p_cmap, pp_mbchar) - char *p_charset; - struct prt_ps_mbfont_S *p_cmap; - struct prt_ps_charset_S **pp_mbchar; +prt_match_charset( + char *p_charset, + struct prt_ps_mbfont_S *p_cmap, + struct prt_ps_charset_S **pp_mbchar) { int mbchar; int char_len; @@ -2456,10 +2398,10 @@ prt_match_charset(p_charset, p_cmap, pp_mbchar) #endif int -mch_print_init(psettings, jobname, forceit) - prt_settings_T *psettings; - char_u *jobname; - int forceit UNUSED; +mch_print_init( + prt_settings_T *psettings, + char_u *jobname, + int forceit UNUSED) { int i; char *paper_name; @@ -2805,8 +2747,7 @@ mch_print_init(psettings, jobname, forceit) } static int -prt_add_resource(resource) - struct prt_ps_resource_S *resource; +prt_add_resource(struct prt_ps_resource_S *resource) { FILE* fd_resource; char_u resource_buffer[512]; @@ -2853,8 +2794,7 @@ prt_add_resource(resource) } int -mch_print_begin(psettings) - prt_settings_T *psettings; +mch_print_begin(prt_settings_T *psettings) { time_t now; int bbox[4]; @@ -3295,8 +3235,7 @@ theend: } void -mch_print_end(psettings) - prt_settings_T *psettings; +mch_print_end(prt_settings_T *psettings) { prt_dsc_noarg("Trailer"); @@ -3333,7 +3272,7 @@ mch_print_end(psettings) } int -mch_print_end_page() +mch_print_end_page(void) { prt_flush_buffer(); @@ -3345,8 +3284,7 @@ mch_print_end_page() } int -mch_print_begin_page(str) - char_u *str UNUSED; +mch_print_begin_page(char_u *str UNUSED) { int page_num[2]; @@ -3387,7 +3325,7 @@ mch_print_begin_page(str) } int -mch_print_blank_page() +mch_print_blank_page(void) { return (mch_print_begin_page(NULL) ? (mch_print_end_page()) : FALSE); } @@ -3396,9 +3334,7 @@ static float prt_pos_x = 0; static float prt_pos_y = 0; void -mch_print_start_line(margin, page_line) - int margin; - int page_line; +mch_print_start_line(int margin, int page_line) { prt_pos_x = prt_left_margin; if (margin) @@ -3415,9 +3351,7 @@ mch_print_start_line(margin, page_line) } int -mch_print_text_out(p, len) - char_u *p; - int len UNUSED; +mch_print_text_out(char_u *p, int len UNUSED) { int need_break; char_u ch; @@ -3638,10 +3572,7 @@ mch_print_text_out(p, len) } void -mch_print_set_font(iBold, iItalic, iUnderline) - int iBold; - int iItalic; - int iUnderline; +mch_print_set_font(int iBold, int iItalic, int iUnderline) { int font = 0; @@ -3665,8 +3596,7 @@ mch_print_set_font(iBold, iItalic, iUnderline) } void -mch_print_set_bg(bgcol) - long_u bgcol; +mch_print_set_bg(long_u bgcol) { prt_bgcol = (int)bgcol; prt_attribute_change = TRUE; @@ -3674,8 +3604,7 @@ mch_print_set_bg(bgcol) } void -mch_print_set_fg(fgcol) - long_u fgcol; +mch_print_set_fg(long_u fgcol) { if (fgcol != (long_u)prt_fgcol) { diff --git a/src/hashtab.c b/src/hashtab.c index a4bce6503e..d1ba2c9528 100644 --- a/src/hashtab.c +++ b/src/hashtab.c @@ -49,7 +49,7 @@ static int hash_may_resize(hashtab_T *ht, int minitems); * Returns NULL when out of memory. */ hashtab_T * -hash_create() +hash_create(void) { hashtab_T *ht; @@ -64,8 +64,7 @@ hash_create() * Initialize an empty hash table. */ void -hash_init(ht) - hashtab_T *ht; +hash_init(hashtab_T *ht) { /* This zeroes all "ht_" entries and all the "hi_key" in "ht_smallarray". */ vim_memset(ht, 0, sizeof(hashtab_T)); @@ -78,8 +77,7 @@ hash_init(ht) * If "ht" is not freed then you should call hash_init() next! */ void -hash_clear(ht) - hashtab_T *ht; +hash_clear(hashtab_T *ht) { if (ht->ht_array != ht->ht_smallarray) vim_free(ht->ht_array); @@ -91,9 +89,7 @@ hash_clear(ht) * memory to the location of the key (it's always positive). */ void -hash_clear_all(ht, off) - hashtab_T *ht; - int off; +hash_clear_all(hashtab_T *ht, int off) { long todo; hashitem_T *hi; @@ -119,9 +115,7 @@ hash_clear_all(ht, off) * (adding, setting or removing an item)! */ hashitem_T * -hash_find(ht, key) - hashtab_T *ht; - char_u *key; +hash_find(hashtab_T *ht, char_u *key) { return hash_lookup(ht, key, hash_hash(key)); } @@ -130,10 +124,7 @@ hash_find(ht, key) * Like hash_find(), but caller computes "hash". */ hashitem_T * -hash_lookup(ht, key, hash) - hashtab_T *ht; - char_u *key; - hash_T hash; +hash_lookup(hashtab_T *ht, char_u *key, hash_T hash) { hash_T perturb; hashitem_T *freeitem; @@ -195,7 +186,7 @@ hash_lookup(ht, key, hash) * Called when exiting. */ void -hash_debug_results() +hash_debug_results(void) { #ifdef HT_DEBUG fprintf(stderr, "\r\n\r\n\r\n\r\n"); @@ -211,9 +202,7 @@ hash_debug_results() * Returns FAIL when out of memory or the key is already present. */ int -hash_add(ht, key) - hashtab_T *ht; - char_u *key; +hash_add(hashtab_T *ht, char_u *key) { hash_T hash = hash_hash(key); hashitem_T *hi; @@ -234,11 +223,11 @@ hash_add(ht, key) * Returns OK or FAIL (out of memory). */ int -hash_add_item(ht, hi, key, hash) - hashtab_T *ht; - hashitem_T *hi; - char_u *key; - hash_T hash; +hash_add_item( + hashtab_T *ht, + hashitem_T *hi, + char_u *key, + hash_T hash) { /* If resizing failed before and it fails again we can't add an item. */ if (ht->ht_error && hash_may_resize(ht, 0) == FAIL) @@ -265,9 +254,7 @@ hash_add_item(ht, hi, key, hash) * "hi" is invalid after this! */ void -hash_set(hi, key) - hashitem_T *hi; - char_u *key; +hash_set(hashitem_T *hi, char_u *key) { hi->hi_key = key; } @@ -279,9 +266,7 @@ hash_set(hi, key) * The caller must take care of freeing the item itself. */ void -hash_remove(ht, hi) - hashtab_T *ht; - hashitem_T *hi; +hash_remove(hashtab_T *ht, hashitem_T *hi) { --ht->ht_used; hi->hi_key = HI_KEY_REMOVED; @@ -294,8 +279,7 @@ hash_remove(ht, hi) * Must call hash_unlock() later. */ void -hash_lock(ht) - hashtab_T *ht; +hash_lock(hashtab_T *ht) { ++ht->ht_locked; } @@ -307,9 +291,7 @@ hash_lock(ht) * Must call hash_unlock() later. */ void -hash_lock_size(ht, size) - hashtab_T *ht; - int size; +hash_lock_size(hashtab_T *ht, int size) { (void)hash_may_resize(ht, size); ++ht->ht_locked; @@ -322,8 +304,7 @@ hash_lock_size(ht, size) * This must balance a call to hash_lock(). */ void -hash_unlock(ht) - hashtab_T *ht; +hash_unlock(hashtab_T *ht) { --ht->ht_locked; (void)hash_may_resize(ht, 0); @@ -335,9 +316,9 @@ hash_unlock(ht) * Returns OK or FAIL (out of memory). */ static int -hash_may_resize(ht, minitems) - hashtab_T *ht; - int minitems; /* minimal number of items */ +hash_may_resize( + hashtab_T *ht, + int minitems) /* minimal number of items */ { hashitem_T temparray[HT_INIT_SIZE]; hashitem_T *oldarray, *newarray; @@ -481,8 +462,7 @@ hash_may_resize(ht, minitems) * lower the percentage the better. */ hash_T -hash_hash(key) - char_u *key; +hash_hash(char_u *key) { hash_T hash; char_u *p; diff --git a/src/if_cscope.c b/src/if_cscope.c index c6acd17653..4a7290713e 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c @@ -83,8 +83,7 @@ static cscmd_T cs_cmds[] = }; static void -cs_usage_msg(x) - csid_e x; +cs_usage_msg(csid_e x) { (void)EMSG2(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage); } @@ -104,9 +103,7 @@ static enum * expansion. */ char_u * -get_cscope_name(xp, idx) - expand_T *xp UNUSED; - int idx; +get_cscope_name(expand_T *xp UNUSED, int idx) { int current_idx; int i; @@ -167,10 +164,10 @@ get_cscope_name(xp, idx) * Handle command line completion for :cscope command. */ void -set_context_in_cscope_cmd(xp, arg, cmdidx) - expand_T *xp; - char_u *arg; - cmdidx_T cmdidx; +set_context_in_cscope_cmd( + expand_T *xp, + char_u *arg, + cmdidx_T cmdidx) { char_u *p; @@ -210,9 +207,9 @@ set_context_in_cscope_cmd(xp, arg, cmdidx) * command function. */ static void -do_cscope_general(eap, make_split) - exarg_T *eap; - int make_split; /* whether to split window */ +do_cscope_general( + exarg_T *eap, + int make_split) /* whether to split window */ { cscmd_T *cmdp; @@ -248,8 +245,7 @@ do_cscope_general(eap, make_split) * PUBLIC: do_cscope */ void -do_cscope(eap) - exarg_T *eap; +do_cscope(exarg_T *eap) { do_cscope_general(eap, FALSE); } @@ -260,8 +256,7 @@ do_cscope(eap) * same as do_cscope, but splits window, too. */ void -do_scscope(eap) - exarg_T *eap; +do_scscope(exarg_T *eap) { do_cscope_general(eap, TRUE); } @@ -271,8 +266,7 @@ do_scscope(eap) * */ void -do_cstag(eap) - exarg_T *eap; +do_cstag(exarg_T *eap) { int ret = FALSE; @@ -354,9 +348,7 @@ do_cstag(eap) * returns TRUE if eof, FALSE otherwise */ int -cs_fgets(buf, size) - char_u *buf; - int size; +cs_fgets(char_u *buf, int size) { char *p; @@ -374,7 +366,7 @@ cs_fgets(buf, size) * called only from do_tag(), when popping the tag stack */ void -cs_free_tags() +cs_free_tags(void) { cs_manage_matches(NULL, NULL, -1, Free); } @@ -386,7 +378,7 @@ cs_free_tags() * called from do_tag() */ void -cs_print_tags() +cs_print_tags(void) { cs_manage_matches(NULL, NULL, -1, Print); } @@ -421,10 +413,7 @@ cs_print_tags() */ #if defined(FEAT_EVAL) || defined(PROTO) int -cs_connection(num, dbpath, ppath) - int num; - char_u *dbpath; - char_u *ppath; +cs_connection(int num, char_u *dbpath, char_u *ppath) { int i; @@ -486,8 +475,7 @@ cs_connection(num, dbpath, ppath) * MAXPATHL 256 */ static int -cs_add(eap) - exarg_T *eap UNUSED; +cs_add(exarg_T *eap UNUSED) { char *fname, *ppath, *flags = NULL; @@ -503,8 +491,7 @@ cs_add(eap) } static void -cs_stat_emsg(fname) - char *fname; +cs_stat_emsg(char *fname) { char *stat_emsg = _("E563: stat(%s) error: %d"); char *buf = (char *)alloc((unsigned)strlen(stat_emsg) + MAXPATHL + 10); @@ -528,10 +515,10 @@ cs_stat_emsg(fname) * routine uses a number of goto statements. */ static int -cs_add_common(arg1, arg2, flags) - char *arg1; /* filename - may contain environment variables */ - char *arg2; /* prepend path - may contain environment variables */ - char *flags; +cs_add_common( + char *arg1, /* filename - may contain environment variables */ + char *arg2, /* prepend path - may contain environment variables */ + char *flags) { struct stat statbuf; int ret; @@ -665,14 +652,14 @@ add_err: static int -cs_check_for_connections() +cs_check_for_connections(void) { return (cs_cnt_connections() > 0); } /* cs_check_for_connections */ static int -cs_check_for_tags() +cs_check_for_tags(void) { return (p_tags[0] != NUL && curbuf->b_p_tags != NULL); } /* cs_check_for_tags */ @@ -684,7 +671,7 @@ cs_check_for_tags() * count the number of cscope connections */ static int -cs_cnt_connections() +cs_cnt_connections(void) { short i; short cnt = 0; @@ -698,8 +685,8 @@ cs_cnt_connections() } /* cs_cnt_connections */ static void -cs_reading_emsg(idx) - int idx; /* connection index */ +cs_reading_emsg( + int idx) /* connection index */ { EMSGN(_("E262: error reading cscope connection %ld"), idx); } @@ -711,8 +698,7 @@ cs_reading_emsg(idx) * count the number of matches for a given cscope connection. */ static int -cs_cnt_matches(idx) - int idx; +cs_cnt_matches(int idx) { char *stok; char *buf; @@ -773,9 +759,7 @@ cs_cnt_matches(idx) * Creates the actual cscope command query from what the user entered. */ static char * -cs_create_cmd(csoption, pattern) - char *csoption; - char *pattern; +cs_create_cmd(char *csoption, char *pattern) { char *cmd; short search; @@ -836,8 +820,7 @@ cs_create_cmd(csoption, pattern) * the BSD license notice? */ static