]> granicus.if.org Git - vim/commitdiff
Fix compiler warnings for shadowed variables. Make 'conceal' a long instead
authorBram Moolenaar <Bram@vim.org>
Tue, 22 Jun 2010 04:28:58 +0000 (06:28 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 22 Jun 2010 04:28:58 +0000 (06:28 +0200)
of int.

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

index c8e68d22441c4751ff8a1e50a496f6a99c90a6f1..78e56991bc12914a542c3a07369128773431e4aa 100644 (file)
@@ -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;
 }
 
index 10732ccade6effef9b3e5cc5e3d8e39170fa9fdc..7457677c1b3d05eeec77ff6def1163c7b9ed486f 100644 (file)
@@ -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 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, firstline, lastline, doesrange,
  * 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, argcount, argvars, firstline, lastline,
 
     /* 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;
            }
        }
 
index c88e8f793b3fefafcdaa864242821b8fd398772d..800db61ba645694b6429387d6beffaf76ff32f00 100644 (file)
@@ -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;
index 0f2925586438202a51c725fb1b59f352288585e4..1b2e6ee6947f7e639a0e7a99269a2159db3438fd 100644 (file)
@@ -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);
     }
 }
 
index 75800b15bdfc3b940c33ddf2208147b3380047dd..c5b22e0924bbf77a92de9c365b4bba4336ba45ae 100644 (file)
@@ -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 */
index ff191d7d2a414d3461ca270311f465a49666bc16..e674fd82222c64cee2b189501452bbf812adf022 100644 (file)
@@ -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();
index fdca36f631affc0b5fd778708b07f2c523774b24..ae3c53912351e08660afd9ca4d684d8269a28dd8 100644 (file)
@@ -8133,7 +8133,7 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags)
            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)
        {
index a1c7e9d9a8e328a146af15959035a0f5d8c40d4e..d792c7804e9868015a22a2cbfaffb9ebd9301d7e 100644 (file)
@@ -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
index 45a6a23078e64089a4bf22ef4f8049268066bb8f..b1737815354a4ccdd234244d5c3bae978a5b946a 100644 (file)
@@ -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_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)
                    {