]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.333 v7.2.333
authorBram Moolenaar <Bram@vim.org>
Tue, 19 Jan 2010 13:59:56 +0000 (14:59 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 19 Jan 2010 13:59:56 +0000 (14:59 +0100)
Problem:    Warnings from static code analysis.
Solution:   Small changes to various lines. (Dominique Pelle)

src/buffer.c
src/edit.c
src/ex_getln.c
src/fileio.c
src/if_cscope.c
src/netbeans.c
src/ops.c
src/quickfix.c
src/syntax.c
src/ui.c
src/version.c

index 2d64bca848e5c979db28774108ad5799ab86fc8c..a3cd6be38d8a3c16d9a78082c23d2f16aebcc9d2 100644 (file)
@@ -315,7 +315,7 @@ close_buffer(win, buf, action)
 {
 #ifdef FEAT_AUTOCMD
     int                is_curbuf;
-    int                nwindows = buf->b_nwindows;
+    int                nwindows;
 #endif
     int                unload_buf = (action != 0);
     int                del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
index 75b18084f3b23bbc9a6a9a2eb355bb4e6f3e64c3..43058f8b71bd8f64ebf0fe647176ce213a3ebc9c 100644 (file)
@@ -4048,7 +4048,7 @@ ins_compl_get_exp(ini)
            save_p_ic = p_ic;
            p_ic = ignorecase(compl_pattern);
 
-           /* Find up to TAG_MANY matches.  Avoids that an enourmous number
+           /* Find up to TAG_MANY matches.  Avoids that an enormous number
             * of matches is found when compl_pattern is empty */
            if (find_tags(compl_pattern, &num_matches, &matches,
                    TAG_REGEXP | TAG_NAMES | TAG_NOIC |
@@ -4219,7 +4219,7 @@ ins_compl_get_exp(ini)
                                                 || IObuff[len - 2] == '!'))))
                                        IObuff[len++] = ' ';
                                }
-                               /* copy as much as posible of the new word */
+                               /* copy as much as possible of the new word */
                                if (tmp_ptr - ptr >= IOSIZE - len)
                                    tmp_ptr = ptr + IOSIZE - len - 1;
                                STRNCPY(IObuff + len, ptr, tmp_ptr - ptr);
@@ -5827,10 +5827,7 @@ internal_format(textwidth, second_indent, flags, format_only, c)
 #endif
                && !has_format_option(FO_WRAP))
 
-       {
-           textwidth = 0;
            break;
-       }
        if ((startcol = curwin->w_cursor.col) == 0)
            break;
 
index 08a7855e613d0862808aaa8227a886729e2504f6..d5761f3384b86a92f440364572e11f2f950b2023 100644 (file)
@@ -2193,7 +2193,6 @@ getexmodeline(promptc, cookie, indent)
     {
        if (ga_grow(&line_ga, 40) == FAIL)
            break;
-       pend = (char_u *)line_ga.ga_data + line_ga.ga_len;
 
        /* Get one character at a time.  Don't use inchar(), it can't handle
         * special characters. */
@@ -3314,7 +3313,7 @@ nextwild(xp, type, options)
                    WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE
                                                              |options, type);
            vim_free(p1);
-           /* longest match: make sure it is not shorter (happens with :help */
+           /* longest match: make sure it is not shorterhappens with :help */
            if (p2 != NULL && type == WILD_LONGEST)
            {
                for (j = 0; j < xp->xp_pattern_len; ++j)
index bdc7439cee790cb0a317f373764ede27f1f14442..0e2d1cca77b7469d608d7d62789b6077ea170642 100644 (file)
@@ -7072,8 +7072,8 @@ vim_tempname(extra_char)
         */
        for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i)
        {
-           size_t      itmplen;
 # ifndef HAVE_MKDTEMP
+           size_t      itmplen;
            long        nr;
            long        off;
 # endif
@@ -7091,7 +7091,6 @@ vim_tempname(extra_char)
                else
 # endif
                    add_pathsep(itmp);
-               itmplen = STRLEN(itmp);
 
 # ifdef HAVE_MKDTEMP
                /* Leave room for filename */
@@ -7104,6 +7103,7 @@ vim_tempname(extra_char)
                 * otherwise it doesn't matter.  The use of mkdir() avoids any
                 * security problems because of the predictable number. */
                nr = (mch_get_pid() + (long)time(NULL)) % 1000000L;
+               itmplen = STRLEN(itmp);
 
                /* Try up to 10000 different values until we find a name that
                 * doesn't exist. */
index bd90eca8769b5756bd889aacfee25d746efa74f8..b2a4ce1a10c3e48c82392a85ef5cecc085fc29a4 100644 (file)
@@ -2069,7 +2069,7 @@ cs_print_tags_priv(matches, cntxts, num_matches)
            continue;
        (void)strcpy(tbuf, matches[idx]);
 
-       if ((fname = strtok(tbuf, (const char *)"\t")) == NULL)
+       if (strtok(tbuf, (const char *)"\t") == NULL)
            continue;
        if ((fname = strtok(NULL, (const char *)"\t")) == NULL)
            continue;
index b013d7780eea344d1adf7e9d2ff387e8b29a248f..a8a690112d7bfabd235da2b24418ed764ef952c0 100644 (file)
@@ -873,7 +873,7 @@ nb_parse_cmd(char_u *cmd)
     {
 #ifdef NBDEBUG
        /*
-        * This happens because the ExtEd can send a cammand or 2 after
+        * This happens because the ExtEd can send a command or 2 after
         * doing a stopDocumentListen command. It doesn't harm anything
         * so I'm disabling it except for debugging.
         */
@@ -1174,7 +1174,7 @@ nb_quote(char_u *txt)
                break;
        }
     }
