forked from aniani/vim
Fix compiler warnings for shadowed variables. Make 'conceal' a long instead
of int.
This commit is contained in:
@@ -39,7 +39,7 @@ typedef union {
|
|||||||
|
|
||||||
static void bf_e_block __ARGS((UINT32_T *p_xl, UINT32_T *p_xr));
|
static void bf_e_block __ARGS((UINT32_T *p_xl, UINT32_T *p_xr));
|
||||||
static void bf_e_cblock __ARGS((char_u *block));
|
static void bf_e_cblock __ARGS((char_u *block));
|
||||||
static int bf_check_tables __ARGS((UINT32_T ipa[18], UINT32_T sbi[4][256], UINT32_T val));
|
static int bf_check_tables __ARGS((UINT32_T a_ipa[18], UINT32_T a_sbi[4][256], UINT32_T val));
|
||||||
static int bf_self_test __ARGS((void));
|
static int bf_self_test __ARGS((void));
|
||||||
|
|
||||||
/* Blowfish code */
|
/* Blowfish code */
|
||||||
@@ -469,19 +469,19 @@ bf_key_init(password, salt, salt_len)
|
|||||||
* BF Self test for corrupted tables or instructions
|
* BF Self test for corrupted tables or instructions
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
bf_check_tables(ipa, sbi, val)
|
bf_check_tables(a_ipa, a_sbi, val)
|
||||||
UINT32_T ipa[18];
|
UINT32_T a_ipa[18];
|
||||||
UINT32_T sbi[4][256];
|
UINT32_T a_sbi[4][256];
|
||||||
UINT32_T val;
|
UINT32_T val;
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
UINT32_T c = 0;
|
UINT32_T c = 0;
|
||||||
|
|
||||||
for (i = 0; i < 18; i++)
|
for (i = 0; i < 18; i++)
|
||||||
c ^= ipa[i];
|
c ^= a_ipa[i];
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
for (j = 0; j < 256; j++)
|
for (j = 0; j < 256; j++)
|
||||||
c ^= sbi[i][j];
|
c ^= a_sbi[i][j];
|
||||||
return c == val;
|
return c == val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
src/eval.c
14
src/eval.c
@@ -463,7 +463,7 @@ static int get_env_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
|
|||||||
static int find_internal_func __ARGS((char_u *name));
|
static int find_internal_func __ARGS((char_u *name));
|
||||||
static char_u *deref_func_name __ARGS((char_u *name, int *lenp));
|
static char_u *deref_func_name __ARGS((char_u *name, int *lenp));
|
||||||
static int get_func_tv __ARGS((char_u *name, int len, typval_T *rettv, char_u **arg, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict));
|
static int get_func_tv __ARGS((char_u *name, int len, typval_T *rettv, char_u **arg, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict));
|
||||||
static int call_func __ARGS((char_u *func_name, int len, typval_T *rettv, int argcount, typval_T *argvars, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict));
|
static int call_func __ARGS((char_u *funcname, int len, typval_T *rettv, int argcount, typval_T *argvars, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict));
|
||||||
static void emsg_funcname __ARGS((char *ermsg, char_u *name));
|
static void emsg_funcname __ARGS((char *ermsg, char_u *name));
|
||||||
static int non_zero_arg __ARGS((typval_T *argvars));
|
static int non_zero_arg __ARGS((typval_T *argvars));
|
||||||
|
|
||||||
@@ -8074,9 +8074,9 @@ get_func_tv(name, len, rettv, arg, firstline, lastline, doesrange,
|
|||||||
* Also returns OK when an error was encountered while executing the function.
|
* Also returns OK when an error was encountered while executing the function.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
call_func(func_name, len, rettv, argcount, argvars, firstline, lastline,
|
call_func(funcname, len, rettv, argcount, argvars, firstline, lastline,
|
||||||
doesrange, evaluate, selfdict)
|
doesrange, evaluate, selfdict)
|
||||||
char_u *func_name; /* name of the function */
|
char_u *funcname; /* name of the function */
|
||||||
int len; /* length of "name" */
|
int len; /* length of "name" */
|
||||||
typval_T *rettv; /* return value goes here */
|
typval_T *rettv; /* return value goes here */
|
||||||
int argcount; /* number of "argvars" */
|
int argcount; /* number of "argvars" */
|
||||||
@@ -8107,7 +8107,7 @@ call_func(func_name, len, rettv, argcount, argvars, firstline, lastline,
|
|||||||
|
|
||||||
/* Make a copy of the name, if it comes from a funcref variable it could
|
/* Make a copy of the name, if it comes from a funcref variable it could
|
||||||
* be changed or deleted in the called function. */
|
* be changed or deleted in the called function. */
|
||||||
name = vim_strnsave(func_name, len);
|
name = vim_strnsave(funcname, len);
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -10114,7 +10114,7 @@ filter_map(argvars, rettv, map)
|
|||||||
int todo;
|
int todo;
|
||||||
char_u *ermsg = map ? (char_u *)"map()" : (char_u *)"filter()";
|
char_u *ermsg = map ? (char_u *)"map()" : (char_u *)"filter()";
|
||||||
int save_did_emsg;
|
int save_did_emsg;
|
||||||
int index = 0;
|
int idx = 0;
|
||||||
|
|
||||||
if (argvars[0].v_type == VAR_LIST)
|
if (argvars[0].v_type == VAR_LIST)
|
||||||
{
|
{
|
||||||
@@ -10184,13 +10184,13 @@ filter_map(argvars, rettv, map)
|
|||||||
if (tv_check_lock(li->li_tv.v_lock, ermsg))
|
if (tv_check_lock(li->li_tv.v_lock, ermsg))
|
||||||
break;
|
break;
|
||||||
nli = li->li_next;
|
nli = li->li_next;
|
||||||
vimvars[VV_KEY].vv_nr = index;
|
vimvars[VV_KEY].vv_nr = idx;
|
||||||
if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL
|
if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL
|
||||||
|| did_emsg)
|
|| did_emsg)
|
||||||
break;
|
break;
|
||||||
if (!map && rem)
|
if (!map && rem)
|
||||||
listitem_remove(l, li);
|
listitem_remove(l, li);
|
||||||
++index;
|
++idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
src/fold.c
14
src/fold.c
@@ -2265,24 +2265,24 @@ foldUpdateIEMS(wp, top, bot)
|
|||||||
if (foldlevelSyntax == getlevel)
|
if (foldlevelSyntax == getlevel)
|
||||||
{
|
{
|
||||||
garray_T *gap = &wp->w_folds;
|
garray_T *gap = &wp->w_folds;
|
||||||
fold_T *fp = NULL;
|
fold_T *fpn = NULL;
|
||||||
int current_fdl = 0;
|
int current_fdl = 0;
|
||||||
linenr_T fold_start_lnum = 0;
|
linenr_T fold_start_lnum = 0;
|
||||||
linenr_T lnum_rel = fline.lnum;
|
linenr_T lnum_rel = fline.lnum;
|
||||||
|
|
||||||
while (current_fdl < fline.lvl)
|
while (current_fdl < fline.lvl)
|
||||||
{
|
{
|
||||||
if (!foldFind(gap, lnum_rel, &fp))
|
if (!foldFind(gap, lnum_rel, &fpn))
|
||||||
break;
|
break;
|
||||||
++current_fdl;
|
++current_fdl;
|
||||||
|
|
||||||
fold_start_lnum += fp->fd_top;
|
fold_start_lnum += fpn->fd_top;
|
||||||
gap = &fp->fd_nested;
|
gap = &fpn->fd_nested;
|
||||||
lnum_rel -= fp->fd_top;
|
lnum_rel -= fpn->fd_top;
|
||||||
}
|
}
|
||||||
if (fp != NULL && current_fdl == fline.lvl)
|
if (fpn != NULL && current_fdl == fline.lvl)
|
||||||
{
|
{
|
||||||
linenr_T fold_end_lnum = fold_start_lnum + fp->fd_len;
|
linenr_T fold_end_lnum = fold_start_lnum + fpn->fd_len;
|
||||||
|
|
||||||
if (fold_end_lnum > bot)
|
if (fold_end_lnum > bot)
|
||||||
bot = fold_end_lnum;
|
bot = fold_end_lnum;
|
||||||
|
@@ -3342,8 +3342,8 @@ time_diff(then, now)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
time_msg(msg, tv_start)
|
time_msg(mesg, tv_start)
|
||||||
char *msg;
|
char *mesg;
|
||||||
void *tv_start; /* only for do_source: start time; actually
|
void *tv_start; /* only for do_source: start time; actually
|
||||||
(struct timeval *) */
|
(struct timeval *) */
|
||||||
{
|
{
|
||||||
@@ -3352,7 +3352,7 @@ time_msg(msg, tv_start)
|
|||||||
|
|
||||||
if (time_fd != NULL)
|
if (time_fd != NULL)
|
||||||
{
|
{
|
||||||
if (strstr(msg, "STARTING") != NULL)
|
if (strstr(mesg, "STARTING") != NULL)
|
||||||
{
|
{
|
||||||
gettimeofday(&start, NULL);
|
gettimeofday(&start, NULL);
|
||||||
prev_timeval = start;
|
prev_timeval = start;
|
||||||
@@ -3370,7 +3370,7 @@ time_msg(msg, tv_start)
|
|||||||
fprintf(time_fd, " ");
|
fprintf(time_fd, " ");
|
||||||
time_diff(&prev_timeval, &now);
|
time_diff(&prev_timeval, &now);
|
||||||
prev_timeval = now;
|
prev_timeval = now;
|
||||||
fprintf(time_fd, ": %s\n", msg);
|
fprintf(time_fd, ": %s\n", mesg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1335,16 +1335,16 @@ ml_recover()
|
|||||||
b0_ff = (b0p->b0_flags & B0_FF_MASK);
|
b0_ff = (b0p->b0_flags & B0_FF_MASK);
|
||||||
if (b0p->b0_flags & B0_HAS_FENC)
|
if (b0p->b0_flags & B0_HAS_FENC)
|
||||||
{
|
{
|
||||||
int size = B0_FNAME_SIZE_NOCRYPT;
|
int fnsize = B0_FNAME_SIZE_NOCRYPT;
|
||||||
|
|
||||||
#ifdef FEAT_CRYPT
|
#ifdef FEAT_CRYPT
|
||||||
/* Use the same size as in add_b0_fenc(). */
|
/* Use the same size as in add_b0_fenc(). */
|
||||||
if (b0p->b0_id[1] != BLOCK0_ID1)
|
if (b0p->b0_id[1] != BLOCK0_ID1)
|
||||||
size = B0_FNAME_SIZE_CRYPT;
|
fnsize = B0_FNAME_SIZE_CRYPT;
|
||||||
#endif
|
#endif
|
||||||
for (p = b0p->b0_fname + size; p > b0p->b0_fname && p[-1] != NUL; --p)
|
for (p = b0p->b0_fname + fnsize; p > b0p->b0_fname && p[-1] != NUL; --p)
|
||||||
;
|
;
|
||||||
b0_fenc = vim_strnsave(p, (int)(b0p->b0_fname + size - p));
|
b0_fenc = vim_strnsave(p, (int)(b0p->b0_fname + fnsize - p));
|
||||||
}
|
}
|
||||||
|
|
||||||
mf_put(mfp, hp, FALSE, FALSE); /* release block 0 */
|
mf_put(mfp, hp, FALSE, FALSE); /* release block 0 */
|
||||||
|
@@ -195,7 +195,7 @@ netbeans_close(void)
|
|||||||
#define NB_DEF_PASS "changeme"
|
#define NB_DEF_PASS "changeme"
|
||||||
|
|
||||||
static int
|
static int
|
||||||
netbeans_connect(char *params, int abort)
|
netbeans_connect(char *params, int doabort)
|
||||||
{
|
{
|
||||||
#ifdef INET_SOCKETS
|
#ifdef INET_SOCKETS
|
||||||
struct sockaddr_in server;
|
struct sockaddr_in server;
|
||||||
@@ -366,7 +366,7 @@ netbeans_connect(char *params, int abort)
|
|||||||
{
|
{
|
||||||
nbdebug(("retrying...\n"));
|
nbdebug(("retrying...\n"));
|
||||||
sleep(5);
|
sleep(5);
|
||||||
if (!abort)
|
if (!doabort)
|
||||||
{
|
{
|
||||||
ui_breakcheck();
|
ui_breakcheck();
|
||||||
if (got_int)
|
if (got_int)
|
||||||
@@ -388,7 +388,7 @@ netbeans_connect(char *params, int abort)
|
|||||||
/* Get here when the server can't be found. */
|
/* Get here when the server can't be found. */
|
||||||
nbdebug(("Cannot connect to Netbeans #2\n"));
|
nbdebug(("Cannot connect to Netbeans #2\n"));
|
||||||
PERROR(_("Cannot connect to Netbeans #2"));
|
PERROR(_("Cannot connect to Netbeans #2"));
|
||||||
if (abort)
|
if (doabort)
|
||||||
getout(1);
|
getout(1);
|
||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
@@ -398,7 +398,7 @@ netbeans_connect(char *params, int abort)
|
|||||||
{
|
{
|
||||||
nbdebug(("Cannot connect to Netbeans\n"));
|
nbdebug(("Cannot connect to Netbeans\n"));
|
||||||
PERROR(_("Cannot connect to Netbeans"));
|
PERROR(_("Cannot connect to Netbeans"));
|
||||||
if (abort)
|
if (doabort)
|
||||||
getout(1);
|
getout(1);
|
||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
@@ -2967,7 +2967,7 @@ netbeans_gui_register(void)
|
|||||||
* Tell netbeans that the window was opened, ready for commands.
|
* Tell netbeans that the window was opened, ready for commands.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
netbeans_open(char *params, int abort)
|
netbeans_open(char *params, int doabort)
|
||||||
{
|
{
|
||||||
char *cmd = "0:startupDone=0\n";
|
char *cmd = "0:startupDone=0\n";
|
||||||
|
|
||||||
@@ -2977,7 +2977,7 @@ netbeans_open(char *params, int abort)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (netbeans_connect(params, abort) != OK)
|
if (netbeans_connect(params, doabort) != OK)
|
||||||
return;
|
return;
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
netbeans_gui_register();
|
netbeans_gui_register();
|
||||||
|
@@ -8133,7 +8133,7 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags)
|
|||||||
ml_open_files();
|
ml_open_files();
|
||||||
}
|
}
|
||||||
#ifdef FEAT_CONCEAL
|
#ifdef FEAT_CONCEAL
|
||||||
else if (pp == (long *)&curwin->w_p_conceal)
|
else if (pp == &curwin->w_p_conceal)
|
||||||
{
|
{
|
||||||
if (curwin->w_p_conceal < 0)
|
if (curwin->w_p_conceal < 0)
|
||||||
{
|
{
|
||||||
|
@@ -214,7 +214,7 @@ typedef struct
|
|||||||
int wo_wrap;
|
int wo_wrap;
|
||||||
#define w_p_wrap w_onebuf_opt.wo_wrap /* 'wrap' */
|
#define w_p_wrap w_onebuf_opt.wo_wrap /* 'wrap' */
|
||||||
#ifdef FEAT_CONCEAL
|
#ifdef FEAT_CONCEAL
|
||||||
int wo_conceal; /* 'conceal' */
|
long wo_conceal; /* 'conceal' */
|
||||||
# define w_p_conceal w_onebuf_opt.wo_conceal
|
# define w_p_conceal w_onebuf_opt.wo_conceal
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_CURSORBIND
|
#ifdef FEAT_CURSORBIND
|
||||||
|
14
src/undo.c
14
src/undo.c
@@ -100,7 +100,7 @@ static void u_freebranch __ARGS((buf_T *buf, u_header_T *uhp, u_header_T **uhpp)
|
|||||||
static void u_freeentries __ARGS((buf_T *buf, u_header_T *uhp, u_header_T **uhpp));
|
static void u_freeentries __ARGS((buf_T *buf, u_header_T *uhp, u_header_T **uhpp));
|
||||||
static void u_freeentry __ARGS((u_entry_T *, long));
|
static void u_freeentry __ARGS((u_entry_T *, long));
|
||||||
#ifdef FEAT_PERSISTENT_UNDO
|
#ifdef FEAT_PERSISTENT_UNDO
|
||||||
static void corruption_error __ARGS((char *msg, char_u *file_name));
|
static void corruption_error __ARGS((char *mesg, char_u *file_name));
|
||||||
static void u_free_uhp __ARGS((u_header_T *uhp));
|
static void u_free_uhp __ARGS((u_header_T *uhp));
|
||||||
static size_t fwrite_crypt __ARGS((buf_T *buf UNUSED, char_u *ptr, size_t len, FILE *fp));
|
static size_t fwrite_crypt __ARGS((buf_T *buf UNUSED, char_u *ptr, size_t len, FILE *fp));
|
||||||
static char_u *read_string_decrypt __ARGS((buf_T *buf UNUSED, FILE *fd, int len));
|
static char_u *read_string_decrypt __ARGS((buf_T *buf UNUSED, FILE *fd, int len));
|
||||||
@@ -779,11 +779,11 @@ u_get_undo_file_name(buf_ffname, reading)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
corruption_error(msg, file_name)
|
corruption_error(mesg, file_name)
|
||||||
char *msg;
|
char *mesg;
|
||||||
char_u *file_name;
|
char_u *file_name;
|
||||||
{
|
{
|
||||||
EMSG3(_("E825: Corrupted undo file (%s): %s"), msg, file_name);
|
EMSG3(_("E825: Corrupted undo file (%s): %s"), mesg, file_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1313,13 +1313,13 @@ u_write_undo(name, forceit, buf, hash)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char_u buf[UF_START_MAGIC_LEN];
|
char_u mbuf[UF_START_MAGIC_LEN];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = vim_read(fd, buf, UF_START_MAGIC_LEN);
|
len = vim_read(fd, mbuf, UF_START_MAGIC_LEN);
|
||||||
close(fd);
|
close(fd);
|
||||||
if (len < UF_START_MAGIC_LEN
|
if (len < UF_START_MAGIC_LEN
|
||||||
|| memcmp(buf, UF_START_MAGIC, UF_START_MAGIC_LEN) != 0)
|
|| memcmp(mbuf, UF_START_MAGIC, UF_START_MAGIC_LEN) != 0)
|
||||||
{
|
{
|
||||||
if (name != NULL || p_verbose > 0)
|
if (name != NULL || p_verbose > 0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user