changeset 2271:2b33a7678e7b vim73

Fix compiler warnings for shadowed variables. Make 'conceal' a long instead of int.
author Bram Moolenaar <bram@vim.org>
date Tue, 22 Jun 2010 06:28:58 +0200
parents 917fff7bc09d
children 69dc5f32f5d2
files src/blowfish.c src/eval.c src/fold.c src/main.c src/memline.c src/netbeans.c src/option.c src/structs.h src/undo.c
diffstat 9 files changed, 43 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/src/blowfish.c
+++ b/src/blowfish.c
@@ -39,7 +39,7 @@ typedef union {
 
 static void bf_e_block __ARGS((UINT32_T *p_xl, UINT32_T *p_xr));
 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));
 
 /* Blowfish code */
@@ -469,19 +469,19 @@ bf_key_init(password, salt, salt_len)
  * BF Self test for corrupted tables or instructions
  */
     static int
-bf_check_tables(ipa, sbi, val)
-    UINT32_T ipa[18];
-    UINT32_T sbi[4][256];
+bf_check_tables(a_ipa, a_sbi, val)
+    UINT32_T a_ipa[18];
+    UINT32_T a_sbi[4][256];
     UINT32_T val;
 {
     int i, j;
     UINT32_T c = 0;
 
     for (i = 0; i < 18; i++)
-	c ^= ipa[i];
+	c ^= a_ipa[i];
     for (i = 0; i < 4; i++)
 	for (j = 0; j < 256; j++)
-	    c ^= sbi[i][j];
+	    c ^= a_sbi[i][j];
     return c == val;
 }
 
--- a/src/eval.c
+++ b/src/eval.c
@@ -463,7 +463,7 @@ static int get_env_tv __ARGS((char_u **a
 static int find_internal_func __ARGS((char_u *name));
 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 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 int non_zero_arg __ARGS((typval_T *argvars));
 
@@ -8074,9 +8074,9 @@ get_func_tv(name, len, rettv, arg, first
  * Also returns OK when an error was encountered while executing the function.
  */
     static int
-call_func(func_name, len, rettv, argcount, argvars, firstline, lastline,
+call_func(funcname, len, rettv, argcount, argvars, firstline, lastline,
 						doesrange, evaluate, selfdict)
-    char_u	*func_name;	/* name of the function */
+    char_u	*funcname;	/* name of the function */
     int		len;		/* length of "name" */
     typval_T	*rettv;		/* return value goes here */
     int		argcount;	/* number of "argvars" */
@@ -8107,7 +8107,7 @@ call_func(func_name, len, rettv, argcoun
 
     /* Make a copy of the name, if it comes from a funcref variable it could
      * be changed or deleted in the called function. */
-    name = vim_strnsave(func_name, len);
+    name = vim_strnsave(funcname, len);
     if (name == NULL)
 	return ret;
 
@@ -10114,7 +10114,7 @@ filter_map(argvars, rettv, map)
     int		todo;
     char_u	*ermsg = map ? (char_u *)"map()" : (char_u *)"filter()";
     int		save_did_emsg;
-    int		index = 0;
+    int		idx = 0;
 
     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))
 		    break;
 		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
 								  || did_emsg)
 		    break;
 		if (!map && rem)
 		    listitem_remove(l, li);
-		++index;
+		++idx;
 	    }
 	}
 
--- a/src/fold.c
+++ b/src/fold.c
@@ -2265,24 +2265,24 @@ foldUpdateIEMS(wp, top, bot)
     if (foldlevelSyntax == getlevel)
     {
 	garray_T *gap = &wp->w_folds;
-	fold_T	 *fp = NULL;
+	fold_T	 *fpn = NULL;
 	int	  current_fdl = 0;
 	linenr_T  fold_start_lnum = 0;
 	linenr_T  lnum_rel = fline.lnum;
 
 	while (current_fdl < fline.lvl)
 	{
-	    if (!foldFind(gap, lnum_rel, &fp))
+	    if (!foldFind(gap, lnum_rel, &fpn))
 		break;
 	    ++current_fdl;
 
-	    fold_start_lnum += fp->fd_top;
-	    gap = &fp->fd_nested;
-	    lnum_rel -= fp->fd_top;
+	    fold_start_lnum += fpn->fd_top;
+	    gap = &fpn->fd_nested;
+	    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)
 		bot = fold_end_lnum;
--- a/src/main.c
+++ b/src/main.c
@@ -3342,8 +3342,8 @@ time_diff(then, now)
 }
 
     void