-    *q++ = '\0';
+    *q = '\0';
 
     return buf;
 }
@@ -3070,7 +3070,7 @@ netbeans_removed(
 }
 
 /*
- * Send netbeans an unmodufied command.
+ * Send netbeans an unmodified command.
  */
     void
 netbeans_unmodified(buf_T *bufp UNUSED)
@@ -3366,7 +3366,7 @@ netbeans_gutter_click(linenr_T lnum)
 
 
 /*
- * Add a sign of the reqested type at the requested location.
+ * Add a sign of the requested type at the requested location.
  *
  * Reverse engineering:
  * Apparently an annotation is defined the first time it is used in a buffer.
index 5b12e68dff83ab2c9e6e8b1f4a18740fd2af85bd..4b32b573337c8e848f3ee3bcd75e35e3b2f97d7d 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -5591,13 +5591,13 @@ x11_export_final_selection()
         */
        if (has_mbyte)
        {
-           char_u      *conv_str = str;
            vimconv_T   vc;
 
            vc.vc_type = CONV_NONE;
            if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK)
            {
-               int intlen = len;
+               int     intlen = len;
+               char_u  *conv_str;
 
                conv_str = string_convert(&vc, str, &intlen);
                len = intlen;
index 5fc36bc5e00577baba656d11433257fcc129f10f..8537a7c5a975cee8d10dca297cee5ee59202e9ac 100644 (file)
@@ -1899,7 +1899,6 @@ qf_list(eap)
     int                i;
     int                idx1 = 1;
     int                idx2 = -1;
-    int                need_return = TRUE;
     char_u     *arg = eap->arg;
     int                all = eap->forceit;     /* if not :cl!, only show
                                                   recognised errors */
@@ -1939,13 +1938,9 @@ qf_list(eap)
     {
        if ((qfp->qf_valid || all) && idx1 <= i && i <= idx2)
        {
-           if (need_return)
-           {
-               msg_putchar('\n');
-               if (got_int)
-                   break;
-               need_return = FALSE;
-           }
+           msg_putchar('\n');
+           if (got_int)
+               break;
 
            fname = NULL;
            if (qfp->qf_fnum != 0
@@ -1988,7 +1983,6 @@ qf_list(eap)
                                                              IObuff, IOSIZE);
            msg_prt_line(IObuff, FALSE);
            out_flush();                /* show one line at a time */
-           need_return = TRUE;
        }
 
        qfp = qfp->qf_next;
index 54b8875e9b7d1bef7adfdbed60b1ca099d3a018c..42460585054fafaccb344c4655cb4fc7a7e87d11 100644 (file)
@@ -4167,7 +4167,6 @@ clear_keywtab(ht)
        if (!HASHITEM_EMPTY(hi))
        {
            --todo;
-           kp = HI2KE(hi);
            for (kp = HI2KE(hi); kp != NULL; kp = kp_next)
            {
                kp_next = kp->ke_next;
index df8008c8406f1fe928df70b1dea6d19b9c3a1101..e9d6beba74d2a7f84fa90a1a27ded29d02da67a6 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -2383,7 +2383,7 @@ yank_cut_buffer0(dpy, cbd)
         * 'enc' anyway. */
        if (has_mbyte)
        {
-           char_u      *conv_buf = buffer;
+           char_u      *conv_buf;
            vimconv_T   vc;
 
            vc.vc_type = CONV_NONE;
index 91a4685eae87ab81bb0552a7d24474291b99ffe4..3b22e5c9c4f189334c6dc4a7ce9e0cc345faa097 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    333,
 /**/
     332,
 /**/