mirror of
https://github.com/vim/vim.git
synced 2025-09-22 03:33:47 -04:00
patch 7.4.1205
Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi)
This commit is contained in:
parent
305598b712
commit
7454a06e26
74
src/arabic.c
74
src/arabic.c
@ -43,8 +43,7 @@ static int A_is_special(int c);
|
||||
* Returns True if c is an ISO-8859-6 shaped ARABIC letter (user entered)
|
||||
*/
|
||||
static int
|
||||
A_is_a(cur_c)
|
||||
int cur_c;
|
||||
A_is_a(int cur_c)
|
||||
{
|
||||
switch (cur_c)
|
||||
{
|
||||
@ -96,8 +95,7 @@ A_is_a(cur_c)
|
||||
* Returns True if c is an Isolated Form-B ARABIC letter
|
||||
*/
|
||||
static int
|
||||
A_is_s(cur_c)
|
||||
int cur_c;
|
||||
A_is_s(int cur_c)
|
||||
{
|
||||
switch (cur_c)
|
||||
{
|
||||
@ -148,8 +146,7 @@ A_is_s(cur_c)
|
||||
* Returns True if c is a Final shape of an ARABIC letter
|
||||
*/
|
||||
static int
|
||||
A_is_f(cur_c)
|
||||
int cur_c;
|
||||
A_is_f(int cur_c)
|
||||
{
|
||||
switch (cur_c)
|
||||
{
|
||||
@ -202,8 +199,7 @@ A_is_f(cur_c)
|
||||
* Change shape - from ISO-8859-6/Isolated to Form-B Isolated
|
||||
*/
|
||||
static int
|
||||
chg_c_a2s(cur_c)
|
||||
int cur_c;
|
||||
chg_c_a2s(int cur_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@ -332,8 +328,7 @@ chg_c_a2s(cur_c)
|
||||
* Change shape - from ISO-8859-6/Isolated to Initial
|
||||
*/
|
||||
static int
|
||||
chg_c_a2i(cur_c)
|
||||
int cur_c;
|
||||
chg_c_a2i(int cur_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@ -462,8 +457,7 @@ chg_c_a2i(cur_c)
|
||||
* Change shape - from ISO-8859-6/Isolated to Medial
|
||||
*/
|
||||
static int
|
||||
chg_c_a2m(cur_c)
|
||||
int cur_c;
|
||||
chg_c_a2m(int cur_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@ -592,8 +586,7 @@ chg_c_a2m(cur_c)
|
||||
* Change shape - from ISO-8859-6/Isolated to final
|
||||
*/
|
||||
static int
|
||||
chg_c_a2f(cur_c)
|
||||
int cur_c;
|
||||
chg_c_a2f(int cur_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@ -732,8 +725,7 @@ chg_c_a2f(cur_c)
|
||||
* Change shape - from Initial to Medial
|
||||
*/
|
||||
static int
|
||||
chg_c_i2m(cur_c)
|
||||
int cur_c;
|
||||
chg_c_i2m(int cur_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@ -820,8 +812,7 @@ chg_c_i2m(cur_c)
|
||||
* Change shape - from Final to Medial
|
||||
*/
|
||||
static int
|
||||
chg_c_f2m(cur_c)
|
||||
int cur_c;
|
||||
chg_c_f2m(int cur_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@ -930,8 +921,7 @@ chg_c_f2m(cur_c)
|
||||
* Change shape - from Combination (2 char) to an Isolated
|
||||
*/
|
||||
static int
|
||||
chg_c_laa2i(hid_c)
|
||||
int hid_c;
|
||||
chg_c_laa2i(int hid_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@ -961,8 +951,7 @@ chg_c_laa2i(hid_c)
|
||||
* Change shape - from Combination-Isolated to Final
|
||||
*/
|
||||
static int
|
||||
chg_c_laa2f(hid_c)
|
||||
int hid_c;
|
||||
chg_c_laa2f(int hid_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@ -991,8 +980,7 @@ chg_c_laa2f(hid_c)
|
||||
* Do "half-shaping" on character "c". Return zero if no shaping.
|
||||
*/
|
||||
static int
|
||||
half_shape(c)
|
||||
int c;
|
||||
half_shape(int c)
|
||||
{
|
||||
if (A_is_a(c))
|
||||
return chg_c_a2i(c);
|
||||
@ -1011,13 +999,13 @@ half_shape(c)
|
||||
* in: "next_c" is the next character (not shaped).
|
||||
*/
|
||||
int
|
||||
arabic_shape(c, ccp, c1p, prev_c, prev_c1, next_c)
|
||||
int c;
|
||||
int *ccp;
|
||||
int *c1p;
|
||||
int prev_c;
|
||||
int prev_c1;
|
||||
int next_c;
|
||||
arabic_shape(
|
||||
int c,
|
||||
int *ccp,
|
||||
int *c1p,
|
||||
int prev_c,
|
||||
int prev_c1,
|
||||
int next_c)
|
||||
{
|
||||
int curr_c;
|
||||
int shape_c;
|
||||
@ -1082,9 +1070,9 @@ arabic_shape(c, ccp, c1p, prev_c, prev_c1, next_c)
|
||||
* A_firstc_laa returns first character of LAA combination if it exists
|
||||
*/
|
||||
static int
|
||||
A_firstc_laa(c, c1)
|
||||
int c; /* base character */
|
||||
int c1; /* first composing character */
|
||||
A_firstc_laa(
|
||||
int c, /* base character */
|
||||
int c1) /* first composing character */
|
||||
{
|
||||
if (c1 != NUL && c == a_LAM && !A_is_harakat(c1))
|
||||
return c1;
|
||||
@ -1097,8 +1085,7 @@ A_firstc_laa(c, c1)
|
||||
* (harakat/tanween)
|
||||
*/
|
||||
static int
|
||||
A_is_harakat(c)
|
||||
int c;
|
||||
A_is_harakat(int c)
|
||||
{
|
||||
return (c >= a_FATHATAN && c <= a_SUKUN);
|
||||
}
|
||||
@ -1109,8 +1096,7 @@ A_is_harakat(c)
|
||||
* (alphabet/number/punctuation)
|
||||
*/
|
||||
static int
|
||||
A_is_iso(c)
|
||||
int c;
|
||||
A_is_iso(int c)
|
||||
{
|
||||
return ((c >= a_HAMZA && c <= a_GHAIN)
|
||||
|| (c >= a_TATWEEL && c <= a_HAMZA_BELOW)
|
||||
@ -1123,8 +1109,7 @@ A_is_iso(c)
|
||||
* (alphabet/number/punctuation)
|
||||
*/
|
||||
static int
|
||||
A_is_formb(c)
|
||||
int c;
|
||||
A_is_formb(int c)
|
||||
{
|
||||
return ((c >= a_s_FATHATAN && c <= a_s_DAMMATAN)
|
||||
|| c == a_s_KASRATAN
|
||||
@ -1137,8 +1122,7 @@ A_is_formb(c)
|
||||
* A_is_ok returns TRUE if 'c' is an Arabic 10646 (8859-6 or Form-B)
|
||||
*/
|
||||
static int
|
||||
A_is_ok(c)
|
||||
int c;
|
||||
A_is_ok(int c)
|
||||
{
|
||||
return (A_is_iso(c) || A_is_formb(c));
|
||||
}
|
||||
@ -1149,8 +1133,7 @@ A_is_ok(c)
|
||||
* with some exceptions/exclusions
|
||||
*/
|
||||
static int
|
||||
A_is_valid(c)
|
||||
int c;
|
||||
A_is_valid(int c)
|
||||
{
|
||||
return (A_is_ok(c) && !A_is_special(c));
|
||||
}
|
||||
@ -1161,8 +1144,7 @@ A_is_valid(c)
|
||||
* Specials don't adhere to most of the rules.
|
||||
*/
|
||||
static int
|
||||
A_is_special(c)
|
||||
int c;
|
||||
A_is_special(int c)
|
||||
{
|
||||
return (c == a_HAMZA || c == a_s_HAMZA);
|
||||
}
|
||||
|
@ -348,10 +348,10 @@ static UINT32_T sbx_init[4][256] = {
|
||||
bfs->sbx[3][xr & 0xFF];
|
||||
|
||||
static void
|
||||
bf_e_block(bfs, p_xl, p_xr)
|
||||
bf_state_T *bfs;
|
||||
UINT32_T *p_xl;
|
||||
UINT32_T *p_xr;
|
||||
bf_e_block(
|
||||
bf_state_T *bfs,
|
||||
UINT32_T *p_xl,
|
||||
UINT32_T *p_xr)
|
||||
{
|
||||
UINT32_T temp;
|
||||
UINT32_T xl = *p_xl;
|
||||
@ -384,9 +384,9 @@ bf_e_block(bfs, p_xl, p_xr)
|
||||
#endif
|
||||
|
||||
static void
|
||||
bf_e_cblock(bfs, block)
|
||||
bf_state_T *bfs;
|
||||
char_u *block;
|
||||
bf_e_cblock(
|
||||
bf_state_T *bfs,
|
||||
char_u *block)
|
||||
{
|
||||
block8 bk;
|
||||
|
||||
@ -404,11 +404,11 @@ bf_e_cblock(bfs, block)
|
||||
* "salt[salt_len]" as the salt.
|
||||
*/
|
||||
static void
|
||||
bf_key_init(bfs, password, salt, salt_len)
|
||||
bf_state_T *bfs;
|
||||
char_u *password;
|
||||
char_u *salt;
|
||||
int salt_len;
|
||||
bf_key_init(
|
||||
bf_state_T *bfs,
|
||||
char_u *password,
|
||||
char_u *salt,
|
||||
int salt_len)
|
||||
{
|
||||
int i, j, keypos = 0;
|
||||
unsigned u;
|
||||
@ -470,10 +470,10 @@ bf_key_init(bfs, password, salt, salt_len)
|
||||
* Blowfish self-test for corrupted tables or instructions.
|
||||
*/
|
||||
static int
|
||||
bf_check_tables(pax, sbx, val)
|
||||
UINT32_T pax[18];
|
||||
UINT32_T sbx[4][256];
|
||||
UINT32_T val;
|
||||
bf_check_tables(
|
||||
UINT32_T pax[18],
|
||||
UINT32_T sbx[4][256],
|
||||
UINT32_T val)
|
||||
{
|
||||
int i, j;
|
||||
UINT32_T c = 0;
|
||||
@ -514,7 +514,7 @@ static struct_bf_test_data bf_test_data[] = {
|
||||
* Return FAIL when there is something wrong with blowfish encryption.
|
||||
*/
|
||||
static int
|
||||
bf_self_test()
|
||||
bf_self_test(void)
|
||||
{
|
||||
int i, bn;
|
||||
int err = 0;
|
||||
@ -566,10 +566,10 @@ bf_self_test()
|
||||
* Initialize with seed "seed[seed_len]".
|
||||
*/
|
||||
static void
|
||||
bf_cfb_init(bfs, seed, seed_len)
|
||||
bf_state_T *bfs;
|
||||
char_u *seed;
|
||||
int seed_len;
|
||||
bf_cfb_init(
|
||||
bf_state_T *bfs,
|
||||
char_u *seed,
|
||||
int seed_len)
|
||||
{
|
||||
int i, mi;
|
||||
|
||||
@ -602,11 +602,11 @@ bf_cfb_init(bfs, seed, seed_len)
|
||||
* "from" and "to" can be equal to encrypt in place.
|
||||
*/
|
||||
void
|
||||
crypt_blowfish_encode(state, from, len, to)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u *to;
|
||||
crypt_blowfish_encode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
{
|
||||
bf_state_T *bfs = state->method_state;
|
||||
size_t i;
|
||||
@ -625,11 +625,11 @@ crypt_blowfish_encode(state, from, len, to)
|
||||
* Decrypt "from[len]" into "to[len]".
|
||||
*/
|
||||
void
|
||||
crypt_blowfish_decode(state, from, len, to)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u *to;
|
||||
crypt_blowfish_decode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
{
|
||||
bf_state_T *bfs = state->method_state;
|
||||
size_t i;
|
||||
@ -644,13 +644,13 @@ crypt_blowfish_decode(state, from, len, to)
|
||||
}
|
||||
|
||||
void
|
||||
crypt_blowfish_init(state, key, salt, salt_len, seed, seed_len)
|
||||
cryptstate_T *state;
|
||||
char_u* key;
|
||||
char_u* salt;
|
||||
int salt_len;
|
||||
char_u* seed;
|
||||
int seed_len;
|
||||
crypt_blowfish_init(
|
||||
cryptstate_T *state,
|
||||
char_u* key,
|
||||
char_u* salt,
|
||||
int salt_len,
|
||||
char_u* seed,
|
||||
int seed_len)
|
||||
{
|
||||
bf_state_T *bfs = (bf_state_T *)alloc_clear(sizeof(bf_state_T));
|
||||
|
||||
@ -672,7 +672,7 @@ crypt_blowfish_init(state, key, salt, salt_len, seed, seed_len)
|
||||
* Give an error and return FAIL when not.
|
||||
*/
|
||||
int
|
||||
blowfish_self_test()
|
||||
blowfish_self_test(void)
|
||||
{
|
||||
if (sha256_self_test() == FAIL)
|
||||
{
|
||||
|
509
src/buffer.c
509
src/buffer.c
File diff suppressed because it is too large
Load Diff
@ -745,7 +745,7 @@ channel_wait(int fd, int timeout)
|
||||
* Return a unique ID to be used in a message.
|
||||
*/
|
||||
int
|
||||
channel_get_id()
|
||||
channel_get_id(void)
|
||||
{
|
||||
static int next_id = 1;
|
||||
|
||||
|
278
src/charset.c
278
src/charset.c
@ -68,15 +68,15 @@ static char_u g_chartab[256];
|
||||
* error, OK otherwise.
|
||||
*/
|
||||
int
|
||||
init_chartab()
|
||||
init_chartab(void)
|
||||
{
|
||||
return buf_init_chartab(curbuf, TRUE);
|
||||
}
|
||||
|
||||
int
|
||||
buf_init_chartab(buf, global)
|
||||
buf_T *buf;
|
||||
int global; /* FALSE: only set buf->b_chartab[] */
|
||||
buf_init_chartab(
|
||||
buf_T *buf,
|
||||
int global) /* FALSE: only set buf->b_chartab[] */
|
||||
{
|
||||
int c;
|
||||
int c2;
|
||||
@ -313,9 +313,9 @@ buf_init_chartab(buf, global)
|
||||
* enough room, not all characters will be translated.
|
||||
*/
|
||||
void
|
||||
trans_characters(buf, bufsize)
|
||||
char_u *buf;
|
||||
int bufsize;
|
||||
trans_characters(
|
||||
char_u *buf,
|
||||
int bufsize)
|
||||
{
|
||||
int len; /* length of string needing translation */
|
||||
int room; /* room in buffer after string */
|
||||
@ -356,8 +356,7 @@ trans_characters(buf, bufsize)
|
||||
* printable chars. Returns NULL when out of memory.
|
||||
*/
|
||||
char_u *
|
||||
transstr(s)
|
||||
char_u *s;
|
||||
transstr(char_u *s)
|
||||
{
|
||||
char_u *res;
|
||||
char_u *p;
|
||||
@ -434,11 +433,11 @@ transstr(s)
|
||||
* Otherwise puts the result in "buf[buflen]".
|
||||
*/
|
||||
char_u *
|
||||
str_foldcase(str, orglen, buf, buflen)
|
||||
char_u *str;
|
||||
int orglen;
|
||||
char_u *buf;
|
||||
int buflen;
|
||||
str_foldcase(
|
||||
char_u *str,
|
||||
int orglen,
|
||||
char_u *buf,
|
||||
int buflen)
|
||||
{
|
||||
garray_T ga;
|
||||
int i;
|
||||
@ -552,8 +551,7 @@ str_foldcase(str, orglen, buf, buflen)
|
||||
static char_u transchar_buf[7];
|
||||
|
||||
char_u *
|
||||
transchar(c)
|
||||
int c;
|
||||
transchar(int c)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -592,8 +590,7 @@ transchar(c)
|
||||
* for an illegal UTF-8 byte.
|
||||
*/
|
||||
char_u *
|
||||
transchar_byte(c)
|
||||
int c;
|
||||
transchar_byte(int c)
|
||||
{
|
||||
if (enc_utf8 && c >= 0x80)
|
||||
{
|
||||
@ -610,9 +607,7 @@ transchar_byte(c)
|
||||
* Does NOT work for multi-byte characters, c must be <= 255.
|
||||
*/
|
||||
void
|
||||
transchar_nonprint(buf, c)
|
||||
char_u *buf;
|
||||
int c;
|
||||
transchar_nonprint(char_u *buf, int c)
|
||||
{
|
||||
if (c == NL)
|
||||
c = NUL; /* we use newline in place of a NUL */
|
||||
@ -679,9 +674,7 @@ transchar_nonprint(buf, c)
|
||||
}
|
||||
|
||||
void
|
||||
transchar_hex(buf, c)
|
||||
char_u *buf;
|
||||
int c;
|
||||
transchar_hex(char_u *buf, int c)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@ -705,8 +698,7 @@ transchar_hex(buf, c)
|
||||
* function key 1.
|
||||
*/
|
||||
static unsigned
|
||||
nr2hex(c)
|
||||
unsigned c;
|
||||
nr2hex(unsigned c)
|
||||
{
|
||||
if ((c & 0xf) <= 9)
|
||||
return (c & 0xf) + '0';
|
||||
@ -722,8 +714,7 @@ nr2hex(c)
|
||||
* cells depends on further bytes.
|
||||
*/
|
||||
int
|
||||
byte2cells(b)
|
||||
int b;
|
||||
byte2cells(int b)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_utf8 && b >= 0x80)
|
||||
@ -738,8 +729,7 @@ byte2cells(b)
|
||||
* A TAB is counted as two cells: "^I" or four: "<09>".
|
||||
*/
|
||||
int
|
||||
char2cells(c)
|
||||
int c;
|
||||
char2cells(int c)
|
||||
{
|
||||
if (IS_SPECIAL(c))
|
||||
return char2cells(K_SECOND(c)) + 2;
|
||||
@ -767,8 +757,7 @@ char2cells(c)
|
||||
* A TAB is counted as two cells: "^I" or four: "<09>".
|
||||
*/
|
||||
int
|
||||
ptr2cells(p)
|
||||
char_u *p;
|
||||
ptr2cells(char_u *p)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
/* For UTF-8 we need to look at more bytes if the first byte is >= 0x80. */
|
||||
@ -784,8 +773,7 @@ ptr2cells(p)
|
||||
* counting TABs as two characters: "^I".
|
||||
*/
|
||||
int
|
||||
vim_strsize(s)
|
||||
char_u *s;
|
||||
vim_strsize(char_u *s)
|
||||
{
|
||||
return vim_strnsize(s, (int)MAXCOL);
|
||||
}
|
||||
@ -795,9 +783,7 @@ vim_strsize(s)
|
||||
* screen, counting TABs as two characters: "^I".
|
||||
*/
|
||||
int
|
||||
vim_strnsize(s, len)
|
||||
char_u *s;
|
||||
int len;
|
||||
vim_strnsize(char_u *s, int len)
|
||||
{
|
||||
int size = 0;
|
||||
|
||||
@ -839,9 +825,7 @@ vim_strnsize(s, len)
|
||||
#if defined(FEAT_VREPLACE) || defined(FEAT_EX_EXTRA) || defined(FEAT_GUI) \
|
||||
|| defined(FEAT_VIRTUALEDIT) || defined(PROTO)
|
||||
int
|
||||
chartabsize(p, col)
|
||||
char_u *p;
|
||||
colnr_T col;
|
||||
chartabsize(char_u *p, colnr_T col)
|
||||
{
|
||||
RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, p, col)
|
||||
}
|
||||
@ -849,10 +833,7 @@ chartabsize(p, col)
|
||||
|
||||
#ifdef FEAT_LINEBREAK
|
||||
static int
|
||||
win_chartabsize(wp, p, col)
|
||||
win_T *wp;
|
||||
char_u *p;
|
||||
colnr_T col;
|
||||
win_chartabsize(win_T *wp, char_u *p, colnr_T col)
|
||||
{
|
||||
RET_WIN_BUF_CHARTABSIZE(wp, wp->w_buffer, p, col)
|
||||
}
|
||||
@ -863,8 +844,7 @@ win_chartabsize(wp, p, col)
|
||||
* taking into account the size of a tab.
|
||||
*/
|
||||
int
|
||||
linetabsize(s)
|
||||
char_u *s;
|
||||
linetabsize(char_u *s)
|
||||
{
|
||||
return linetabsize_col(0, s);
|
||||
}
|
||||
@ -873,9 +853,7 @@ linetabsize(s)
|
||||
* Like linetabsize(), but starting at column "startcol".
|
||||
*/
|
||||
int
|
||||
linetabsize_col(startcol, s)
|
||||
int startcol;
|
||||
char_u *s;
|
||||
linetabsize_col(int startcol, char_u *s)
|
||||
{
|
||||
colnr_T col = startcol;
|
||||
char_u *line = s; /* pointer to start of line, for breakindent */
|
||||
@ -889,10 +867,7 @@ linetabsize_col(startcol, s)
|
||||
* Like linetabsize(), but for a given window instead of the current one.
|
||||
*/
|
||||
int
|
||||
win_linetabsize(wp, line, len)
|
||||
win_T *wp;
|
||||
char_u *line;
|
||||
colnr_T len;
|
||||
win_linetabsize(win_T *wp, char_u *line, colnr_T len)
|
||||
{
|
||||
colnr_T col = 0;
|
||||
char_u *s;
|
||||
@ -908,8 +883,7 @@ win_linetabsize(wp, line, len)
|
||||
* Letters and characters from the 'isident' option.
|
||||
*/
|
||||
int
|
||||
vim_isIDc(c)
|
||||
int c;
|
||||
vim_isIDc(int c)
|
||||
{
|
||||
return (c > 0 && c < 0x100 && (g_chartab[c] & CT_ID_CHAR));
|
||||
}
|
||||
@ -920,16 +894,13 @@ vim_isIDc(c)
|
||||
* For multi-byte characters mb_get_class() is used (builtin rules).
|
||||
*/
|
||||
int
|
||||
vim_iswordc(c)
|
||||
int c;
|
||||
vim_iswordc(int c)
|
||||
{
|
||||
return vim_iswordc_buf(c, curbuf);
|
||||
}
|
||||
|
||||
int
|
||||
vim_iswordc_buf(c, buf)
|
||||
int c;
|
||||
buf_T *buf;
|
||||
vim_iswordc_buf(int c, buf_T *buf)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (c >= 0x100)
|
||||
@ -947,8 +918,7 @@ vim_iswordc_buf(c, buf)
|
||||
* Just like vim_iswordc() but uses a pointer to the (multi-byte) character.
|
||||
*/
|
||||
int
|
||||
vim_iswordp(p)
|
||||
char_u *p;
|
||||
vim_iswordp(char_u *p)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte && MB_BYTE2LEN(*p) > 1)
|
||||
@ -958,9 +928,7 @@ vim_iswordp(p)
|
||||
}
|
||||
|
||||
int
|
||||
vim_iswordp_buf(p, buf)
|
||||
char_u *p;
|
||||
buf_T *buf;
|
||||
vim_iswordp_buf(char_u *p, buf_T *buf)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte && MB_BYTE2LEN(*p) > 1)
|
||||
@ -974,8 +942,7 @@ vim_iswordp_buf(p, buf)
|
||||
* Assume characters above 0x100 are valid (multi-byte).
|
||||
*/
|
||||
int
|
||||
vim_isfilec(c)
|
||||
int c;
|
||||
vim_isfilec(int c)
|
||||
{
|
||||
return (c >= 0x100 || (c > 0 && (g_chartab[c] & CT_FNAME_CHAR)));
|
||||
}
|
||||
@ -987,8 +954,7 @@ vim_isfilec(c)
|
||||
* returns false.
|
||||
*/
|
||||
int
|
||||
vim_isfilec_or_wc(c)
|
||||
int c;
|
||||
vim_isfilec_or_wc(int c)
|
||||
{
|
||||
char_u buf[2];
|
||||
|
||||
@ -1003,8 +969,7 @@ vim_isfilec_or_wc(c)
|
||||
* Unicode.
|
||||
*/
|
||||
int
|
||||
vim_isprintc(c)
|
||||
int c;
|
||||
vim_isprintc(int c)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_utf8 && c >= 0x100)
|
||||
@ -1018,8 +983,7 @@ vim_isprintc(c)
|
||||
* byte of a double-byte character.
|
||||
*/
|
||||
int
|
||||
vim_isprintc_strict(c)
|
||||
int c;
|
||||
vim_isprintc_strict(int c)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_dbcs != 0 && c < 0x100 && MB_BYTE2LEN(c) > 1)
|
||||
@ -1034,10 +998,10 @@ vim_isprintc_strict(c)
|
||||
* like chartabsize(), but also check for line breaks on the screen
|
||||
*/
|
||||
int
|
||||
lbr_chartabsize(line, s, col)
|
||||
char_u *line UNUSED; /* start of the line */
|
||||
unsigned char *s;
|
||||
colnr_T col;
|
||||
lbr_chartabsize(
|
||||
char_u *line UNUSED, /* start of the line */
|
||||
unsigned char *s,
|
||||
colnr_T col)
|
||||
{
|
||||
#ifdef FEAT_LINEBREAK
|
||||
if (!curwin->w_p_lbr && *p_sbr == NUL && !curwin->w_p_bri)
|
||||
@ -1058,10 +1022,10 @@ lbr_chartabsize(line, s, col)
|
||||
* Call lbr_chartabsize() and advance the pointer.
|
||||
*/
|
||||
int
|
||||
lbr_chartabsize_adv(line, s, col)
|
||||
char_u *line; /* start of the line */
|
||||
char_u **s;
|
||||
colnr_T col;
|
||||
lbr_chartabsize_adv(
|
||||
char_u *line, /* start of the line */
|
||||
char_u **s,
|
||||
colnr_T col)
|
||||
{
|
||||
int retval;
|
||||
|
||||
@ -1078,12 +1042,12 @@ lbr_chartabsize_adv(line, s, col)
|
||||
* value, init to 0 before calling.
|
||||
*/
|
||||
int
|
||||
win_lbr_chartabsize(wp, line, s, col, headp)
|
||||
win_T *wp;
|
||||
char_u *line UNUSED; /* start of the line */
|
||||
char_u *s;
|
||||
colnr_T col;
|
||||
int *headp UNUSED;
|
||||
win_lbr_chartabsize(
|
||||
win_T *wp,
|
||||
char_u *line UNUSED, /* start of the line */
|
||||
char_u *s,
|
||||
colnr_T col,
|
||||
int *headp UNUSED)
|
||||
{
|
||||
#ifdef FEAT_LINEBREAK
|
||||
int c;
|
||||
@ -1254,11 +1218,11 @@ win_lbr_chartabsize(wp, line, s, col, headp)
|
||||
* doesn't fit at the end of the screen line.
|
||||
*/
|
||||
static int
|
||||
win_nolbr_chartabsize(wp, s, col, headp)
|
||||
win_T *wp;
|
||||
char_u *s;
|
||||
colnr_T col;
|
||||
int *headp;
|
||||
win_nolbr_chartabsize(
|
||||
win_T *wp,
|
||||
char_u *s,
|
||||
colnr_T col,
|
||||
int *headp)
|
||||
{
|
||||
int n;
|
||||
|
||||
@ -1284,9 +1248,7 @@ win_nolbr_chartabsize(wp, s, col, headp)
|
||||
* "wp".
|
||||
*/
|
||||
int
|
||||
in_win_border(wp, vcol)
|
||||
win_T *wp;
|
||||
colnr_T vcol;
|
||||
in_win_border(win_T *wp, colnr_T vcol)
|
||||
{
|
||||
int width1; /* width of first line (after line number) */
|
||||
int width2; /* width of further lines */
|
||||
@ -1316,12 +1278,12 @@ in_win_border(wp, vcol)
|
||||
* This is used very often, keep it fast!
|
||||
*/
|
||||
void
|
||||
getvcol(wp, pos, start, cursor, end)
|
||||
win_T *wp;
|
||||
pos_T *pos;
|
||||
colnr_T *start;
|
||||
colnr_T *cursor;
|
||||
colnr_T *end;
|
||||
getvcol(
|
||||
win_T *wp,
|
||||
pos_T *pos,
|
||||
colnr_T *start,
|
||||
colnr_T *cursor,
|
||||
colnr_T *end)
|
||||
{
|
||||
colnr_T vcol;
|
||||
char_u *ptr; /* points to current char */
|
||||
@ -1446,8 +1408,7 @@ getvcol(wp, pos, start, cursor, end)
|
||||
* Get virtual cursor column in the current window, pretending 'list' is off.
|
||||
*/
|
||||
colnr_T
|
||||
getvcol_nolist(posp)
|
||||
pos_T *posp;
|
||||
getvcol_nolist(pos_T *posp)
|
||||
{
|
||||
int list_save = curwin->w_p_list;
|
||||
colnr_T vcol;
|
||||
@ -1463,12 +1424,12 @@ getvcol_nolist(posp)
|
||||
* Get virtual column in virtual mode.
|
||||
*/
|
||||
void
|
||||
getvvcol(wp, pos, start, cursor, end)
|
||||
win_T *wp;
|
||||
pos_T *pos;
|
||||
colnr_T *start;
|
||||
colnr_T *cursor;
|
||||
colnr_T *end;
|
||||
getvvcol(
|
||||
win_T *wp,
|
||||
pos_T *pos,
|
||||
colnr_T *start,
|
||||
colnr_T *cursor,
|
||||
colnr_T *end)
|
||||
{
|
||||
colnr_T col;
|
||||
colnr_T coladd;
|
||||
@ -1519,10 +1480,12 @@ getvvcol(wp, pos, start, cursor, end)
|
||||
* Used for Visual block mode.
|
||||
*/
|
||||
void
|
||||
getvcols(wp, pos1, pos2, left, right)
|
||||
win_T *wp;
|
||||
pos_T *pos1, *pos2;
|
||||
colnr_T *left, *right;
|
||||
getvcols(
|
||||
win_T *wp,
|
||||
pos_T *pos1,
|
||||
pos_T *pos2,
|
||||
colnr_T *left,
|
||||
colnr_T *right)
|
||||
{
|
||||
colnr_T from1, from2, to1, to2;
|
||||
|
||||
@ -1555,8 +1518,7 @@ getvcols(wp, pos1, pos2, left, right)
|
||||
* skipwhite: skip over ' ' and '\t'.
|
||||
*/
|
||||
char_u *
|
||||
skipwhite(q)
|
||||
char_u *q;
|
||||
skipwhite(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@ -1569,8 +1531,7 @@ skipwhite(q)
|
||||
* skip over digits
|
||||
*/
|
||||
char_u *
|
||||
skipdigits(q)
|
||||
char_u *q;
|
||||
skipdigits(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@ -1584,8 +1545,7 @@ skipdigits(q)
|
||||
* skip over binary digits
|
||||
*/
|
||||
char_u *
|
||||
skipbin(q)
|
||||
char_u *q;
|
||||
skipbin(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@ -1598,8 +1558,7 @@ skipbin(q)
|
||||
* skip over digits and hex characters
|
||||
*/
|
||||
char_u *
|
||||
skiphex(q)
|
||||
char_u *q;
|
||||
skiphex(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@ -1614,8 +1573,7 @@ skiphex(q)
|
||||
* skip to bin digit (or NUL after the string)
|
||||
*/
|
||||
char_u *
|
||||
skiptobin(q)
|
||||
char_u *q;
|
||||
skiptobin(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@ -1628,8 +1586,7 @@ skiptobin(q)
|
||||
* skip to digit (or NUL after the string)
|
||||
*/
|
||||
char_u *
|
||||
skiptodigit(q)
|
||||
char_u *q;
|
||||
skiptodigit(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@ -1642,8 +1599,7 @@ skiptodigit(q)
|
||||
* skip to hex character (or NUL after the string)
|
||||
*/
|
||||
char_u *
|
||||
skiptohex(q)
|
||||
char_u *q;
|
||||
skiptohex(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@ -1660,8 +1616,7 @@ skiptohex(q)
|
||||
* Use the VIM_ISDIGIT() macro for simple arguments.
|
||||
*/
|
||||
int
|
||||
vim_isdigit(c)
|
||||
int c;
|
||||
vim_isdigit(int c)
|
||||
{
|
||||
return (c >= '0' && c <= '9');
|
||||
}
|
||||
@ -1672,8 +1627,7 @@ vim_isdigit(c)
|
||||
* superscript 1 to be a digit.
|
||||
*/
|
||||
int
|
||||
vim_isxdigit(c)
|
||||
int c;
|
||||
vim_isxdigit(int c)
|
||||
{
|
||||
return (c >= '0' && c <= '9')
|
||||
|| (c >= 'a' && c <= 'f')
|
||||
@ -1685,8 +1639,7 @@ vim_isxdigit(c)
|
||||
* characters > 0x100.
|
||||
*/
|
||||
int
|
||||
vim_isbdigit(c)
|
||||
int c;
|
||||
vim_isbdigit(int c)
|
||||
{
|
||||
return (c == '0' || c == '1');
|
||||
}
|
||||
@ -1706,8 +1659,7 @@ static char_u latin1upper[257] = " !\"#$%&'()*+,
|
||||
static char_u latin1lower[257] = " !\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xd7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
|
||||
|
||||
int
|
||||
vim_islower(c)
|
||||
int c;
|
||||
vim_islower(int c)
|
||||
{
|
||||
if (c <= '@')
|
||||
return FALSE;
|
||||
@ -1731,8 +1683,7 @@ vim_islower(c)
|
||||
}
|
||||
|
||||
int
|
||||
vim_isupper(c)
|
||||
int c;
|
||||
vim_isupper(int c)
|
||||
{
|
||||
if (c <= '@')
|
||||
return FALSE;
|
||||
@ -1756,8 +1707,7 @@ vim_isupper(c)
|
||||
}
|
||||
|
||||
int
|
||||
vim_toupper(c)
|
||||
int c;
|
||||
vim_toupper(int c)
|
||||
{
|
||||
if (c <= '@')
|
||||
return c;
|
||||
@ -1781,8 +1731,7 @@ vim_toupper(c)
|
||||
}
|
||||
|
||||
int
|
||||
vim_tolower(c)
|
||||
int c;
|
||||
vim_tolower(int c)
|
||||
{
|
||||
if (c <= '@')
|
||||
return c;
|
||||
@ -1810,8 +1759,7 @@ vim_tolower(c)
|
||||
* skiptowhite: skip over text until ' ' or '\t' or NUL.
|
||||
*/
|
||||
char_u *
|
||||
skiptowhite(p)
|
||||
char_u *p;
|
||||
skiptowhite(char_u *p)
|
||||
{
|
||||
while (*p != ' ' && *p != '\t' && *p != NUL)
|
||||
++p;
|
||||
@ -1824,8 +1772,7 @@ skiptowhite(p)
|
||||
* skiptowhite_esc: Like skiptowhite(), but also skip escaped chars
|
||||
*/
|
||||
char_u *
|
||||
skiptowhite_esc(p)
|
||||
char_u *p;
|
||||
skiptowhite_esc(char_u *p)
|
||||
{
|
||||
while (*p != ' ' && *p != '\t' && *p != NUL)
|
||||
{
|
||||
@ -1842,8 +1789,7 @@ skiptowhite_esc(p)
|
||||
* Note: the argument is a pointer to a char_u pointer!
|
||||
*/
|
||||
long
|
||||
getdigits(pp)
|
||||
char_u **pp;
|
||||
getdigits(char_u **pp)
|
||||
{
|
||||
char_u *p;
|
||||
long retval;
|
||||
@ -1861,8 +1807,7 @@ getdigits(pp)
|
||||
* Return TRUE if "lbuf" is empty or only contains blanks.
|
||||
*/
|
||||
int
|
||||
vim_isblankline(lbuf)
|
||||
char_u *lbuf;
|
||||
vim_isblankline(char_u *lbuf)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@ -1890,16 +1835,16 @@ vim_isblankline(lbuf)
|
||||
* If maxlen > 0, check at a maximum maxlen chars
|
||||
*/
|
||||
void
|
||||
vim_str2nr(start, prep, len, what, nptr, unptr, maxlen)
|
||||
char_u *start;
|
||||
int *prep; /* return: type of number 0 = decimal, 'x'
|
||||
vim_str2nr(
|
||||
char_u *start,
|
||||
int *prep, /* return: type of number 0 = decimal, 'x'
|
||||
or 'X' is hex, '0' = octal, 'b' or 'B'
|
||||
is bin */
|
||||
int *len; /* return: detected length of number */
|
||||
int what; /* what numbers to recognize */
|
||||
long *nptr; /* return: signed result */
|
||||
unsigned long *unptr; /* return: unsigned result */
|
||||
int maxlen; /* max length of string to check */
|
||||
int *len, /* return: detected length of number */
|
||||
int what, /* what numbers to recognize */
|
||||
long *nptr, /* return: signed result */
|
||||
unsigned long *unptr, /* return: unsigned result */
|
||||
int maxlen) /* max length of string to check */
|
||||
{
|
||||
char_u *ptr = start;
|
||||
int pre = 0; /* default is decimal */
|
||||
@ -2024,8 +1969,7 @@ vim_str2nr(start, prep, len, what, nptr, unptr, maxlen)
|
||||
* Only valid when the argument is '0' - '9', 'A' - 'F' or 'a' - 'f'.
|
||||
*/
|
||||
int
|
||||
hex2nr(c)
|
||||
int c;
|
||||
hex2nr(int c)
|
||||
{
|
||||
if (c >= 'a' && c <= 'f')
|
||||
return c - 'a' + 10;
|
||||
@ -2041,8 +1985,7 @@ hex2nr(c)
|
||||
* Return -1 if one of the characters is not hex.
|
||||
*/
|
||||
int
|
||||
hexhex2nr(p)
|
||||
char_u *p;
|
||||
hexhex2nr(char_u *p)
|
||||
{
|
||||
if (!vim_isxdigit(p[0]) || !vim_isxdigit(p[1]))
|
||||
return -1;
|
||||
@ -2064,8 +2007,7 @@ hexhex2nr(p)
|
||||
* characters.
|
||||
*/
|
||||
int
|
||||
rem_backslash(str)
|
||||
char_u *str;
|
||||
rem_backslash(char_u *str)
|
||||
{
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
return (str[0] == '\\'
|
||||
@ -2088,8 +2030,7 @@ rem_backslash(str)
|
||||
* is not a normal file character.
|
||||
*/
|
||||
void
|
||||
backslash_halve(p)
|
||||
char_u *p;
|
||||
backslash_halve(char_u *p)
|
||||
{
|
||||
for ( ; *p; ++p)
|
||||
if (rem_backslash(p))
|
||||
@ -2100,8 +2041,7 @@ backslash_halve(p)
|
||||
* backslash_halve() plus save the result in allocated memory.
|
||||
*/
|
||||
char_u *
|
||||
backslash_halve_save(p)
|
||||
char_u *p;
|
||||
backslash_halve_save(char_u *p)
|
||||
{
|
||||
char_u *res;
|
||||
|
||||
@ -2159,9 +2099,7 @@ static char_u ebcdic2ascii_tab[256] =
|
||||
* wanting 7-bit ASCII characters out the other end.
|
||||
*/
|
||||
void
|
||||
ebcdic2ascii(buffer, len)
|
||||
char_u *buffer;
|
||||
int len;
|
||||
ebcdic2ascii(char_u *buffer, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
138
src/crypt.c
138
src/crypt.c
@ -130,8 +130,7 @@ static char crypt_magic_head[] = "VimCrypt~";
|
||||
* 2 for "blowfish2".
|
||||
*/
|
||||
int
|
||||
crypt_method_nr_from_name(name)
|
||||
char_u *name;
|
||||
crypt_method_nr_from_name(char_u *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -147,9 +146,7 @@ crypt_method_nr_from_name(name)
|
||||
* Returns -1 when no encryption used.
|
||||
*/
|
||||
int
|
||||
crypt_method_nr_from_magic(ptr, len)
|
||||
char *ptr;
|
||||
int len;
|
||||
crypt_method_nr_from_magic(char *ptr, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -171,8 +168,7 @@ crypt_method_nr_from_magic(ptr, len)
|
||||
* Return TRUE if the crypt method for "method_nr" can be done in-place.
|
||||
*/
|
||||
int
|
||||
crypt_works_inplace(state)
|
||||
cryptstate_T *state;
|
||||
crypt_works_inplace(cryptstate_T *state)
|
||||
{
|
||||
return cryptmethods[state->method_nr].works_inplace;
|
||||
}
|
||||
@ -181,8 +177,7 @@ crypt_works_inplace(state)
|
||||
* Get the crypt method for buffer "buf" as a number.
|
||||
*/
|
||||
int
|
||||
crypt_get_method_nr(buf)
|
||||
buf_T *buf;
|
||||
crypt_get_method_nr(buf_T *buf)
|
||||
{
|
||||
return crypt_method_nr_from_name(*buf->b_p_cm == NUL ? p_cm : buf->b_p_cm);
|
||||
}
|
||||
@ -192,8 +187,7 @@ crypt_get_method_nr(buf)
|
||||
* whole undo file, not only the text.
|
||||
*/
|
||||
int
|
||||
crypt_whole_undofile(method_nr)
|
||||
int method_nr;
|
||||
crypt_whole_undofile(int method_nr)
|
||||
{
|
||||
return cryptmethods[method_nr].whole_undofile;
|
||||
}
|
||||
@ -202,8 +196,7 @@ crypt_whole_undofile(method_nr)
|
||||
* Get crypt method specifc length of the file header in bytes.
|
||||
*/
|
||||
int
|
||||
crypt_get_header_len(method_nr)
|
||||
int method_nr;
|
||||
crypt_get_header_len(int method_nr)
|
||||
{
|
||||
return CRYPT_MAGIC_LEN
|
||||
+ cryptmethods[method_nr].salt_len
|
||||
@ -215,9 +208,7 @@ crypt_get_header_len(method_nr)
|
||||
* returned by crypt_method_nr_from_name().
|
||||
*/
|
||||
void
|
||||
crypt_set_cm_option(buf, method_nr)
|
||||
buf_T *buf;
|
||||
int method_nr;
|
||||
crypt_set_cm_option(buf_T *buf, int method_nr)
|
||||
{
|
||||
free_string_option(buf->b_p_cm);
|
||||
buf->b_p_cm = vim_strsave((char_u *)cryptmethods[method_nr].name);
|
||||
@ -228,7 +219,7 @@ crypt_set_cm_option(buf, method_nr)
|
||||
* return OK/FAIL.
|
||||
*/
|
||||
int
|
||||
crypt_self_test()
|
||||
crypt_self_test(void)
|
||||
{
|
||||
int method_nr = crypt_get_method_nr(curbuf);
|
||||
|
||||
@ -241,13 +232,13 @@ crypt_self_test()
|
||||
* Allocate a crypt state and initialize it.
|
||||
*/
|
||||
cryptstate_T *
|
||||
crypt_create(method_nr, key, salt, salt_len, seed, seed_len)
|
||||
int method_nr;
|
||||
char_u *key;
|
||||
char_u *salt;
|
||||
int salt_len;
|
||||
char_u *seed;
|
||||
int seed_len;
|
||||
crypt_create(
|
||||
int method_nr,
|
||||
char_u *key,
|
||||
char_u *salt,
|
||||
int salt_len,
|
||||
char_u *seed,
|
||||
int seed_len)
|
||||
{
|
||||
cryptstate_T *state = (cryptstate_T *)alloc((int)sizeof(cryptstate_T));
|
||||
|
||||
@ -262,10 +253,10 @@ crypt_create(method_nr, key, salt, salt_len, seed, seed_len)
|
||||
* crypt_get_header_len() returns for "method_nr".
|
||||
*/
|
||||
cryptstate_T *
|
||||
crypt_create_from_header(method_nr, key, header)
|
||||
int method_nr;
|
||||
char_u *key;
|
||||
char_u *header;
|
||||
crypt_create_from_header(
|
||||
int method_nr,
|
||||
char_u *key,
|
||||
char_u *header)
|
||||
{
|
||||
char_u *salt = NULL;
|
||||
char_u *seed = NULL;
|
||||
@ -285,9 +276,7 @@ crypt_create_from_header(method_nr, key, header)
|
||||
* Return an allocated cryptstate_T or NULL on error.
|
||||
*/
|
||||
cryptstate_T *
|
||||
crypt_create_from_file(fp, key)
|
||||
FILE *fp;
|
||||
char_u *key;
|
||||
crypt_create_from_file(FILE *fp, char_u *key)
|
||||
{
|
||||
int method_nr;
|
||||
int header_len;
|
||||
@ -326,11 +315,11 @@ crypt_create_from_file(fp, key)
|
||||
* Returns the state or NULL on failure.
|
||||
*/
|
||||
cryptstate_T *
|
||||
crypt_create_for_writing(method_nr, key, header, header_len)
|
||||
int method_nr;
|
||||
char_u *key;
|
||||
char_u **header;
|
||||
int *header_len;
|
||||
crypt_create_for_writing(
|
||||
int method_nr,
|
||||
char_u *key,
|
||||
char_u **header,
|
||||
int *header_len)
|
||||
{
|
||||
int len = crypt_get_header_len(method_nr);
|
||||
char_u *salt = NULL;
|
||||
@ -371,8 +360,7 @@ crypt_create_for_writing(method_nr, key, header, header_len)
|
||||
* Free the crypt state.
|
||||
*/
|
||||
void
|
||||
crypt_free_state(state)
|
||||
cryptstate_T *state;
|
||||
crypt_free_state(cryptstate_T *state)
|
||||
{
|
||||
vim_free(state->method_state);
|
||||
vim_free(state);
|
||||
@ -384,11 +372,11 @@ crypt_free_state(state)
|
||||
* Return number of bytes in "newptr", 0 for need more or -1 on error.
|
||||
*/
|
||||
long
|
||||
crypt_encode_alloc(state, from, len, newptr)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u **newptr;
|
||||
crypt_encode_alloc(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u **newptr)
|
||||
{
|
||||
cryptmethod_T *method = &cryptmethods[state->method_nr];
|
||||
|
||||
@ -412,11 +400,11 @@ crypt_encode_alloc(state, from, len, newptr)
|
||||
* Return number of bytes in "newptr", 0 for need more or -1 on error.
|
||||
*/
|
||||
long
|
||||
crypt_decode_alloc(state, ptr, len, newptr)
|
||||
cryptstate_T *state;
|
||||
char_u *ptr;
|
||||
long len;
|
||||
char_u **newptr;
|
||||
crypt_decode_alloc(
|
||||
cryptstate_T *state,
|
||||
char_u *ptr,
|
||||
long len,
|
||||
char_u **newptr)
|
||||
{
|
||||
cryptmethod_T *method = &cryptmethods[state->method_nr];
|
||||
|
||||
@ -439,11 +427,11 @@ crypt_decode_alloc(state, ptr, len, newptr)
|
||||
* Encrypting "from[len]" into "to[len]".
|
||||
*/
|
||||
void
|
||||
crypt_encode(state, from, len, to)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u *to;
|
||||
crypt_encode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
{
|
||||
cryptmethods[state->method_nr].encode_fn(state, from, len, to);
|
||||
}
|
||||
@ -452,11 +440,11 @@ crypt_encode(state, from, len, to)
|
||||
* decrypting "from[len]" into "to[len]".
|
||||
*/
|
||||
void
|
||||
crypt_decode(state, from, len, to)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u *to;
|
||||
crypt_decode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
{
|
||||
cryptmethods[state->method_nr].decode_fn(state, from, len, to);
|
||||
}
|
||||
@ -465,10 +453,10 @@ crypt_decode(state, from, len, to)
|
||||
* Simple inplace encryption, modifies "buf[len]" in place.
|
||||
*/
|
||||
void
|
||||
crypt_encode_inplace(state, buf, len)
|
||||
cryptstate_T *state;
|
||||
char_u *buf;
|
||||
size_t len;
|
||||
crypt_encode_inplace(
|
||||
cryptstate_T *state,
|
||||
char_u *buf,
|
||||
size_t len)
|
||||
{
|
||||
cryptmethods[state->method_nr].encode_inplace_fn(state, buf, len, buf);
|
||||
}
|
||||
@ -477,10 +465,10 @@ crypt_encode_inplace(state, buf, len)
|
||||
* Simple inplace decryption, modifies "buf[len]" in place.
|
||||
*/
|
||||
void
|
||||
crypt_decode_inplace(state, buf, len)
|
||||
cryptstate_T *state;
|
||||
char_u *buf;
|
||||
size_t len;
|
||||
crypt_decode_inplace(
|
||||
cryptstate_T *state,
|
||||
char_u *buf,
|
||||
size_t len)
|
||||
{
|
||||
cryptmethods[state->method_nr].decode_inplace_fn(state, buf, len, buf);
|
||||
}
|
||||
@ -490,8 +478,7 @@ crypt_decode_inplace(state, buf, len)
|
||||
* in memory anywhere.
|
||||
*/
|
||||
void
|
||||
crypt_free_key(key)
|
||||
char_u *key;
|
||||
crypt_free_key(char_u *key)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@ -507,8 +494,7 @@ crypt_free_key(key)
|
||||
* Check the crypt method and give a warning if it's outdated.
|
||||
*/
|
||||
void
|
||||
crypt_check_method(method)
|
||||
int method;
|
||||
crypt_check_method(int method)
|
||||
{
|
||||
if (method < CRYPT_M_BF2)
|
||||
{
|
||||
@ -518,7 +504,7 @@ crypt_check_method(method)
|
||||
}
|
||||
|
||||
void
|
||||
crypt_check_current_method()
|
||||
crypt_check_current_method(void)
|
||||
{
|
||||
crypt_check_method(crypt_get_method_nr(curbuf));
|
||||
}
|
||||
@ -531,9 +517,9 @@ crypt_check_current_method()
|
||||
* Returns NULL on failure.
|
||||
*/
|
||||
char_u *
|
||||
crypt_get_key(store, twice)
|
||||
int store;
|
||||
int twice; /* Ask for the key twice. */
|
||||
crypt_get_key(
|
||||
int store,
|
||||
int twice) /* Ask for the key twice. */
|
||||
{
|
||||
char_u *p1, *p2 = NULL;
|
||||
int round;
|
||||
@ -589,8 +575,8 @@ crypt_get_key(store, twice)
|
||||
* Append a message to IObuff for the encryption/decryption method being used.
|
||||
*/
|
||||
void
|
||||
crypt_append_msg(buf)
|
||||
buf_T *buf;
|
||||
crypt_append_msg(
|
||||
buf_T *buf)
|
||||
{
|
||||
if (crypt_get_method_nr(buf) == 0)
|
||||
STRCAT(IObuff, _("[crypted]"));
|
||||
|
@ -44,7 +44,7 @@ static u32_T crc_32_table[256];
|
||||
* Fill the CRC table, if not done already.
|
||||
*/
|
||||
static void
|
||||
make_crc_tab()
|
||||
make_crc_tab(void)
|
||||
{
|
||||
u32_T s, t, v;
|
||||
static int done = FALSE;
|
||||
@ -85,13 +85,13 @@ make_crc_tab()
|
||||
* Initialize for encryption/decryption.
|
||||
*/
|
||||
void
|
||||
crypt_zip_init(state, key, salt, salt_len, seed, seed_len)
|
||||
cryptstate_T *state;
|
||||
char_u *key;
|
||||
char_u *salt UNUSED;
|
||||
int salt_len UNUSED;
|
||||
char_u *seed UNUSED;
|
||||
int seed_len UNUSED;
|
||||
crypt_zip_init(
|
||||
cryptstate_T *state,
|
||||
char_u *key,
|
||||
char_u *salt UNUSED,
|
||||
int salt_len UNUSED,
|
||||
char_u *seed UNUSED,
|
||||
int seed_len UNUSED)
|
||||
{
|
||||
char_u *p;
|
||||
zip_state_T *zs;
|
||||
@ -114,11 +114,11 @@ crypt_zip_init(state, key, salt, salt_len, seed, seed_len)
|
||||
* "from" and "to" can be equal to encrypt in place.
|
||||
*/
|
||||
void
|
||||
crypt_zip_encode(state, from, len, to)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u *to;
|
||||
crypt_zip_encode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
{
|
||||
zip_state_T *zs = state->method_state;
|
||||
size_t i;
|
||||
@ -137,11 +137,11 @@ crypt_zip_encode(state, from, len, to)
|
||||
* Decrypt "from[len]" into "to[len]".
|
||||
*/
|
||||
void
|
||||
crypt_zip_decode(state, from, len, to)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u *to;
|
||||
crypt_zip_decode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
{
|
||||
zip_state_T *zs = state->method_state;
|
||||
size_t i;
|
||||
|
186
src/diff.c
186
src/diff.c
@ -60,8 +60,7 @@ static diff_T *diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp);
|
||||
* Called when deleting or unloading a buffer: No longer make a diff with it.
|
||||
*/
|
||||
void
|
||||
diff_buf_delete(buf)
|
||||
buf_T *buf;
|
||||
diff_buf_delete(buf_T *buf)
|
||||
{
|
||||
int i;
|
||||
tabpage_T *tp;
|
||||
@ -84,8 +83,7 @@ diff_buf_delete(buf)
|
||||
* diff buffers.
|
||||
*/
|
||||
void
|
||||
diff_buf_adjust(win)
|
||||
win_T *win;
|
||||
diff_buf_adjust(win_T *win)
|
||||
{
|
||||
win_T *wp;
|
||||
int i;
|
||||
@ -121,8 +119,7 @@ diff_buf_adjust(win)
|
||||
* about the screen contents.
|
||||
*/
|
||||
void
|
||||
diff_buf_add(buf)
|
||||
buf_T *buf;
|
||||
diff_buf_add(buf_T *buf)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -146,8 +143,7 @@ diff_buf_add(buf)
|
||||
* Return its index or DB_COUNT if not found.
|
||||
*/
|
||||
static int
|
||||
diff_buf_idx(buf)
|
||||
buf_T *buf;
|
||||
diff_buf_idx(buf_T *buf)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@ -162,9 +158,7 @@ diff_buf_idx(buf)
|
||||
* Return its index or DB_COUNT if not found.
|
||||
*/
|
||||
static int
|
||||
diff_buf_idx_tp(buf, tp)
|
||||
buf_T *buf;
|
||||
tabpage_T *tp;
|
||||
diff_buf_idx_tp(buf_T *buf, tabpage_T *tp)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@ -179,8 +173,7 @@ diff_buf_idx_tp(buf, tp)
|
||||
* when info is requested.
|
||||
*/
|
||||
void
|
||||
diff_invalidate(buf)
|
||||
buf_T *buf;
|
||||
diff_invalidate(buf_T *buf)
|
||||
{
|
||||
tabpage_T *tp;
|
||||
int i;
|
||||
@ -201,11 +194,11 @@ diff_invalidate(buf)
|
||||
* Called by mark_adjust(): update line numbers in "curbuf".
|
||||
*/
|
||||
void
|
||||
diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
linenr_T line1;
|
||||
linenr_T line2;
|
||||
long amount;
|
||||
long amount_after;
|
||||
diff_mark_adjust(
|
||||
linenr_T line1,
|
||||
linenr_T line2,
|
||||
long amount,
|
||||
long amount_after)
|
||||
{
|
||||
int idx;
|
||||
tabpage_T *tp;
|
||||
@ -227,13 +220,13 @@ diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
* When inserting/deleting lines in existing change blocks, update them.
|
||||
*/
|
||||
static void
|
||||
diff_mark_adjust_tp(tp, idx, line1, line2, amount, amount_after)
|
||||
tabpage_T *tp;
|
||||
int idx;
|
||||
linenr_T line1;
|
||||
linenr_T line2;
|
||||
long amount;
|
||||
long amount_after;
|
||||
diff_mark_adjust_tp(
|
||||
tabpage_T *tp,
|
||||
int idx,
|
||||
linenr_T line1,
|
||||
linenr_T line2,
|
||||
long amount,
|
||||
long amount_after)
|
||||
{
|
||||
diff_T *dp;
|
||||
diff_T *dprev;
|
||||
@ -479,10 +472,7 @@ diff_mark_adjust_tp(tp, idx, line1, line2, amount, amount_after)
|
||||
* Allocate a new diff block and link it between "dprev" and "dp".
|
||||
*/
|
||||
static diff_T *
|
||||
diff_alloc_new(tp, dprev, dp)
|
||||
tabpage_T *tp;
|
||||
diff_T *dprev;
|
||||
diff_T *dp;
|
||||
diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp)
|
||||
{
|
||||
diff_T *dnew;
|
||||
|
||||
@ -505,9 +495,7 @@ diff_alloc_new(tp, dprev, dp)
|
||||
* must take care of removing it.
|
||||
*/
|
||||
static void
|
||||
diff_check_unchanged(tp, dp)
|
||||
tabpage_T *tp;
|
||||
diff_T *dp;
|
||||
diff_check_unchanged(tabpage_T *tp, diff_T *dp)
|
||||
{
|
||||
int i_org;
|
||||
int i_new;
|
||||
@ -581,9 +569,7 @@ diff_check_unchanged(tp, dp)
|
||||
* This can happen when the diff program returns invalid results.
|
||||
*/
|
||||
static int
|
||||
diff_check_sanity(tp, dp)
|
||||
tabpage_T *tp;
|
||||
diff_T *dp;
|
||||
diff_check_sanity(tabpage_T *tp, diff_T *dp)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -599,8 +585,8 @@ diff_check_sanity(tp, dp)
|
||||
* Mark all diff buffers in the current tab page for redraw.
|
||||
*/
|
||||
static void
|
||||
diff_redraw(dofold)
|
||||
int dofold; /* also recompute the folds */
|
||||
diff_redraw(
|
||||
int dofold) /* also recompute the folds */
|
||||
{
|
||||
win_T *wp;
|
||||
int n;
|
||||
@ -633,9 +619,7 @@ diff_redraw(dofold)
|
||||
* Return FAIL for failure
|
||||
*/
|
||||
static int
|
||||
diff_write(buf, fname)
|
||||
buf_T *buf;
|
||||
char_u *fname;
|
||||
diff_write(buf_T *buf, char_u *fname)
|
||||
{
|
||||
int r;
|
||||
char_u *save_ff;
|
||||
@ -656,8 +640,8 @@ diff_write(buf, fname)
|
||||
* could have been produced by autocommands, e.g. the netrw plugin).
|
||||
*/
|
||||
void
|
||||
ex_diffupdate(eap)
|
||||
exarg_T *eap UNUSED; /* can be NULL */
|
||||
ex_diffupdate(
|
||||
exarg_T *eap UNUSED) /* can be NULL */
|
||||
{
|
||||
buf_T *buf;
|
||||
int idx_orig;
|
||||
@ -832,10 +816,10 @@ theend:
|
||||
* Make a diff between files "tmp_orig" and "tmp_new", results in "tmp_diff".
|
||||
*/
|
||||
static void
|
||||
diff_file(tmp_orig, tmp_new, tmp_diff)
|
||||
char_u *tmp_orig;
|
||||
char_u *tmp_new;
|
||||
char_u *tmp_diff;
|
||||
diff_file(
|
||||
char_u *tmp_orig,
|
||||
char_u *tmp_new,
|
||||
char_u *tmp_diff)
|
||||
{
|
||||
char_u *cmd;
|
||||
size_t len;
|
||||
@ -888,8 +872,7 @@ diff_file(tmp_orig, tmp_new, tmp_diff)
|
||||
* could have been produced by autocommands, e.g. the netrw plugin).
|
||||
*/
|
||||
void
|
||||
ex_diffpatch(eap)
|
||||
exarg_T *eap;
|
||||
ex_diffpatch(exarg_T *eap)
|
||||
{
|
||||
char_u *tmp_orig; /* name of original temp file */
|
||||
char_u *tmp_new; /* name of patched temp file */
|
||||
@ -1083,8 +1066,7 @@ theend:
|
||||
* Split the window and edit another file, setting options to show the diffs.
|
||||
*/
|
||||
void
|
||||
ex_diffsplit(eap)
|
||||
exarg_T *eap;
|
||||
ex_diffsplit(exarg_T *eap)
|
||||
{
|
||||
win_T *old_curwin = curwin;
|
||||
buf_T *old_curbuf = curbuf;
|
||||
@ -1126,8 +1108,7 @@ ex_diffsplit(eap)
|
||||
* Set options to show diffs for the current window.
|
||||
*/
|
||||
void
|
||||
ex_diffthis(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
ex_diffthis(exarg_T *eap UNUSED)
|
||||
{
|
||||
/* Set 'diff', 'scrollbind' on and 'wrap' off. */
|
||||
diff_win_options(curwin, TRUE);
|
||||
@ -1137,9 +1118,9 @@ ex_diffthis(eap)
|
||||
* Set options in window "wp" for diff mode.
|
||||
*/
|
||||
void
|
||||
diff_win_options(wp, addbuf)
|
||||
win_T *wp;
|
||||
int addbuf; /* Add buffer to diff. */
|
||||
diff_win_options(
|
||||
win_T *wp,
|
||||
int addbuf) /* Add buffer to diff. */
|
||||
{
|
||||
# ifdef FEAT_FOLDING
|
||||
win_T *old_curwin = curwin;
|
||||
@ -1209,8 +1190,7 @@ diff_win_options(wp, addbuf)
|
||||
* Only in the current tab page.
|
||||
*/
|
||||
void
|
||||
ex_diffoff(eap)
|
||||
exarg_T *eap;
|
||||
ex_diffoff(exarg_T *eap)
|
||||
{
|
||||
win_T *wp;
|
||||
#ifdef FEAT_SCROLLBIND
|
||||
@ -1279,10 +1259,10 @@ ex_diffoff(eap)
|
||||
* Read the diff output and add each entry to the diff list.
|
||||
*/
|
||||
static void
|
||||
diff_read(idx_orig, idx_new, fname)
|
||||
int idx_orig; /* idx of original file */
|
||||
int idx_new; /* idx of new file */
|
||||
char_u *fname; /* name of diff output file */
|
||||
diff_read(
|
||||
int idx_orig, /* idx of original file */
|
||||
int idx_new, /* idx of new file */
|
||||
char_u *fname) /* name of diff output file */
|
||||
{
|
||||
FILE *fd;
|
||||
diff_T *dprev = NULL;
|
||||
@ -1473,11 +1453,11 @@ done:
|
||||
* Copy an entry at "dp" from "idx_orig" to "idx_new".
|
||||
*/
|
||||
static void
|
||||
diff_copy_entry(dprev, dp, idx_orig, idx_new)
|
||||
diff_T *dprev;
|
||||
diff_T *dp;
|
||||
int idx_orig;
|
||||
int idx_new;
|
||||
diff_copy_entry(
|
||||
diff_T *dprev,
|
||||
diff_T *dp,
|
||||
int idx_orig,
|
||||
int idx_new)
|
||||
{
|
||||
long off;
|
||||
|
||||
@ -1494,8 +1474,7 @@ diff_copy_entry(dprev, dp, idx_orig, idx_new)
|
||||
* Clear the list of diffblocks for tab page "tp".
|
||||
*/
|
||||
void
|
||||
diff_clear(tp)
|
||||
tabpage_T *tp;
|
||||
diff_clear(tabpage_T *tp)
|
||||
{
|
||||
diff_T *p, *next_p;
|
||||
|
||||
@ -1517,9 +1496,7 @@ diff_clear(tp)
|
||||
* This should only be used for windows where 'diff' is set.
|
||||
*/
|
||||
int
|
||||
diff_check(wp, lnum)
|
||||
win_T *wp;
|
||||
linenr_T lnum;
|
||||
diff_check(win_T *wp, linenr_T lnum)
|
||||
{
|
||||
int idx; /* index in tp_diffbuf[] for this buffer */
|
||||
diff_T *dp;
|
||||
@ -1611,10 +1588,7 @@ diff_check(wp, lnum)
|
||||
* Compare two entries in diff "*dp" and return TRUE if they are equal.
|
||||
*/
|
||||
static int
|
||||
diff_equal_entry(dp, idx1, idx2)
|
||||
diff_T *dp;
|
||||
int idx1;
|
||||
int idx2;
|
||||
diff_equal_entry(diff_T *dp, int idx1, int idx2)
|
||||
{
|
||||
int i;
|
||||
char_u *line;
|
||||
@ -1644,9 +1618,7 @@ diff_equal_entry(dp, idx1, idx2)
|
||||
* Return non-zero when they are different.
|
||||
*/
|
||||
static int
|
||||
diff_cmp(s1, s2)
|
||||
char_u *s1;
|
||||
char_u *s2;
|
||||
diff_cmp(char_u *s1, char_u *s2)
|
||||
{
|
||||
char_u *p1, *p2;
|
||||
#ifdef FEAT_MBYTE
|
||||
@ -1709,9 +1681,7 @@ diff_cmp(s1, s2)
|
||||
* Return the number of filler lines above "lnum".
|
||||
*/
|
||||
int
|
||||
diff_check_fill(wp, lnum)
|
||||
win_T *wp;
|
||||
linenr_T lnum;
|
||||
diff_check_fill(win_T *wp, linenr_T lnum)
|
||||
{
|
||||
int n;
|
||||
|
||||
@ -1729,9 +1699,7 @@ diff_check_fill(wp, lnum)
|
||||
* show the same diff'ed lines.
|
||||
*/
|
||||
void
|
||||
diff_set_topline(fromwin, towin)
|
||||
win_T *fromwin;
|
||||
win_T *towin;
|
||||
diff_set_topline(win_T *fromwin, win_T *towin)
|
||||
{
|
||||
buf_T *frombuf = fromwin->w_buffer;
|
||||
linenr_T lnum = fromwin->w_topline;
|
||||
@ -1851,7 +1819,7 @@ diff_set_topline(fromwin, towin)
|
||||
* This is called when 'diffopt' is changed.
|
||||
*/
|
||||
int
|
||||
diffopt_changed()
|
||||
diffopt_changed(void)
|
||||
{
|
||||
char_u *p;
|
||||
int diff_context_new = 6;
|
||||
@ -1929,7 +1897,7 @@ diffopt_changed()
|
||||
* Return TRUE if 'diffopt' contains "horizontal".
|
||||
*/
|
||||
int
|
||||
diffopt_horizontal()
|
||||
diffopt_horizontal(void)
|
||||
{
|
||||
return (diff_flags & DIFF_HORIZONTAL) != 0;
|
||||
}
|
||||
@ -1939,11 +1907,11 @@ diffopt_horizontal()
|
||||
* Returns TRUE if the line was added, no other buffer has it.
|
||||
*/
|
||||
int
|
||||
diff_find_change(wp, lnum, startp, endp)
|
||||
win_T *wp;
|
||||
linenr_T lnum;
|
||||
int *startp; /* first char of the change */
|
||||
int *endp; /* last char of the change */
|
||||
diff_find_change(
|
||||
win_T *wp,
|
||||
linenr_T lnum,
|
||||
int *startp, /* first char of the change */
|
||||
int *endp) /* last char of the change */
|
||||
{
|
||||
char_u *line_org;
|
||||
char_u *line_new;
|
||||
@ -2063,9 +2031,7 @@ diff_find_change(wp, lnum, startp, endp)
|
||||
* Return FALSE if there are no diff blocks at all in this window.
|
||||
*/
|
||||
int
|
||||
diff_infold(wp, lnum)
|
||||
win_T *wp;
|
||||
linenr_T lnum;
|
||||
diff_infold(win_T *wp, linenr_T lnum)
|
||||
{
|
||||
int i;
|
||||
int idx = -1;
|
||||
@ -2112,9 +2078,7 @@ diff_infold(wp, lnum)
|
||||
* "dp" and "do" commands.
|
||||
*/
|
||||
void
|
||||
nv_diffgetput(put, count)
|
||||
int put;
|
||||
long count;
|
||||
nv_diffgetput(int put, long count)
|
||||
{
|
||||
exarg_T ea;
|
||||
char_u buf[30];
|
||||
@ -2141,8 +2105,7 @@ nv_diffgetput(put, count)
|
||||
* ":diffput"
|
||||
*/
|
||||
void
|
||||
ex_diffgetput(eap)
|
||||
exarg_T *eap;
|
||||
ex_diffgetput(exarg_T *eap)
|
||||
{
|
||||
linenr_T lnum;
|
||||
int count;
|
||||
@ -2464,9 +2427,7 @@ ex_diffgetput(eap)
|
||||
* When there are no diffs, all folds are removed.
|
||||
*/
|
||||
static void
|
||||
diff_fold_update(dp, skip_idx)
|
||||
diff_T *dp;
|
||||
int skip_idx;
|
||||
diff_fold_update(diff_T *dp, int skip_idx)
|
||||
{
|
||||
int i;
|
||||
win_T *wp;
|
||||
@ -2483,8 +2444,7 @@ diff_fold_update(dp, skip_idx)
|
||||
* Return TRUE if buffer "buf" is in diff-mode.
|
||||
*/
|
||||
int
|
||||
diff_mode_buf(buf)
|
||||
buf_T *buf;
|
||||
diff_mode_buf(buf_T *buf)
|
||||
{
|
||||
tabpage_T *tp;
|
||||
|
||||
@ -2499,9 +2459,7 @@ diff_mode_buf(buf)
|
||||
* Return FAIL if there isn't such a diff block.
|
||||
*/
|
||||
int
|
||||
diff_move_to(dir, count)
|
||||
int dir;
|
||||
long count;
|
||||
diff_move_to(int dir, long count)
|
||||
{
|
||||
int idx;
|
||||
linenr_T lnum = curwin->w_cursor.lnum;
|
||||
@ -2554,11 +2512,11 @@ diff_move_to(dir, count)
|
||||
}
|
||||
|
||||
linenr_T
|
||||
diff_get_corresponding_line(buf1, lnum1, buf2, lnum3)
|
||||
buf_T *buf1;
|
||||
linenr_T lnum1;
|
||||
buf_T *buf2;
|
||||
linenr_T lnum3;
|
||||
diff_get_corresponding_line(
|
||||
buf_T *buf1,
|
||||
linenr_T lnum1,
|
||||
buf_T *buf2,
|
||||
linenr_T lnum3)
|
||||
{
|
||||
int idx1;
|
||||
int idx2;
|
||||
@ -2628,9 +2586,7 @@ diff_get_corresponding_line(buf1, lnum1, buf2, lnum3)
|
||||
* "wp", compensating for inserted/deleted lines.
|
||||
*/
|
||||
linenr_T
|
||||
diff_lnum_win(lnum, wp)
|
||||
linenr_T lnum;
|
||||
win_T *wp;
|
||||
diff_lnum_win(linenr_T lnum, win_T *wp)
|
||||
{
|
||||
diff_T *dp;
|
||||
int idx;
|
||||
|
@ -2013,8 +2013,7 @@ static digr_T digraphdefault[] =
|
||||
* handle digraphs after typing a character
|
||||
*/
|
||||
int
|
||||
do_digraph(c)
|
||||
int c;
|
||||
do_digraph(int c)
|
||||
{
|
||||
static int backspaced; /* character before K_BS */
|
||||
static int lastchar; /* last typed character */
|
||||
@ -2041,8 +2040,8 @@ do_digraph(c)
|
||||
* Returns composed character, or NUL when ESC was used.
|
||||
*/
|
||||
int
|
||||
get_digraph(cmdline)
|
||||
int cmdline; /* TRUE when called from the cmdline */
|
||||
get_digraph(
|
||||
int cmdline) /* TRUE when called from the cmdline */
|
||||
{
|
||||
int c, cc;
|
||||
|
||||
@ -2085,10 +2084,7 @@ get_digraph(cmdline)
|
||||
* If "meta_char" is TRUE and "char1" is a space, return "char2" | 0x80.
|
||||
*/
|
||||
static int
|
||||
getexactdigraph(char1, char2, meta_char)
|
||||
int char1;
|
||||
int char2;
|
||||
int meta_char;
|
||||
getexactdigraph(int char1, int char2, int meta_char)
|
||||
{
|
||||
int i;
|
||||
int retval = 0;
|
||||
@ -2173,10 +2169,7 @@ getexactdigraph(char1, char2, meta_char)
|
||||
* Allow for both char1-char2 and char2-char1
|
||||
*/
|
||||
int
|
||||
getdigraph(char1, char2, meta_char)
|
||||
int char1;
|
||||
int char2;
|
||||
int meta_char;
|
||||
getdigraph(int char1, int char2, int meta_char)
|
||||
{
|
||||
int retval;
|
||||
|
||||
@ -2192,8 +2185,7 @@ getdigraph(char1, char2, meta_char)
|
||||
* format: {c1}{c2} char {c1}{c2} char ...
|
||||
*/
|
||||
void
|
||||
putdigraph(str)
|
||||
char_u *str;
|
||||
putdigraph(char_u *str)
|
||||
{
|
||||
int char1, char2, n;
|
||||
int i;
|
||||
@ -2252,7 +2244,7 @@ putdigraph(str)
|
||||
}
|
||||
|
||||
void
|
||||
listdigraphs()
|
||||
listdigraphs(void)
|
||||
{
|
||||
int i;
|
||||
digr_T *dp;
|
||||
@ -2297,8 +2289,7 @@ listdigraphs()
|
||||
}
|
||||
|
||||
static void
|
||||
printdigraph(dp)
|
||||
digr_T *dp;
|
||||
printdigraph(digr_T *dp)
|
||||
{
|
||||
char_u buf[30];
|
||||
char_u *p;
|
||||
@ -2366,7 +2357,7 @@ static void keymap_unload(void);
|
||||
* checked.
|
||||
*/
|
||||
char_u *
|
||||
keymap_init()
|
||||
keymap_init(void)
|
||||
{
|
||||
curbuf->b_kmap_state &= ~KEYMAP_INIT;
|
||||
|
||||
@ -2419,8 +2410,7 @@ keymap_init()
|
||||
* ":loadkeymap" command: load the following lines as the keymap.
|
||||
*/
|
||||
void
|
||||
ex_loadkeymap(eap)
|
||||
exarg_T *eap;
|
||||
ex_loadkeymap(exarg_T *eap)
|
||||
{
|
||||
char_u *line;
|
||||
char_u *p;
|
||||
@ -2505,7 +2495,7 @@ ex_loadkeymap(eap)
|
||||
* Stop using 'keymap'.
|
||||
*/
|
||||
static void
|
||||
keymap_unload()
|
||||
keymap_unload(void)
|
||||
{
|
||||
char_u buf[KMAP_MAXLEN + 10];
|
||||
int i;
|
||||
|
512
src/edit.c
512
src/edit.c
File diff suppressed because it is too large
Load Diff
2773
src/eval.c
2773
src/eval.c
File diff suppressed because it is too large
Load Diff
@ -746,6 +746,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1205,
|
||||
/**/
|
||||
1204,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user