-time_msg(msg, tv_start)
-    char	*msg;
+time_msg(mesg, tv_start)
+    char	*mesg;
     void	*tv_start;  /* only for do_source: start time; actually
 			       (struct timeval *) */
 {
@@ -3352,7 +3352,7 @@ time_msg(msg, tv_start)
 
     if (time_fd != NULL)
     {
-	if (strstr(msg, "STARTING") != NULL)
+	if (strstr(mesg, "STARTING") != NULL)
 	{
 	    gettimeofday(&start, NULL);
 	    prev_timeval = start;
@@ -3370,7 +3370,7 @@ time_msg(msg, tv_start)
 	fprintf(time_fd, "  ");
 	time_diff(&prev_timeval, &now);
 	prev_timeval = now;
-	fprintf(time_fd, ": %s\n", msg);
+	fprintf(time_fd, ": %s\n", mesg);
     }
 }
 
--- a/src/memline.c
+++ b/src/memline.c
@@ -1335,16 +1335,16 @@ ml_recover()
     b0_ff = (b0p->b0_flags & B0_FF_MASK);
     if (b0p->b0_flags & B0_HAS_FENC)
     {
-	int size = B0_FNAME_SIZE_NOCRYPT;
+	int fnsize = B0_FNAME_SIZE_NOCRYPT;
 
 #ifdef FEAT_CRYPT
 	/* Use the same size as in add_b0_fenc(). */
 	if (b0p->b0_id[1] != BLOCK0_ID1)
-	    size = B0_FNAME_SIZE_CRYPT;
+	    fnsize = B0_FNAME_SIZE_CRYPT;
 #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 */
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -195,7 +195,7 @@ netbeans_close(void)
 #define NB_DEF_PASS "changeme"
 
     static int
-netbeans_connect(char *params, int abort)
+netbeans_connect(char *params, int doabort)
 {
 #ifdef INET_SOCKETS
     struct sockaddr_in	server;
@@ -366,7 +366,7 @@ netbeans_connect(char *params, int abort
 		{
 		    nbdebug(("retrying...\n"));
 		    sleep(5);
-		    if (!abort)
+		    if (!doabort)
 		    {
 			ui_breakcheck();
 			if (got_int)
@@ -388,7 +388,7 @@ netbeans_connect(char *params, int abort
 		    /* Get here when the server can't be found. */
 		    nbdebug(("Cannot connect to Netbeans #2\n"));
 		    PERROR(_("Cannot connect to Netbeans #2"));
-		    if (abort)
+		    if (doabort)
 			getout(1);
 		    goto theend;
 		}
@@ -398,7 +398,7 @@ netbeans_connect(char *params, int abort
 	{
 	    nbdebug(("Cannot connect to Netbeans\n"));
 	    PERROR(_("Cannot connect to Netbeans"));
-	    if (abort)
+	    if (doabort)
 		getout(1);
 	    goto theend;
 	}
@@ -2967,7 +2967,7 @@ netbeans_gui_register(void)
  * Tell netbeans that the window was opened, ready for commands.
  */
     void
-netbeans_open(char *params, int abort)
+netbeans_open(char *params, int doabort)
 {
     char *cmd = "0:startupDone=0\n";
 
@@ -2977,7 +2977,7 @@ netbeans_open(char *params, int abort)
 	return;
     }
 
-    if (netbeans_connect(params, abort) != OK)
+    if (netbeans_connect(params, doabort) != OK)
 	return;
 #ifdef FEAT_GUI
     netbeans_gui_register();
--- a/src/option.c
+++ b/src/option.c
@@ -8133,7 +8133,7 @@ set_num_option(opt_idx, varp, value, err
 	    ml_open_files();
     }
 #ifdef FEAT_CONCEAL
-    else if (pp == (long *)&curwin->w_p_conceal)
+    else if (pp == &curwin->w_p_conceal)
     {
 	if (curwin->w_p_conceal < 0)
 	{
--- a/src/structs.h
+++ b/src/structs.h
@@ -214,7 +214,7 @@ typedef struct
     int		wo_wrap;
 #define w_p_wrap w_onebuf_opt.wo_wrap	/* 'wrap' */
 #ifdef FEAT_CONCEAL
-    int		wo_conceal;		/* 'conceal' */
+    long	wo_conceal;		/* 'conceal' */
 # define w_p_conceal w_onebuf_opt.wo_conceal
 #endif
 #ifdef FEAT_CURSORBIND
--- a/src/undo.c
+++ b/src/undo.c
@@ -100,7 +100,7 @@ static void u_freebranch __ARGS((buf_T *
 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));
 #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 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));
@@ -779,11 +779,11 @@ u_get_undo_file_name(buf_ffname, reading
 }
 
     static void
-corruption_error(msg, file_name)
-    char *msg;
+corruption_error(mesg, file_name)
+    char *mesg;
     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
@@ -1313,13 +1313,13 @@ u_write_undo(name, forceit, buf, hash)
 	    }
 	    else
 	    {
-		char_u	buf[UF_START_MAGIC_LEN];
+		char_u	mbuf[UF_START_MAGIC_LEN];
 		int	len;
 
-		len = vim_read(fd, buf, UF_START_MAGIC_LEN);
+		len = vim_read(fd, mbuf, UF_START_MAGIC_LEN);
 		close(fd);
 		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)
 		    {