]> granicus.if.org Git - vim/commitdiff
updated for version 7.2-055 v7.2.055
authorBram Moolenaar <Bram@vim.org>
Fri, 28 Nov 2008 20:29:07 +0000 (20:29 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 28 Nov 2008 20:29:07 +0000 (20:29 +0000)
23 files changed:
src/diff.c
src/eval.c
src/ex_cmds.c
src/ex_docmd.c
src/fileio.c
src/fold.c
src/getchar.c
src/globals.h
src/gui.c
src/gui_at_sb.c
src/gui_gtk_x11.c
src/gui_xmdlg.c
src/gui_xmebw.c
src/main.c
src/mbyte.c
src/message.c
src/netbeans.c
src/option.c
src/os_unix.c
src/spell.c
src/ui.c
src/version.c
src/window.c

index 8bf0ed81b1583997f5d3808826d31c7782c049ce..106bbd116e15c88e1bb87c9778fc462e85a969f2 100644 (file)
@@ -661,6 +661,7 @@ ex_diffupdate(eap)
     char_u     *tmp_diff;
     FILE       *fd;
     int                ok;
+    int                io_error = FALSE;
 
     /* Delete all diffblocks. */
     diff_clear(curtab);
@@ -697,18 +698,26 @@ ex_diffupdate(eap)
     {
        ok = FALSE;
        fd = mch_fopen((char *)tmp_orig, "w");
-       if (fd != NULL)
+       if (fd == NULL)
+           io_error = TRUE;
+       else
        {
-           fwrite("line1\n", (size_t)6, (size_t)1, fd);
+           if (fwrite("line1\n", (size_t)6, (size_t)1, fd) != 1)
+               io_error = TRUE;
            fclose(fd);
            fd = mch_fopen((char *)tmp_new, "w");
-           if (fd != NULL)
+           if (fd == NULL)
+               io_error = TRUE;
+           else
            {
-               fwrite("line2\n", (size_t)6, (size_t)1, fd);
+               if (fwrite("line2\n", (size_t)6, (size_t)1, fd) != 1)
+                   io_error = TRUE;
                fclose(fd);
                diff_file(tmp_orig, tmp_new, tmp_diff);
                fd = mch_fopen((char *)tmp_diff, "r");
-               if (fd != NULL)
+               if (fd == NULL)
+                   io_error = TRUE;
+               else
                {
                    char_u      linebuf[LBUFLEN];
 
@@ -761,6 +770,8 @@ ex_diffupdate(eap)
     }
     if (!ok)
     {
+       if (io_error)
+           EMSG(_("E810: Cannot read or write temp files"));
        EMSG(_("E97: Cannot create diffs"));
        diff_a_works = MAYBE;
 #if defined(MSWIN) || defined(MSDOS)
@@ -925,10 +936,10 @@ ex_diffpatch(eap)
     {
 # ifdef TEMPDIRNAMES
        if (vim_tempdir != NULL)
-           mch_chdir((char *)vim_tempdir);
+           ignored = mch_chdir((char *)vim_tempdir);
        else
 # endif
-           mch_chdir("/tmp");
+           ignored = mch_chdir("/tmp");
        shorten_fnames(TRUE);
     }
 #endif
index 73941504972983e7a7109175b0e57fb7e9cd71cc..ae78355854c2c413ea470eb199d25b65edebbbd7 100644 (file)
@@ -10641,7 +10641,7 @@ f_getchar(argvars, rettv)
 # ifdef FEAT_WINDOWS
            win_T       *wp;
 # endif
-           int         n = 1;
+           int         winnr = 1;
 
            if (row >= 0 && col >= 0)
            {
@@ -10651,9 +10651,9 @@ f_getchar(argvars, rettv)
                (void)mouse_comp_pos(win, &row, &col, &lnum);
 # ifdef FEAT_WINDOWS
                for (wp = firstwin; wp != win; wp = wp->w_next)
-                   ++n;
+                   ++winnr;
 # endif
-               vimvars[VV_MOUSE_WIN].vv_nr = n;
+               vimvars[VV_MOUSE_WIN].vv_nr = winnr;
                vimvars[VV_MOUSE_LNUM].vv_nr = lnum;
                vimvars[VV_MOUSE_COL].vv_nr = col + 1;
            }
index e3049fb0580f61c4934b21554cc049a6df680ae6..45d8c81f17215b76f8d72621bd06adb6b1a7a7a9 100644 (file)
@@ -1941,7 +1941,7 @@ write_viminfo(file, forceit)
             * root.
             */
            if (fp_out != NULL)
-               (void)fchown(fileno(fp_out), st_old.st_uid, st_old.st_gid);
+               ignored = fchown(fileno(fp_out), st_old.st_uid, st_old.st_gid);
 #endif
        }
     }
index 5a80a07c2203ddf312d9c7ee18e86d9697145a22..3e40669e338eb9730c370c16c454fe8d750e391c 100644 (file)
@@ -8753,8 +8753,8 @@ ex_mkrc(eap)
                else if (*dirnow != NUL
                        && (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
                {
-                   (void)mch_chdir((char *)globaldir);
-                   shorten_fnames(TRUE);
+                   if (mch_chdir((char *)globaldir) == OK)
+                       shorten_fnames(TRUE);
                }
 
                failed |= (makeopens(fd, dirnow) == FAIL);
index a28bcd9e65750a714e63351d246fd57578af5819..c0dd78d47d4befbae28bf54d0488196f9382121b 100644 (file)
@@ -2214,7 +2214,7 @@ failed:
     {
        /* Use stderr for stdin, makes shell commands work. */
        close(0);
-       dup(2);
+       ignored = dup(2);
     }
 #endif
 
@@ -3449,7 +3449,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
                {
 # ifdef UNIX
 #  ifdef HAVE_FCHOWN
-                   fchown(fd, st_old.st_uid, st_old.st_gid);
+                   ignored = fchown(fd, st_old.st_uid, st_old.st_gid);
 #  endif
                    if (mch_stat((char *)IObuff, &st) < 0
                            || st.st_uid != st_old.st_uid
@@ -4365,7 +4365,7 @@ restore_backup:
                || st.st_uid != st_old.st_uid
                || st.st_gid != st_old.st_gid)
        {
-           fchown(fd, st_old.st_uid, st_old.st_gid);
+           ignored = fchown(fd, st_old.st_uid, st_old.st_gid);
            if (perm >= 0)      /* set permission again, may have changed */
                (void)mch_setperm(wfname, perm);
        }
@@ -6030,9 +6030,9 @@ vim_fgets(buf, size, fp)
        {
            tbuf[FGETS_SIZE - 2] = NUL;
 #ifdef USE_CR
-           fgets_cr((char *)tbuf, FGETS_SIZE, fp);
+           ignoredp = fgets_cr((char *)tbuf, FGETS_SIZE, fp);
 #else
-           fgets((char *)tbuf, FGETS_SIZE, fp);
+           ignoredp = fgets((char *)tbuf, FGETS_SIZE, fp);
 #endif
        } while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n');
     }
index b7b8ea744c165b8d9a7df217c4e6e9917b46d98c..1fe7c5a1d917eae55725ad2f379a71e3371de4ca 100644 (file)
@@ -48,7 +48,7 @@ static int checkCloseRec __ARGS((garray_T *gap, linenr_T lnum, int level));
 static int foldFind __ARGS((garray_T *gap, linenr_T lnum, fold_T **fpp));
 static int foldLevelWin __ARGS((win_T *wp, linenr_T lnum));
 static void checkupdate __ARGS((win_T *wp));
-static void setFoldRepeat __ARGS((linenr_T lnum, long count, int open));
+static void setFoldRepeat __ARGS((linenr_T lnum, long count, int do_open));
 static linenr_T setManualFold __ARGS((linenr_T lnum, int opening, int recurse, int *donep));
 static linenr_T setManualFoldWin __ARGS((win_T *wp, linenr_T lnum, int opening, int recurse, int *donep));
 static void foldOpenNested __ARGS((fold_T *fpr));
@@ -1241,10 +1241,10 @@ checkupdate(wp)
  * Repeat "count" times.
  */
     static void
-setFoldRepeat(lnum, count, open)
+setFoldRepeat(lnum, count, do_open)
     linenr_T   lnum;
     long       count;
-    int                open;
+    int                do_open;
 {
     int                done;
     long       n;
@@ -1252,7 +1252,7 @@ setFoldRepeat(lnum, count, open)
     for (n = 0; n < count; ++n)
     {
        done = DONE_NOTHING;
-       (void)setManualFold(lnum, open, FALSE, &done);
+       (void)setManualFold(lnum, do_open, FALSE, &done);
        if (!(done & DONE_ACTION))
        {
            /* Only give an error message when no fold could be opened. */
index d4066c2124fecc916523135e0d959f1e4761322a..081368d028f3c497465f1e7829a420340054229e 100644 (file)
@@ -4702,7 +4702,7 @@ makemap(fd, buf)
                        return FAIL;
                    if (mp->m_noremap != REMAP_YES && fprintf(fd, "nore") < 0)
                        return FAIL;
-                   if (fprintf(fd, cmd) < 0)
+                   if (fputs(cmd, fd) < 0)
                        return FAIL;
                    if (buf != NULL && fputs(" <buffer>", fd) < 0)
                        return FAIL;
@@ -4801,7 +4801,7 @@ put_escstr(fd, strstart, what)
            }
            if (IS_SPECIAL(c) || modifiers)     /* special key */
            {
-               if (fprintf(fd, (char *)get_special_key_name(c, modifiers)) < 0)
+               if (fputs((char *)get_special_key_name(c, modifiers), fd) < 0)
                    return FAIL;
                continue;
            }
index c03c693223a322be9da064751039de468904a1c5..e26a3179482c3aa6434acf6fd6ad4384345f7950 100644 (file)
@@ -1548,6 +1548,14 @@ EXTERN int xsmp_icefd INIT(= -1);   /* The actual connection */
 /* For undo we need to know the lowest time possible. */
 EXTERN time_t starttime;
 
+/*
+ * Some compilers warn for not using a return value, but in some situations we
+ * can't do anything useful with the value.  Assign to this variable to avoid
+ * the warning.
+ */
+EXTERN int ignored;
+EXTERN char *ignoredp;
+
 /*
  * Optional Farsi support.  Include it here, so EXTERN and INIT are defined.
  */
index 426cea92a571de607d676d7e6e63587a2c3400db..b937189f7aa2b498509d949582a9fee04651d64b 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -139,7 +139,7 @@ gui_start()
                /* The read returns when the child closes the pipe (or when
                 * the child dies for some reason). */
                close(pipefd[1]);
-               (void)read(pipefd[0], &dummy, (size_t)1);
+               ignored = (int)read(pipefd[0], &dummy, (size_t)1);
                close(pipefd[0]);
            }
 
index 5fe3afbbe87094fb2afb8aa9eb7ccfeb9e02083c..1726953a2219187545c53310aca9ea0eb967434b 100644 (file)
@@ -1078,6 +1078,12 @@ NotifyThumb(w, event, params, num_params)
     Cardinal   *num_params;    /* unused */
 {
     ScrollbarWidget sbw = (ScrollbarWidget)w;
+    /* Use a union to avoid a warning for the weird conversion from float to
+     * XtPointer.  Comes from Xaw/Scrollbar.c. */
+    union {
+       XtPointer xtp;
+       float xtf;
+    } xtpf;
 
     if (LookAhead(w, event))
        return;
@@ -1085,7 +1091,8 @@ NotifyThumb(w, event, params, num_params)
     /* thumbProc is not pretty, but is necessary for backwards
        compatibility on those architectures for which it work{s,ed};
        the intent is to pass a (truncated) float by value. */
-    XtCallCallbacks(w, XtNthumbProc, *(XtPointer*)&sbw->scrollbar.top);
+    xtpf.xtf = sbw->scrollbar.top;
+    XtCallCallbacks(w, XtNthumbProc, xtpf.xtp);
     XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);
 }
 
index dc95d818ad5ea24e0946680a807e0835d2606a7b..cd6555767bff6d969a9367d5fb0d38c9b2da2412 100644 (file)
@@ -4070,14 +4070,14 @@ gui_mch_open(void)
 
        if (mask & (XValue | YValue))
        {
-           int wh;
-           gui_mch_get_screen_dimensions(&w, &h);
-           h += p_ghr + get_menu_tool_height();
-           w += get_menu_tool_width();
+           int ww, hh;
+           gui_mch_get_screen_dimensions(&ww, &hh);
+           hh += p_ghr + get_menu_tool_height();
+           ww += get_menu_tool_width();
            if (mask & XNegative)
-               x += w - pixel_width;
+               x += ww - pixel_width;
            if (mask & YNegative)
-               y += h - pixel_height;
+               y += hh - pixel_height;
 #ifdef HAVE_GTK2
            gtk_window_move(GTK_WINDOW(gui.mainwin), x, y);
 #else
index 95e3268e335cac95069362a5c3e9d5910714b170..cbdbe681d2e2ce4dab48e3f72346efb9d3da9859 100644 (file)
@@ -369,10 +369,10 @@ fill_lists(enum ListSpecifier fix, SharedFontSelData *data)
     char       buf[TEMP_BUF_SIZE];
     XmString   items[MAX_ENTRIES_IN_LIST];
     int                i;
-    int                index;
+    int                idx;
 
-    for (index = (int)ENCODING; index < (int)NONE; ++index)
-       count[index] = 0;
+    for (idx = (int)ENCODING; idx < (int)NONE; ++idx)
+       count[idx] = 0;
 
     /* First we insert the wild char into every single list. */
     if (fix != ENCODING)
@@ -503,14 +503,14 @@ fill_lists(enum ListSpecifier fix, SharedFontSelData *data)
     /*
      * Now loop trough the remaining lists and set them up.
      */
-    for (index = (int)NAME; index < (int)NONE; ++index)
+    for (idx = (int)NAME; idx < (int)NONE; ++idx)
     {
        Widget w;
 
-       if (fix == (enum ListSpecifier)index)
+       if (fix == (enum ListSpecifier)idx)
            continue;
 
-       switch ((enum ListSpecifier)index)
+       switch ((enum ListSpecifier)idx)
        {
            case NAME:
                w = data->list[NAME];
@@ -525,21 +525,21 @@ fill_lists(enum ListSpecifier fix, SharedFontSelData *data)
                w = (Widget)0;  /* for lint */
        }
 
-       for (i = 0; i < count[index]; ++i)
+       for (i = 0; i < count[idx]; ++i)
        {
-           items[i] = XmStringCreateLocalized(list[index][i]);
-           XtFree(list[index][i]);
+           items[i] = XmStringCreateLocalized(list[idx][i]);
+           XtFree(list[idx][i]);
        }
        XmListDeleteAllItems(w);
-       XmListAddItems(w, items, count[index], 1);
-       if (data->sel[index])
+       XmListAddItems(w, items, count[idx], 1);
+       if (data->sel[idx])
        {
            XmStringFree(items[0]);
-           items[0] = XmStringCreateLocalized(data->sel[index]);
+           items[0] = XmStringCreateLocalized(data->sel[idx]);
            XmListSelectItem(w, items[0], False);
            XmListSetBottomItem(w, items[0]);
        }
-       for (i = 0; i < count[index]; ++i)
+       for (i = 0; i < count[idx]; ++i)
            XmStringFree(items[i]);
     }
 }
@@ -695,14 +695,14 @@ do_choice(Widget w,
        int         n;
        XmString    str;
        Arg         args[4];
-       char        *msg = _("no specific match");
+       char        *nomatch_msg = _("no specific match");
 
        n = 0;
-       str = XmStringCreateLocalized(msg);
+       str = XmStringCreateLocalized(nomatch_msg);
        XtSetArg(args[n], XmNlabelString, str); ++n;
        XtSetValues(data->sample, args, n);
        apply_fontlist(data->sample);
-       XmTextSetString(data->name, msg);
+       XmTextSetString(data->name, nomatch_msg);
        XmStringFree(str);
 
        return False;
@@ -886,21 +886,21 @@ gui_xm_select_font(char_u *current)
     {
        int     i;
        int     max;
-       int     index = 0;
+       int     idx = 0;
        int     size;
-       char    str[128];
+       char    buf[128];
 
        for (i = 0, max = 0; i < data->num; i++)
        {
-           get_part(fn(data, i), 7, str);
-           size = atoi(str);
+           get_part(fn(data, i), 7, buf);
+           size = atoi(buf);
            if ((size > max) && (size < MAX_DISPLAY_SIZE))
            {
-               index = i;
+               idx = i;
                max = size;
            }
        }
-       strcpy(big_font, fn(data, index));
+       strcpy(big_font, fn(data, idx));
     }
     data->old = XLoadQueryFont(XtDisplay(parent), big_font);
     data->old_list = gui_motif_create_fontlist(data->old);
@@ -1217,28 +1217,28 @@ gui_xm_select_font(char_u *current)
 
        if (i != 0)
        {
-           char name[TEMP_BUF_SIZE];
-           char style[TEMP_BUF_SIZE];
-           char size[TEMP_BUF_SIZE];
-           char encoding[TEMP_BUF_SIZE];
+           char namebuf[TEMP_BUF_SIZE];
+           char stylebuf[TEMP_BUF_SIZE];
+           char sizebuf[TEMP_BUF_SIZE];
+           char encodingbuf[TEMP_BUF_SIZE];
            char *found;
 
            found = names[0];
 
-           name_part(found, name);
-           style_part(found, style);
-           size_part(found, size, data->in_pixels);
-           encoding_part(found, encoding);
+           name_part(found, namebuf);
+           style_part(found, stylebuf);
+           size_part(found, sizebuf, data->in_pixels);
+           encoding_part(found, encodingbuf);
 
-           if (strlen(name) > 0
-                   && strlen(style) > 0
-                   && strlen(size) > 0
-                   && strlen(encoding) > 0)
+           if (strlen(namebuf) > 0
+                   && strlen(stylebuf) > 0
+                   && strlen(sizebuf) > 0
+                   && strlen(encodingbuf) > 0)
            {
-               data->sel[NAME] = XtNewString(name);
-               data->sel[STYLE] = XtNewString(style);
-               data->sel[SIZE] = XtNewString(size);
-               data->sel[ENCODING] = XtNewString(encoding);
+               data->sel[NAME] = XtNewString(namebuf);
+               data->sel[STYLE] = XtNewString(stylebuf);
+               data->sel[SIZE] = XtNewString(sizebuf);
+               data->sel[ENCODING] = XtNewString(encodingbuf);
                data->font_name = XtNewString(names[0]);
                display_sample(data);
                XmTextSetString(data->name, data->font_name);
index 77b59c240800e7cbb4218c995eb51cdc1c94ac94..3e134ce9d6ce239123c036200ade001a27f25275 100644 (file)
@@ -1256,7 +1256,7 @@ Redisplay(Widget w, XEvent *event, Region region)
     }
     else
     {
-       int adjust = 0;
+       adjust = 0;
 
 #if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
        /*
@@ -1268,12 +1268,11 @@ Redisplay(Widget w, XEvent *event, Region region)
        {
            case XmEXTERNAL_HIGHLIGHT:
                adjust = (eb->primitive.highlight_thickness -
-                       (eb->pushbutton.default_button_shadow_thickness ?
-                        Xm3D_ENHANCE_PIXEL : 0));
+                        (eb->pushbutton.default_button_shadow_thickness
+                         ?  Xm3D_ENHANCE_PIXEL : 0));
                break;
 
            case XmINTERNAL_HIGHLIGHT:
-               adjust = 0;
                break;
 
            default:
index a091165968c274d2bc653ff0b5c2cfc145ef3dde..9f56e884bae35a08b40f223a37ffce03e65636f9 100644 (file)
@@ -2372,7 +2372,7 @@ read_stdin()
      * Is there any other system that cannot do this?
      */
     close(0);
-    dup(2);
+    ignored = dup(2);
 #endif
 }
 
index a2ffd7e5f9c9c32a94e2ac3bede3cedd150ce44c..42b3063a0e791d791c04c6079c57f27ee52e3ca2 100644 (file)
@@ -717,7 +717,7 @@ codepage_invalid:
                     * where mblen() returns 0 for invalid character.
                     * Therefore, following condition includes 0.
                     */
-                   (void)mblen(NULL, 0);       /* First reset the state. */
+                   ignored = mblen(NULL, 0);   /* First reset the state. */
                    if (mblen(buf, (size_t)1) <= 0)
                        n = 2;
                    else
@@ -5278,7 +5278,7 @@ xim_decide_input_style()
 
 /*ARGSUSED*/
     static void
-preedit_start_cbproc(XIC xic, XPointer client_data, XPointer call_data)
+preedit_start_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
 {
 #ifdef XIM_DEBUG
     xim_log("xim_decide_input_style()\n");
@@ -5312,7 +5312,7 @@ static gboolean processing_queued_event = FALSE;
 
 /*ARGSUSED*/
     static void
-preedit_draw_cbproc(XIC xic, XPointer client_data, XPointer call_data)
+preedit_draw_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
 {
     XIMPreeditDrawCallbackStruct *draw_data;
     XIMText    *text;
@@ -5453,7 +5453,7 @@ im_get_feedback_attr(int col)
 
 /*ARGSUSED*/
     static void
-preedit_caret_cbproc(XIC xic, XPointer client_data, XPointer call_data)
+preedit_caret_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
 {
 #ifdef XIM_DEBUG
     xim_log("preedit_caret_cbproc()\n");
@@ -5462,7 +5462,7 @@ preedit_caret_cbproc(XIC xic, XPointer client_data, XPointer call_data)
 
 /*ARGSUSED*/
     static void
-preedit_done_cbproc(XIC xic, XPointer client_data, XPointer call_data)
+preedit_done_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
 {
 #ifdef XIM_DEBUG
     xim_log("preedit_done_cbproc()\n");
index bf340d04de4edf9e6722b1c02512fac3b687df0d..548a89eed083c7741ea5bc8fb98cbcc5435221f5 100644 (file)
@@ -4585,61 +4585,62 @@ vim_snprintf(str, str_m, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
                        if (remove_trailing_zeroes)
                        {
                            int i;
-                           char *p;
+                           char *tp;
 
                            /* Using %g or %G: remove superfluous zeroes. */
                            if (fmt_spec == 'f')
-                               p = tmp + str_arg_l - 1;
+                               tp = tmp + str_arg_l - 1;
                            else
                            {
-                               p = (char *)vim_strchr((char_u *)tmp,
+                               tp = (char *)vim_strchr((char_u *)tmp,
                                                 fmt_spec == 'e' ? 'e' : 'E');
-                               if (p != NULL)
+                               if (tp != NULL)
                                {
                                    /* Remove superfluous '+' and leading
                                     * zeroes from the exponent. */
-                                   if (p[1] == '+')
+                                   if (tp[1] == '+')
                                    {
                                        /* Change "1.0e+07" to "1.0e07" */
-                                       STRMOVE(p + 1, p + 2);
+                                       STRMOVE(tp + 1, tp + 2);
                                        --str_arg_l;
                                    }
-                                   i = (p[1] == '-') ? 2 : 1;
-                                   while (p[i] == '0')
+                                   i = (tp[1] == '-') ? 2 : 1;
+                                   while (tp[i] == '0')
                                    {
                                        /* Change "1.0e07" to "1.0e7" */
-                                       STRMOVE(p + i, p + i + 1);
+                                       STRMOVE(tp + i, tp + i + 1);
                                        --str_arg_l;
                                    }
-                                   --p;
+                                   --tp;
                                }
                            }
 
-                           if (p != NULL && !precision_specified)
+                           if (tp != NULL && !precision_specified)
                                /* Remove trailing zeroes, but keep the one
                                 * just after a dot. */
-                               while (p > tmp + 2 && *p == '0' && p[-1] != '.')
+                               while (tp > tmp + 2 && *tp == '0'
+                                                            && tp[-1] != '.')
                                {
-                                   STRMOVE(p, p + 1);
-                                   --p;
+                                   STRMOVE(tp, tp + 1);
+                                   --tp;
                                    --str_arg_l;
                                }
                        }
                        else
                        {
-                           char *p;
+                           char *tp;
 
                            /* Be consistent: some printf("%e") use 1.0e+12
                             * and some 1.0e+012.  Remove one zero in the last
                             * case. */
-                           p = (char *)vim_strchr((char_u *)tmp,
+                           tp = (char *)vim_strchr((char_u *)tmp,
                                                 fmt_spec == 'e' ? 'e' : 'E');
-                           if (p != NULL && (p[1] == '+' || p[1] == '-')
-                                         && p[2] == '0'
-                                         && vim_isdigit(p[3])
-                                         && vim_isdigit(p[4]))
+                           if (tp != NULL && (tp[1] == '+' || tp[1] == '-')
+                                         && tp[2] == '0'
+                                         && vim_isdigit(tp[3])
+                                         && vim_isdigit(tp[4]))
                            {
-                               STRMOVE(p + 2, p + 3);
+                               STRMOVE(tp + 2, tp + 3);
                                --str_arg_l;
                            }
                        }
index 19c365054f7bcdf24b12ed313f6c864ce802a9f5..92ca89f21cf0e4ce27f815188206fed6c21073e8 100644 (file)
@@ -1043,7 +1043,7 @@ netbeans_end(void)
        nbdebug(("EVT: %s", buf));
 /*     nb_send(buf, "netbeans_end");    avoid "write failed" messages */
        if (sd >= 0)
-           sock_write(sd, buf, (int)STRLEN(buf));  /* ignore errors */
+           ignored = sock_write(sd, buf, (int)STRLEN(buf));
     }
 }
 
@@ -2277,9 +2277,6 @@ nb_do_cmd(
            int serNum;
            int localTypeNum;
            int typeNum;
-# ifdef NBDEBUG
-           int len;
-# endif
            pos_T *pos;
 
            if (buf == NULL || buf->bufp == NULL)
@@ -2303,13 +2300,10 @@ nb_do_cmd(
            pos = get_off_or_lnum(buf->bufp, &args);
 
            cp = (char *)args;
-# ifdef NBDEBUG
-           len =
-# endif
-               strtol(cp, &cp, 10);
+           ignored = (int)strtol(cp, &cp, 10);
            args = (char_u *)cp;
 # ifdef NBDEBUG
-           if (len != -1)
+           if (ignored != -1)
            {
                nbdebug(("    partial line annotation -- Not Yet Implemented!\n"));
            }
index e8b8b0c7cbb85d0fcbca2f34e39e826a93e23baa..15986f4f9df3f0859eb5a47a7d094a97f43ccfd7 100644 (file)
@@ -8232,13 +8232,13 @@ set_option_value(name, number, string, opt_flags)
            {
                if (number == 0 && string != NULL)
                {
-                   int index;
+                   int idx;
 
                    /* Either we are given a string or we are setting option
                     * to zero. */
-                   for (index = 0; string[index] == '0'; ++index)
+                   for (idx = 0; string[idx] == '0'; ++idx)
                        ;
-                   if (string[index] != NUL || index == 0)
+                   if (string[idx] != NUL || idx == 0)
                    {
                        /* There's another character after zeros or the string
                         * is empty.  In both cases, we are trying to set a
index 782265bd916e345997efd4b4280ae4d5c7562e3a..9d6f6cb6f461acb73a9b6db16ed83bc835561444 100644 (file)
@@ -315,12 +315,15 @@ static struct signalinfo
     {-1,           "Unknown!", FALSE}
 };
 
+/*
+ * Write s[len] to the screen.
+ */
     void
 mch_write(s, len)
     char_u     *s;
     int                len;
 {
-    write(1, (char *)s, len);
+    ignored = (int)write(1, (char *)s, len);
     if (p_wd)          /* Unix is too fast, slow down a bit more */
        RealWaitForChar(read_cmd_fd, p_wd, NULL);
 }
@@ -3927,9 +3930,9 @@ mch_call_shell(cmd, options)
                 */
                if (fd >= 0)
                {
-                   dup(fd); /* To replace stdin  (file descriptor 0) */
-                   dup(fd); /* To replace stdout (file descriptor 1) */
-                   dup(fd); /* To replace stderr (file descriptor 2) */
+                   ignored = dup(fd); /* To replace stdin  (fd 0) */
+                   ignored = dup(fd); /* To replace stdout (fd 1) */
+                   ignored = dup(fd); /* To replace stderr (fd 2) */
 
                    /* Don't need this now that we've duplicated it */
                    close(fd);
@@ -3997,13 +4000,13 @@ mch_call_shell(cmd, options)
 
                    /* set up stdin/stdout/stderr for the child */
                    close(0);
-                   dup(pty_slave_fd);
+                   ignored = dup(pty_slave_fd);
                    close(1);
-                   dup(pty_slave_fd);
+                   ignored = dup(pty_slave_fd);
                    if (gui.in_use)
                    {
                        close(2);
-                       dup(pty_slave_fd);
+                       ignored = dup(pty_slave_fd);
                    }
 
                    close(pty_slave_fd);    /* has been dupped, close it now */
@@ -4014,13 +4017,13 @@ mch_call_shell(cmd, options)
                    /* set up stdin for the child */
                    close(fd_toshell[1]);
                    close(0);
-                   dup(fd_toshell[0]);
+                   ignored = dup(fd_toshell[0]);
                    close(fd_toshell[0]);
 
                    /* set up stdout for the child */
                    close(fd_fromshell[0]);
                    close(1);
-                   dup(fd_fromshell[1]);
+                   ignored = dup(fd_fromshell[1]);
                    close(fd_fromshell[1]);
 
 # ifdef FEAT_GUI
@@ -4028,7 +4031,7 @@ mch_call_shell(cmd, options)
                    {
                        /* set up stderr for the child */
                        close(2);
-                       dup(1);
+                       ignored = dup(1);
                    }
 # endif
                }
@@ -4159,7 +4162,8 @@ mch_call_shell(cmd, options)
                                            && (lnum !=
                                                    curbuf->b_ml.ml_line_count
                                                    || curbuf->b_p_eol)))
-                                   write(toshell_fd, "\n", (size_t)1);
+                                   ignored = write(toshell_fd, "\n",
+                                                                  (size_t)1);
                                ++lnum;
                                if (lnum > curbuf->b_op_end.lnum)
                                {
index 039dfca0022f278e38f7ca52589821bbdad17bc4..4807fff963d5e1df794cb017cacc7b7648f27373 100644 (file)
@@ -4950,7 +4950,7 @@ static int node_equal __ARGS((wordnode_T *n1, wordnode_T *n2));
 static void put_sugtime __ARGS((spellinfo_T *spin, FILE *fd));
 static int write_vim_spell __ARGS((spellinfo_T *spin, char_u *fname));
 static void clear_node __ARGS((wordnode_T *node));
-static int put_node __ARGS((FILE *fd, wordnode_T *node, int index, int regionmask, int prefixtree));
+static int put_node __ARGS((FILE *fd, wordnode_T *node, int idx, int regionmask, int prefixtree));
 static void spell_make_sugfile __ARGS((spellinfo_T *spin, char_u *wfname));
 static int sug_filltree __ARGS((spellinfo_T *spin, slang_T *slang));
 static int sug_maketable __ARGS((spellinfo_T *spin));
index 6d408b0c19545f6f59ea9354b6d040ff4461039b..8cff1d82254f77ab21161b4bcc35e2f3850152ff 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -1820,7 +1820,7 @@ fill_input_buf(exit_on_error)
 #ifdef HAVE_DUP
            /* Use stderr for stdin, also works for shell commands. */
            close(0);
-           dup(2);
+           ignored = dup(2);
 #else
            read_cmd_fd = 2;    /* read from stderr instead of stdin */
 #endif
index 5e44f9ad72b83343c28a287741a5533505521c74..8b6c0210aab39a43617543024bab1ba3a62e873e 100644 (file)
@@ -676,6 +676,10 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    55,
+/**/
+    54,
 /**/
     53,
 /**/
index 2feb9e25b5c539b933e4e0efeddd4fb1a71644ae..b360f54e110e100995c9f14a09882af37158141f 100644 (file)
@@ -4029,14 +4029,14 @@ win_enter_ext(wp, undo_sync, curwin_invalid)
            if (mch_dirname(cwd, MAXPATHL) == OK)
                globaldir = vim_strsave(cwd);
        }
-       mch_chdir((char *)curwin->w_localdir);
-       shorten_fnames(TRUE);
+       if (mch_chdir((char *)curwin->w_localdir) == 0)
+           shorten_fnames(TRUE);
     }
     else if (globaldir != NULL)
     {
        /* Window doesn't have a local directory and we are not in the global
         * directory: Change to the global directory. */
-       mch_chdir((char *)globaldir);
+       ignored = mch_chdir((char *)globaldir);
        vim_free(globaldir);
        globaldir = NULL;
        shorten_fnames(TRUE);