diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-30 18:51:09 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-30 18:51:09 +0100 |
commit | 52ea13da0fe86df1abf34de52841e367035170c0 (patch) | |
tree | 0f0b400936dac18cdfae5304c27eaa1eb5e4d5f3 | |
parent | 02fdaeaa697fb5af4ba7fee6e209b3c2c825bb4f (diff) |
patch 7.4.1210v7.4.1210
Problem: Using old style function declarations.
Solution: Change to new style function declarations. (script by Hirohito
Higashi)
-rw-r--r-- | src/main.c | 134 | ||||
-rw-r--r-- | src/mark.c | 168 | ||||
-rw-r--r-- | src/mbyte.c | 425 | ||||
-rw-r--r-- | src/memfile.c | 160 | ||||
-rw-r--r-- | src/memfile_test.c | 4 | ||||
-rw-r--r-- | src/memline.c | 297 | ||||
-rw-r--r-- | src/menu.c | 191 | ||||
-rw-r--r-- | src/message.c | 413 | ||||
-rw-r--r-- | src/version.c | 2 |
9 files changed, 683 insertions, 1111 deletions
diff --git a/src/main.c b/src/main.c index dcc8274fd9..e412641cc3 100644 --- a/src/main.c +++ b/src/main.c @@ -165,9 +165,7 @@ VimMain # else main # endif -(argc, argv) - int argc; - char **argv; +(int argc, char **argv) { char_u *fname = NULL; /* file name from command line */ mparm_T params; /* various parameters passed between @@ -1534,10 +1532,10 @@ getout(int exitval) * Get a (optional) count for a Vim argument. */ static int -get_number_arg(p, idx, def) - char_u *p; /* pointer to argument */ - int *idx; /* index in argument, is incremented */ - int def; /* default value */ +get_number_arg( + char_u *p, /* pointer to argument */ + int *idx, /* index in argument, is incremented */ + int def) /* default value */ { if (vim_isdigit(p[*idx])) { @@ -1553,7 +1551,7 @@ get_number_arg(p, idx, def) * Setup to use the current locale (for ctype() and many other things). */ static void -init_locale() +init_locale(void) { setlocale(LC_ALL, ""); @@ -1609,8 +1607,7 @@ init_locale() * by "im" use improved Ex mode. */ static void -parse_command_name(parmp) - mparm_T *parmp; +parse_command_name(mparm_T *parmp) { char_u *initstr; @@ -1700,8 +1697,7 @@ parse_command_name(parmp) * Also find the --server... arguments and --socketid and --windowid */ static void -early_arg_scan(parmp) - mparm_T *parmp UNUSED; +early_arg_scan(mparm_T *parmp UNUSED) { #if defined(FEAT_XCLIPBOARD) || defined(FEAT_CLIENTSERVER) \ || !defined(FEAT_NETBEANS_INTG) @@ -1792,8 +1788,7 @@ early_arg_scan(parmp) * Scan the command line arguments. */ static void -command_line_scan(parmp) - mparm_T *parmp; +command_line_scan(mparm_T *parmp) { int argc = parmp->argc; char **argv = parmp->argv; @@ -2512,8 +2507,7 @@ scripterror: * When starting in Ex mode and commands come from a file, set Silent mode. */ static void -check_tty(parmp) - mparm_T *parmp; +check_tty(mparm_T *parmp) { int input_isatty; /* is active input a terminal? */ @@ -2559,7 +2553,7 @@ check_tty(parmp) * Read text from stdin. */ static void -read_stdin() +read_stdin(void) { int i; @@ -2593,8 +2587,7 @@ read_stdin() * Also does recovery if "recoverymode" set. */ static void -create_windows(parmp) - mparm_T *parmp UNUSED; +create_windows(mparm_T *parmp UNUSED) { #ifdef FEAT_WINDOWS int dorewind; @@ -2747,9 +2740,9 @@ create_windows(parmp) * windows. make_windows() has already opened the windows. */ static void -edit_buffers(parmp, cwd) - mparm_T *parmp; - char_u *cwd; /* current working dir */ +edit_buffers( + mparm_T *parmp, + char_u *cwd) /* current working dir */ { int arg_idx; /* index in argument list */ int i; @@ -2876,8 +2869,7 @@ edit_buffers(parmp, cwd) * Execute the commands from --cmd arguments "cmds[cnt]". */ static void -exe_pre_commands(parmp) - mparm_T *parmp; +exe_pre_commands(mparm_T *parmp) { char_u **cmds = parmp->pre_commands; int cnt = parmp->n_pre_commands; @@ -2904,8 +2896,7 @@ exe_pre_commands(parmp) * Execute "+", "-c" and "-S" arguments. */ static void -exe_commands(parmp) - mparm_T *parmp; +exe_commands(mparm_T *parmp) { int i; @@ -2949,8 +2940,7 @@ exe_commands(parmp) * Source startup scripts. */ static void -source_startup_scripts(parmp) - mparm_T *parmp; +source_startup_scripts(mparm_T *parmp) { int i; @@ -3108,7 +3098,7 @@ source_startup_scripts(parmp) * Setup to start using the GUI. Exit with an error when not available. */ static void -main_start_gui() +main_start_gui(void) { #ifdef FEAT_GUI gui.starting = TRUE; /* start GUI a bit later */ @@ -3126,9 +3116,9 @@ main_start_gui() * Returns FAIL if the environment variable was not executed, OK otherwise. */ int -process_env(env, is_viminit) - char_u *env; - int is_viminit; /* when TRUE, called for VIMINIT */ +process_env( + char_u *env, + int is_viminit) /* when TRUE, called for VIMINIT */ { char_u *initstr; char_u *save_sourcing_name; @@ -3167,8 +3157,7 @@ process_env(env, is_viminit) * Use both stat() and lstat() for extra security. */ static int -file_owned(fname) - char *fname; +file_owned(char *fname) { struct stat s; # ifdef UNIX @@ -3189,9 +3178,9 @@ file_owned(fname) * Give an error message main_errors["n"] and exit. */ static void -mainerr(n, str) - int n; /* one of the ME_ defines */ - char_u *str; /* extra argument or NULL */ +mainerr( + int n, /* one of the ME_ defines */ + char_u *str) /* extra argument or NULL */ { #if defined(UNIX) || defined(__EMX__) || defined(VMS) reset_signals(); /* kill us with CTRL-C here, if you like */ @@ -3212,8 +3201,7 @@ mainerr(n, str) } void -mainerr_arg_missing(str) - char_u *str; +mainerr_arg_missing(char_u *str) { mainerr(ME_ARG_MISSING, str); } @@ -3223,8 +3211,7 @@ mainerr_arg_missing(str) * print a message with three spaces prepended and '\n' appended. */ static void -main_msg(s) - char *s; +main_msg(char *s) { mch_msg(" "); mch_msg(s); @@ -3235,7 +3222,7 @@ main_msg(s) * Print messages for "vim -h" or "vim --help" and exit. */ static void -usage() +usage(void) { int i; static char *(use[]) = @@ -3431,7 +3418,7 @@ usage() * When "Recover" selected, recover the file. */ static void -check_swap_exists_action() +check_swap_exists_action(void) { if (swap_exists_action == SEA_QUIT) getout(1); @@ -3465,8 +3452,7 @@ gettimeofday(struct timeval *tv, char *dummy) * set "*tv_rel" to the time elapsed so far. */ void -time_push(tv_rel, tv_start) - void *tv_rel, *tv_start; +time_push(void *tv_rel, void *tv_start) { *((struct timeval *)tv_rel) = prev_timeval; gettimeofday(&prev_timeval, NULL); @@ -3489,8 +3475,8 @@ time_push(tv_rel, tv_start) * have struct timeval. */ void -time_pop(tp) - void *tp; /* actually (struct timeval *) */ +time_pop( + void *tp) /* actually (struct timeval *) */ { prev_timeval.tv_usec -= ((struct timeval *)tp)->tv_usec; prev_timeval.tv_sec -= ((struct timeval *)tp)->tv_sec; @@ -3502,9 +3488,7 @@ time_pop(tp) } static void -time_diff(then, now) - struct timeval *then; - struct timeval *now; +time_diff(struct timeval *then, struct timeval *now) { long usec; long msec; @@ -3516,9 +3500,9 @@ time_diff(then, now) } void -time_msg(mesg, tv_start) - char *mesg; - void *tv_start; /* only for do_source: start time; actually +time_msg( + char *mesg, + void *tv_start) /* only for do_source: start time; actually (struct timeval *) */ { static struct timeval start; @@ -3562,8 +3546,7 @@ static char_u *build_drop_cmd(int filec, char **filev, int tabs, int sendReply); * Do the client-server stuff, unless "--servername ''" was used. */ static void -exec_on_server(parmp) - mparm_T *parmp; +exec_on_server(mparm_T *parmp) { if (parmp->serverName_arg == NULL || *parmp->serverName_arg != NUL) { @@ -3605,8 +3588,7 @@ exec_on_server(parmp) * Prepare for running as a Vim server. */ static void -prepare_server(parmp) - mparm_T *parmp; +prepare_server(mparm_T *parmp) { # if defined(FEAT_X11) /* @@ -3648,11 +3630,11 @@ prepare_server(parmp) } static void -cmdsrv_main(argc, argv, serverName_arg, serverStr) - int *argc; - char **argv; - char_u *serverName_arg; - char_u **serverStr; +cmdsrv_main( + int *argc, + char **argv, + char_u *serverName_arg, + char_u **serverStr) { char_u *res; int i; @@ -3924,11 +3906,11 @@ cmdsrv_main(argc, argv, serverName_arg, serverStr) * Build a ":drop" command to send to a Vim server. */ static char_u * -build_drop_cmd(filec, filev, tabs, sendReply) - int filec; - char **filev; - int tabs; /* Use ":tab drop" instead of ":drop". */ - int sendReply; +build_drop_cmd( + int filec, + char **filev, + int tabs, /* Use ":tab drop" instead of ":drop". */ + int sendReply) { garray_T ga; int i; @@ -4044,9 +4026,7 @@ build_drop_cmd(filec, filev, tabs, sendReply) * Return the name in allocated memory. This doesn't include a serial number. */ static char_u * -serverMakeName(arg, cmd) - char_u *arg; - char *cmd; +serverMakeName(char_u *arg, char *cmd) { char_u *p; @@ -4068,8 +4048,7 @@ serverMakeName(arg, cmd) * Replace termcodes such as <CR> and insert as key presses if there is room. */ void -server_to_input_buf(str) - char_u *str; +server_to_input_buf(char_u *str) { char_u *ptr = NULL; char_u *cpo_save = p_cpo; @@ -4110,8 +4089,7 @@ server_to_input_buf(str) * Evaluate an expression that the client sent to a string. */ char_u * -eval_client_expr_to_string(expr) - char_u *expr; +eval_client_expr_to_string(char_u *expr) { char_u *res; int save_dbl = debug_break_level; @@ -4151,10 +4129,10 @@ eval_client_expr_to_string(expr) * "*tofree" is set to the result when it needs to be freed later. */ char_u * -serverConvert(client_enc, data, tofree) - char_u *client_enc UNUSED; - char_u *data; - char_u **tofree; +serverConvert( + char_u *client_enc UNUSED, + char_u *data, + char_u **tofree) { char_u *res = data; diff --git a/src/mark.c b/src/mark.c index 284fedfebd..3465947730 100644 --- a/src/mark.c +++ b/src/mark.c @@ -43,8 +43,7 @@ static void write_one_filemark(FILE *fp, xfmark_T *fm, int c1, int c2); * Returns OK on success, FAIL if bad name given. */ int -setmark(c) - int c; +setmark(int c) { return setmark_pos(c, &curwin->w_cursor, curbuf->b_fnum); } @@ -55,10 +54,7 @@ setmark(c) * Returns OK on success, FAIL if bad name given. */ int -setmark_pos(c, pos, fnum) - int c; - pos_T *pos; - int fnum; +setmark_pos(int c, pos_T *pos, int fnum) { int i; @@ -138,7 +134,7 @@ setmark_pos(c, pos, fnum) * jump list. */ void -setpcmark() +setpcmark(void) { #ifdef FEAT_JUMPLIST int i; @@ -198,7 +194,7 @@ setpcmark() * If pcmark was deleted (with "dG") the previous mark is restored. */ void -checkpcmark() +checkpcmark(void) { if (curwin->w_prev_pcmark.lnum != 0 && (equalpos(curwin->w_pcmark, curwin->w_cursor) @@ -214,8 +210,7 @@ checkpcmark() * move "count" positions in the jump list (count may be negative) */ pos_T * -movemark(count) - int count; +movemark(int count) { pos_T *pos; xfmark_T *jmp; @@ -274,8 +269,7 @@ movemark(count) * Move "count" positions in the changelist (count may be negative). */ pos_T * -movechangelist(count) - int count; +movechangelist(int count) { int n; @@ -314,28 +308,23 @@ movechangelist(count) * - -1 if mark is in other file and jumped there (only if changefile is TRUE) */ pos_T * -getmark_buf(buf, c, changefile) - buf_T *buf; - int c; - int changefile; +getmark_buf(buf_T *buf, int c, int changefile) { return getmark_buf_fnum(buf, c, changefile, NULL); } pos_T * -getmark(c, changefile) - int c; - int changefile; +getmark(int c, int changefile) { return getmark_buf_fnum(curbuf, c, changefile, NULL); } pos_T * -getmark_buf_fnum(buf, c, changefile, fnum) - buf_T *buf; - int c; - int changefile; - int *fnum; +getmark_buf_fnum( + buf_T *buf, + int c, + int changefile, + int *fnum) { pos_T *posp; pos_T *startp, *endp; @@ -472,10 +461,10 @@ getmark_buf_fnum(buf, c, changefile, fnum) * Returns pointer to pos_T of the next mark or NULL if no mark is found. */ pos_T * -getnextmark(startpos, dir, begin_line) - pos_T *startpos; /* where to start */ - int dir; /* direction for search */ - int begin_line; +getnextmark( + pos_T *startpos, /* where to start */ + int dir, /* direction for search */ + int begin_line) { int i; pos_T *result = NULL; @@ -520,8 +509,7 @@ getnextmark(startpos, dir, begin_line) * until the mark is used to avoid a long startup delay. */ static void -fname2fnum(fm) - xfmark_T *fm; +fname2fnum(xfmark_T *fm) { char_u *p; @@ -561,8 +549,7 @@ fname2fnum(fm) * Used for marks that come from the .viminfo file. */ void -fmarks_check_names(buf) - buf_T *buf; +fmarks_check_names(buf_T *buf) { char_u *name; int i; @@ -592,10 +579,7 @@ fmarks_check_names(buf) } static void -fmarks_check_one(fm, name, buf) - xfmark_T *fm; - char_u *name; - buf_T *buf; +fmarks_check_one(xfmark_T *fm, char_u *name, buf_T *buf) { if (fm->fmark.fnum == 0 && fm->fname != NULL @@ -612,8 +596,7 @@ fmarks_check_one(fm, name, buf) * Give and error message and return FAIL if not. */ int -check_mark(pos) - pos_T *pos; +check_mark(pos_T *pos) { if (pos == NULL) { @@ -642,8 +625,7 @@ check_mark(pos) * Used mainly when trashing the entire buffer during ":e" type commands */ void -clrallmarks(buf) - buf_T *buf; +clrallmarks(buf_T *buf) { static int i = -1; @@ -676,9 +658,7 @@ clrallmarks(buf) * Returns an allocated string. */ char_u * -fm_getname(fmark, lead_len) - fmark_T *fmark; - int lead_len; +fm_getname(fmark_T *fmark, int lead_len) { if (fmark->fnum == curbuf->b_fnum) /* current buffer */ return mark_line(&(fmark->mark), lead_len); @@ -690,9 +670,7 @@ fm_getname(fmark, lead_len) * The returned string has been allocated. */ static char_u * -mark_line(mp, lead_len) - pos_T *mp; - int lead_len; +mark_line(pos_T *mp, int lead_len) { char_u *s, *p; int len; @@ -718,8 +696,7 @@ mark_line(mp, lead_len) * print the marks */ void -do_marks(eap) - exarg_T *eap; +do_marks(exarg_T *eap) { char_u *arg = eap->arg; int i; @@ -757,12 +734,12 @@ do_marks(eap) } static void -show_one_mark(c, arg, p, name, current) - int c; - char_u *arg; - pos_T *p; - char_u *name; - int current; /* in current file */ +show_one_mark( + int c, + char_u *arg, + pos_T *p, + char_u *name, + int current) /* in current file */ { static int did_title = FALSE; int mustfree = FALSE; @@ -815,8 +792,7 @@ show_one_mark(c, arg, p, name, current) * ":delmarks[!] [marks]" */ void -ex_delmarks(eap) - exarg_T *eap; +ex_delmarks(exarg_T *eap) { char_u *p; int from, to; @@ -899,8 +875,7 @@ ex_delmarks(eap) * print the jumplist */ void -ex_jumps(eap) - exarg_T *eap UNUSED; +ex_jumps(exarg_T *eap UNUSED) { int i; char_u *name; @@ -947,8 +922,7 @@ ex_jumps(eap) * print the changelist */ void -ex_changes(eap) - exarg_T *eap UNUSED; +ex_changes(exarg_T *eap UNUSED) { int i; char_u *name; @@ -1025,11 +999,11 @@ ex_changes(eap) * or: mark_adjust(56, 55, MAXLNUM, 2); */ void -mark_adjust(line1, line2, amount, amount_after) - linenr_T line1; - linenr_T line2; - long amount; - long amount_after; +mark_adjust( + linenr_T line1, + linenr_T line2, + long amount, + long amount_after) { int i; int fnum = curbuf->b_fnum; @@ -1207,11 +1181,11 @@ mark_adjust(line1, line2, amount, amount_after) * position. */ void -mark_col_adjust(lnum, mincol, lnum_amount, col_amount) - linenr_T lnum; - colnr_T mincol; - long lnum_amount; - long col_amount; +mark_col_adjust( + linenr_T lnum, + colnr_T mincol, + long lnum_amount, + long col_amount) { int i; int fnum = curbuf->b_fnum; @@ -1291,7 +1265,7 @@ mark_col_adjust(lnum, mincol, lnum_amount, col_amount) * jumplist. They will be removed here for the current window. */ static void -cleanup_jumplist() +cleanup_jumplist(void) { int i; int from, to; @@ -1323,9 +1297,7 @@ cleanup_jumplist() * Copy the jumplist from window "from" to window "to". */ void -copy_jumplist(from, to) - win_T *from; - win_T *to; +copy_jumplist(win_T *from, win_T *to) { int i; @@ -1343,8 +1315,7 @@ copy_jumplist(from, to) * Free items in the jumplist of window "wp". */ void -free_jumplist(wp) - win_T *wp; +free_jumplist(win_T *wp) { int i; @@ -1355,8 +1326,7 @@ free_jumplist(wp) #endif /* FEAT_JUMPLIST */ void -set_last_cursor(win) - win_T *win; +set_last_cursor(win_T *win) { if (win->w_buffer != NULL) win->w_buffer->b_last_cursor = win->w_cursor; @@ -1364,7 +1334,7 @@ set_last_cursor(win) #if defined(EXITFREE) || defined(PROTO) void -free_all_marks() +free_all_marks(void) { int i; @@ -1376,9 +1346,7 @@ free_all_marks() #if defined(FEAT_VIMINFO) || defined(PROTO) int -read_viminfo_filemark(virp, force) - vir_T *virp; - int force; +read_viminfo_filemark(vir_T *virp, int force) { char_u *str; xfmark_T *fm; @@ -1438,8 +1406,7 @@ read_viminfo_filemark(virp, force) } void -write_viminfo_filemarks(fp) - FILE *fp; +write_viminfo_filemarks(FILE *fp) { int i; char_u *name; @@ -1499,11 +1466,11 @@ write_viminfo_filemarks(fp) } static void -write_one_filemark(fp, fm, c1, c2) - FILE *fp; - xfmark_T *fm; - int c1; - int c2; +write_one_filemark( + FILE *fp, + xfmark_T *fm, + int c1, + int c2) { char_u *name; @@ -1529,8 +1496,7 @@ write_one_filemark(fp, fm, c1, c2) * Return TRUE if "name" is on removable media (depending on 'viminfo'). */ int -removable(name) - char_u *name; +removable(char_u *name) { char_u *p; char_u part[51]; @@ -1565,8 +1531,7 @@ static void write_one_mark(FILE *fp_out, int c, pos_T *pos); * Return the number of buffers for which marks have been written. */ int -write_viminfo_marks(fp_out) - FILE *fp_out; +write_viminfo_marks(FILE *fp_out) { int count; buf_T *buf; @@ -1632,10 +1597,7 @@ write_viminfo_marks(fp_out) } static void -write_one_mark(fp_out, c, pos) - FILE *fp_out; - int c; - pos_T *pos; +write_one_mark(FILE *fp_out, int c, pos_T *pos) { if (pos->lnum != 0) fprintf(fp_out, "\t%c\t%ld\t%d\n", c, (long)pos->lnum, (int)pos->col); @@ -1648,12 +1610,12 @@ write_one_mark(fp_out, c, pos) * fp_out == NULL && (flags & VIF_GET_OLDFILES | VIF_FORCEIT): fill v:oldfiles */ void -copy_viminfo_marks(virp, fp_out, count, eof, flags) - vir_T *virp; - FILE *fp_out; - int count; - int eof; - int flags; +copy_viminfo_marks( + vir_T *virp, + FILE *fp_out, + int count, + int eof, + int flags) { char_u *line = virp->vir_line; buf_T *buf; diff --git a/src/mbyte.c b/src/mbyte.c index 01906eb2f9..8f7bbb23ef 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -441,8 +441,7 @@ enc_alias_table[] = * Returns -1 if not found. */ static int -enc_canon_search(name) - char_u *name; +enc_canon_search(char_u *name) { int i; @@ -461,8 +460,7 @@ enc_canon_search(name) * Returns 0 if not found. */ int -enc_canon_props(name) - char_u *name; +enc_canon_props(char_u *name) { int i; @@ -507,7 +505,7 @@ enc_canon_props(name) * anything. */ char_u * -mb_init() +mb_init(void) { int i; int idx; @@ -819,7 +817,7 @@ codepage_invalid: * 3 - UTF-8 BOM */ int -bomb_size() +bomb_size(void) { int n = 0; @@ -850,8 +848,7 @@ bomb_size() * Remove all BOM from "s" by moving remaining text. */ void -remove_bom(s) - char_u *s; +remove_bom(char_u *s) { if (enc_utf8) { @@ -875,16 +872,13 @@ remove_bom(s) * >2 for other word characters */ int -mb_get_class(p) - char_u *p; +mb_get_class(char_u *p) { return mb_get_class_buf(p, curbuf); } int -mb_get_class_buf(p, buf) - char_u *p; - buf_T *buf; +mb_get_class_buf(char_u *p, buf_T *buf) { if (MB_BYTE2LEN(p[0]) == 1) { @@ -906,9 +900,7 @@ mb_get_class_buf(p, buf) * TODO: Should return 1 for punctuation. */ int -dbcs_class(lead, trail) - unsigned lead; - unsigned trail; +dbcs_class(unsigned lead, unsigned trail) { switch (enc_dbcs) { @@ -1082,15 +1074,14 @@ dbcs_class(lead, trail) * Returns 1 for a single-byte character. */ int -latin_char2len(c) - int c UNUSED; +latin_char2len(int c UNUSED) { return 1; } static int -dbcs_char2len(c) - int c; +dbcs_char2len( + int c) { if (c >= 0x100) return 2; @@ -1103,18 +1094,14 @@ dbcs_char2len(c) * Returns the length in bytes. */ int -latin_char2bytes(c, buf) - int c; - char_u *buf; +latin_char2bytes(int c, char_u *buf) { buf[0] = c; return 1; } static int -dbcs_char2bytes(c, buf) - int c; - char_u *buf; +dbcs_char2bytes(int c, char_u *buf) { if (c >= 0x100) { @@ -1137,15 +1124,14 @@ dbcs_char2bytes(c, buf) * Returns 0 when *p is NUL. */ int -latin_ptr2len(p) - char_u *p; +latin_ptr2len(char_u *p) { - return MB_BYTE2LEN(*p); + return MB_BYTE2LEN(*p); } static int -dbcs_ptr2len(p) - char_u *p; +dbcs_ptr2len( + char_u *p) { int len; @@ -1163,9 +1149,7 @@ dbcs_ptr2len(p) * Returns 1 for an illegal char or an incomplete byte sequence. */ int -latin_ptr2len_len(p, size) - char_u *p; - int size; +latin_ptr2len_len(char_u *p, int size) { if (size < 1 || *p == NUL) return 0; @@ -1173,9 +1157,7 @@ latin_ptr2len_len(p, size) } static int -dbcs_ptr2len_len(p, size) - char_u *p; - int size; +dbcs_ptr2len_len(char_u *p, int size) { int len; @@ -1201,10 +1183,7 @@ static int intable(struct interval *table, size_t size, int c); * Return TRUE if "c" is in "table[size / sizeof(struct interval)]". */ static int -intable(table, size, c) - struct interval *table; - size_t size; - int c; +intable(struct interval *table, size_t size, int c) { int mid, bot, top; @@ -1236,8 +1215,7 @@ intable(table, size, c) * class 'A'(mbiguous). */ int -utf_char2cells(c) - int c; +utf_char2cells(int c) { /* Sorted list of non-overlapping intervals of East Asian double width * characters, generated with ../runtime/tools/unicode.vim. */ @@ -1496,15 +1474,14 @@ utf_char2cells(c) * This doesn't take care of unprintable characters, use ptr2cells() for that. */ int -latin_ptr2cells(p) - char_u *p UNUSED; +latin_ptr2cells(char_u *p UNUSED) { return 1; } int -utf_ptr2cells(p) - char_u *p; +utf_ptr2cells( + char_u *p) { int c; @@ -1524,8 +1501,7 @@ utf_ptr2cells(p) } int -dbcs_ptr2cells(p) - char_u *p; +dbcs_ptr2cells(char_u *p) { /* Number of cells is equal to number of bytes, except for euc-jp when * the first byte is 0x8e. */ @@ -1540,17 +1516,13 @@ dbcs_ptr2cells(p) * For an empty string or truncated character returns 1. */ int -latin_ptr2cells_len(p, size) - char_u *p UNUSED; - int size UNUSED; +latin_ptr2cells_len(char_u *p UNUSED, int size UNUSED) { return 1; } static int -utf_ptr2cells_len(p, size) - char_u *p; - int size; +utf_ptr2cells_len(char_u *p, int size) { int c; @@ -1572,9 +1544,7 @@ utf_ptr2cells_len(p, size) } static int -dbcs_ptr2cells_len(p, size) - char_u *p; - int size; +dbcs_ptr2cells_len(char_u *p, int size) { /* Number of cells is equal to number of bytes, except for euc-jp when * the first byte is 0x8e. */ @@ -1589,15 +1559,13 @@ dbcs_ptr2cells_len(p, size) * Only takes care of multi-byte chars, not "^C" and such. */ int -latin_char2cells(c) - int c UNUSED; +latin_char2cells(int c UNUSED) { return 1; } static int -dbcs_char2cells(c) - int c; +dbcs_char2cells(int c) { /* Number of cells is equal to number of bytes, except for euc-jp when * the first byte is 0x8e. */ @@ -1612,9 +1580,7 @@ dbcs_char2cells(c) * Stop at a NUL character. When "len" >= 0 stop at character "p[len]". */ int -mb_string2cells(p, len) - char_u *p; - int len; +mb_string2cells(char_u *p, int len) { int i; int clen = 0; @@ -1630,17 +1596,13 @@ mb_string2cells(p, len) * We make sure that the offset used is less than "max_off". */ int -latin_off2cells(off, max_off) - unsigned off UNUSED; - unsigned max_off UNUSED; +latin_off2cells(unsigned off UNUSED, unsigned max_off UNUSED) { return 1; } int -dbcs_off2cells(off, max_off) - unsigned off; - unsigned max_off; +dbcs_off2cells(unsigned off, unsigned max_off) { /* never check beyond end of the line */ if (off >= max_off) @@ -1654,9 +1616,7 @@ dbcs_off2cells(off, max_off) } int -utf_off2cells(off, max_off) - unsigned off; - unsigned max_off; +utf_off2cells(unsigned off, unsigned max_off) { return (off + 1 < max_off && ScreenLines[off + 1] == 0) ? 2 : 1; } @@ -1666,15 +1626,13 @@ utf_off2cells(off, max_off) * Convert a byte sequence into a character. */ int -latin_ptr2char(p) - char_u *p; +latin_ptr2char(char_u *p) { return *p; } static int -dbcs_ptr2char(p) - char_u *p; +dbcs_ptr2char(char_u *p) { if (MB_BYTE2LEN(*p) > 1 && p[1] != NUL) return (p[0] << 8) + p[1]; @@ -1688,8 +1646,7 @@ dbcs_ptr2char(p) * Does not include composing characters, of course. */ int -utf_ptr2char(p) - char_u *p; +utf_ptr2char(char_u *p) { int len; @@ -1746,9 +1703,7 @@ utf_ptr2char(p) * "s". */ static int -utf_safe_read_char_adv(s, n) - char_u **s; - size_t *n; +utf_safe_read_char_adv(char_u **s, size_t *n) { int c, k; @@ -1794,8 +1749,7 @@ utf_safe_read_char_adv(s, n) * Note: composing characters are skipped! */ int -mb_ptr2char_adv(pp) - char_u **pp; +mb_ptr2char_adv(char_u **pp) { int c; @@ -1809,8 +1763,7 @@ mb_ptr2char_adv(pp) * Note: composing characters are returned as separate characters. */ int -mb_cptr2char_adv(pp) - char_u **pp; +mb_cptr2char_adv(char_u **pp) { int c; @@ -1828,9 +1781,9 @@ mb_cptr2char_adv(pp) * Note: these are NOT really composing characters! */ int -arabic_combine(one, two) - int one; /* first character */ - int two; /* character just after "one" */ +arabic_combine( + int one, /* first character */ + int two) /* character just after "one" */ { if (one == a_LAM) return arabic_maycombine(two); @@ -1842,8 +1795,7 @@ arabic_combine(one, two) * Arabic combining character, need to check the character before this. */ int -arabic_maycombine(two) - int two; +arabic_maycombine(int two) { if (p_arshape && !p_tbidi) return (two == a_ALEF_MADDA @@ -1859,9 +1811,7 @@ arabic_maycombine(two) * behaves like a composing character. */ int -utf_composinglike(p1, p2) - char_u *p1; - char_u *p2; +utf_composinglike(char_u *p1, char_u *p2) { int c2; @@ -1879,9 +1829,9 @@ utf_composinglike(p1, p2) * composing characters. */ int -utfc_ptr2char(p, pcc) - char_u *p; - int *pcc; /* return: composing chars, last one is 0 */ +utfc_ptr2char( + char_u *p, + int *pcc) /* return: composing chars, last one is 0 */ { int len; int c; @@ -1919,10 +1869,10 @@ utfc_ptr2char(p, pcc) * composing characters. Use no more than p[maxlen]. */ int -utfc_ptr2char_len(p, pcc, maxlen) - char_u *p; - int *pcc; /* return: composing chars, last one is 0 */ - int maxlen; +utfc_ptr2char_len( + char_u *p, + int *pcc, /* return: composing chars, last one is 0 */ + int maxlen) { int len; int c; @@ -1965,9 +1915,7 @@ utfc_ptr2char_len(p, pcc, maxlen) * Returns the produced number of bytes. */ int -utfc_char2bytes(off, buf) - int off; - char_u *buf; +utfc_char2bytes(int off, char_u *buf) { int len; int i; @@ -1989,8 +1937,7 @@ utfc_char2bytes(off, buf) * Returns 1 for an illegal byte sequence. */ int -utf_ptr2len(p) - char_u *p; +utf_ptr2len(char_u *p) { int len; int i; @@ -2010,8 +1957,7 |