4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Various compiler warnings with strict checking.
12 Solution: Avoid the warnings by using return values and renaming.
13 Files: src/diff.c, src/eval.c, src/ex_cmds.c, src/ex_docmd.c,
14 src/fileio.c, src/fold.c, src/globals.h, src/gui.c,
15 src/gui_at_sb.c, src/gui_gtk_x11.c, src/gui_xmdlg.c,
16 src/gui_xmebw.c, src/main.c, src/mbyte.c, src/message.c,
17 src/netbeans.c, src/option.c, src/os_unix.c, src/spell.c,
18 src/ui.c, src/window.c
21 *** ../vim-7.2.054/src/diff.c Fri Jan 18 17:39:32 2008
22 --- src/diff.c Fri Nov 28 17:23:35 2008
29 + int io_error = FALSE;
31 /* Delete all diffblocks. */
37 fd = mch_fopen((char *)tmp_orig, "w");
40 ! fwrite("line1\n", (size_t)6, (size_t)1, fd);
42 fd = mch_fopen((char *)tmp_new, "w");
45 ! fwrite("line2\n", (size_t)6, (size_t)1, fd);
47 diff_file(tmp_orig, tmp_new, tmp_diff);
48 fd = mch_fopen((char *)tmp_diff, "r");
51 char_u linebuf[LBUFLEN];
56 fd = mch_fopen((char *)tmp_orig, "w");
61 ! if (fwrite("line1\n", (size_t)6, (size_t)1, fd) != 1)
64 fd = mch_fopen((char *)tmp_new, "w");
69 ! if (fwrite("line2\n", (size_t)6, (size_t)1, fd) != 1)
72 diff_file(tmp_orig, tmp_new, tmp_diff);
73 fd = mch_fopen((char *)tmp_diff, "r");
78 char_u linebuf[LBUFLEN];
87 + EMSG(_("E810: Cannot read or write temp files"));
88 EMSG(_("E97: Cannot create diffs"));
90 #if defined(MSWIN) || defined(MSDOS)
95 if (vim_tempdir != NULL)
96 ! mch_chdir((char *)vim_tempdir);
100 shorten_fnames(TRUE);
106 if (vim_tempdir != NULL)
107 ! ignored = mch_chdir((char *)vim_tempdir);
110 ! ignored = mch_chdir("/tmp");
111 shorten_fnames(TRUE);
114 *** ../vim-7.2.054/src/eval.c Fri Nov 28 11:15:10 2008
115 --- src/eval.c Fri Nov 28 12:23:13 2008
123 if (row >= 0 && col >= 0)
131 if (row >= 0 && col >= 0)
135 (void)mouse_comp_pos(win, &row, &col, &lnum);
137 for (wp = firstwin; wp != win; wp = wp->w_next)
140 ! vimvars[VV_MOUSE_WIN].vv_nr = n;
141 vimvars[VV_MOUSE_LNUM].vv_nr = lnum;
142 vimvars[VV_MOUSE_COL].vv_nr = col + 1;
145 (void)mouse_comp_pos(win, &row, &col, &lnum);
147 for (wp = firstwin; wp != win; wp = wp->w_next)
150 ! vimvars[VV_MOUSE_WIN].vv_nr = winnr;
151 vimvars[VV_MOUSE_LNUM].vv_nr = lnum;
152 vimvars[VV_MOUSE_COL].vv_nr = col + 1;
154 *** ../vim-7.2.054/src/ex_cmds.c Sat Nov 15 14:10:23 2008
155 --- src/ex_cmds.c Fri Nov 28 17:24:08 2008
161 ! (void)fchown(fileno(fp_out), st_old.st_uid, st_old.st_gid);
169 ! ignored = fchown(fileno(fp_out), st_old.st_uid, st_old.st_gid);
173 *** ../vim-7.2.054/src/ex_docmd.c Sat Nov 15 14:10:23 2008
174 --- src/ex_docmd.c Fri Nov 28 17:26:13 2008
177 else if (*dirnow != NUL
178 && (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
180 ! (void)mch_chdir((char *)globaldir);
181 ! shorten_fnames(TRUE);
184 failed |= (makeopens(fd, dirnow) == FAIL);
186 else if (*dirnow != NUL
187 && (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
189 ! if (mch_chdir((char *)globaldir) == OK)
190 ! shorten_fnames(TRUE);
193 failed |= (makeopens(fd, dirnow) == FAIL);
194 *** ../vim-7.2.054/src/fileio.c Wed Nov 12 16:04:43 2008
195 --- src/fileio.c Fri Nov 28 17:35:54 2008
199 /* Use stderr for stdin, makes shell commands work. */
207 /* Use stderr for stdin, makes shell commands work. */
218 ! fchown(fd, st_old.st_uid, st_old.st_gid);
220 if (mch_stat((char *)IObuff, &st) < 0
221 || st.st_uid != st_old.st_uid
226 ! ignored = fchown(fd, st_old.st_uid, st_old.st_gid);
228 if (mch_stat((char *)IObuff, &st) < 0
229 || st.st_uid != st_old.st_uid
232 || st.st_uid != st_old.st_uid
233 || st.st_gid != st_old.st_gid)
235 ! fchown(fd, st_old.st_uid, st_old.st_gid);
236 if (perm >= 0) /* set permission again, may have changed */
237 (void)mch_setperm(wfname, perm);
240 || st.st_uid != st_old.st_uid
241 || st.st_gid != st_old.st_gid)
243 ! ignored = fchown(fd, st_old.st_uid, st_old.st_gid);
244 if (perm >= 0) /* set permission again, may have changed */
245 (void)mch_setperm(wfname, perm);
250 tbuf[FGETS_SIZE - 2] = NUL;
252 ! fgets_cr((char *)tbuf, FGETS_SIZE, fp);
254 ! fgets((char *)tbuf, FGETS_SIZE, fp);
256 } while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n');
260 tbuf[FGETS_SIZE - 2] = NUL;
262 ! ignoredp = fgets_cr((char *)tbuf, FGETS_SIZE, fp);
264 ! ignoredp = fgets((char *)tbuf, FGETS_SIZE, fp);
266 } while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n');
268 *** ../vim-7.2.054/src/fold.c Wed Aug 6 18:59:40 2008
269 --- src/fold.c Fri Nov 28 12:24:16 2008
272 static int foldFind __ARGS((garray_T *gap, linenr_T lnum, fold_T **fpp));
273 static int foldLevelWin __ARGS((win_T *wp, linenr_T lnum));
274 static void checkupdate __ARGS((win_T *wp));
275 ! static void setFoldRepeat __ARGS((linenr_T lnum, long count, int open));
276 static linenr_T setManualFold __ARGS((linenr_T lnum, int opening, int recurse, int *donep));
277 static linenr_T setManualFoldWin __ARGS((win_T *wp, linenr_T lnum, int opening, int recurse, int *donep));
278 static void foldOpenNested __ARGS((fold_T *fpr));
280 static int foldFind __ARGS((garray_T *gap, linenr_T lnum, fold_T **fpp));
281 static int foldLevelWin __ARGS((win_T *wp, linenr_T lnum));
282 static void checkupdate __ARGS((win_T *wp));
283 ! static void setFoldRepeat __ARGS((linenr_T lnum, long count, int do_open));
284 static linenr_T setManualFold __ARGS((linenr_T lnum, int opening, int recurse, int *donep));
285 static linenr_T setManualFoldWin __ARGS((win_T *wp, linenr_T lnum, int opening, int recurse, int *donep));
286 static void foldOpenNested __ARGS((fold_T *fpr));
289 * Repeat "count" times.
292 ! setFoldRepeat(lnum, count, open)
300 * Repeat "count" times.
303 ! setFoldRepeat(lnum, count, do_open)
312 for (n = 0; n < count; ++n)
315 ! (void)setManualFold(lnum, open, FALSE, &done);
316 if (!(done & DONE_ACTION))
318 /* Only give an error message when no fold could be opened. */
320 for (n = 0; n < count; ++n)
323 ! (void)setManualFold(lnum, do_open, FALSE, &done);
324 if (!(done & DONE_ACTION))
326 /* Only give an error message when no fold could be opened. */
327 *** ../vim-7.2.054/src/globals.h Thu Sep 18 21:29:07 2008
328 --- src/globals.h Fri Nov 28 17:35:50 2008
332 EXTERN time_t starttime;
335 + * Some compilers warn for not using a return value, but in some situations we
336 + * can't do anything useful with the value. Assign to this variable to avoid
339 + EXTERN int ignored;
340 + EXTERN char *ignoredp;
343 * Optional Farsi support. Include it here, so EXTERN and INIT are defined.
346 *** ../vim-7.2.054/src/gui.c Wed Aug 6 14:37:26 2008
347 --- src/gui.c Fri Nov 28 18:48:31 2008
350 /* The read returns when the child closes the pipe (or when
351 * the child dies for some reason). */
353 ! (void)read(pipefd[0], &dummy, (size_t)1);
358 /* The read returns when the child closes the pipe (or when
359 * the child dies for some reason). */
361 ! ignored = (int)read(pipefd[0], &dummy, (size_t)1);
365 *** ../vim-7.2.054/src/gui_at_sb.c Sun Jun 13 21:37:13 2004
366 --- src/gui_at_sb.c Fri Nov 28 12:19:19 2008
370 Cardinal *num_params; /* unused */
372 ScrollbarWidget sbw = (ScrollbarWidget)w;
373 + /* Use a union to avoid a warning for the weird conversion from float to
374 + * XtPointer. Comes from Xaw/Scrollbar.c. */
380 if (LookAhead(w, event))
384 /* thumbProc is not pretty, but is necessary for backwards
385 compatibility on those architectures for which it work{s,ed};
386 the intent is to pass a (truncated) float by value. */
387 ! XtCallCallbacks(w, XtNthumbProc, *(XtPointer*)&sbw->scrollbar.top);
388 XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);
392 /* thumbProc is not pretty, but is necessary for backwards
393 compatibility on those architectures for which it work{s,ed};
394 the intent is to pass a (truncated) float by value. */
395 ! xtpf.xtf = sbw->scrollbar.top;
396 ! XtCallCallbacks(w, XtNthumbProc, xtpf.xtp);
397 XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);
400 *** ../vim-7.2.054/src/gui_gtk_x11.c Tue Jul 8 12:46:08 2008
401 --- src/gui_gtk_x11.c Fri Nov 28 21:06:38 2008
405 if (mask & (XValue | YValue))
408 ! gui_mch_get_screen_dimensions(&w, &h);
409 ! h += p_ghr + get_menu_tool_height();
410 ! w += get_menu_tool_width();
411 if (mask & XNegative)
412 ! x += w - pixel_width;
413 if (mask & YNegative)
414 ! y += h - pixel_height;
416 gtk_window_move(GTK_WINDOW(gui.mainwin), x, y);
420 if (mask & (XValue | YValue))
423 ! gui_mch_get_screen_dimensions(&ww, &hh);
424 ! hh += p_ghr + get_menu_tool_height();
425 ! ww += get_menu_tool_width();
426 if (mask & XNegative)
427 ! x += ww - pixel_width;
428 if (mask & YNegative)
429 ! y += hh - pixel_height;
431 gtk_window_move(GTK_WINDOW(gui.mainwin), x, y);
433 *** ../vim-7.2.054/src/gui_xmdlg.c Tue Jun 24 23:39:32 2008
434 --- src/gui_xmdlg.c Fri Nov 28 21:04:08 2008
437 char buf[TEMP_BUF_SIZE];
438 XmString items[MAX_ENTRIES_IN_LIST];
442 ! for (index = (int)ENCODING; index < (int)NONE; ++index)
445 /* First we insert the wild char into every single list. */
448 char buf[TEMP_BUF_SIZE];
449 XmString items[MAX_ENTRIES_IN_LIST];
453 ! for (idx = (int)ENCODING; idx < (int)NONE; ++idx)
456 /* First we insert the wild char into every single list. */
461 * Now loop trough the remaining lists and set them up.
463 ! for (index = (int)NAME; index < (int)NONE; ++index)
467 ! if (fix == (enum ListSpecifier)index)
470 ! switch ((enum ListSpecifier)index)
473 w = data->list[NAME];
476 * Now loop trough the remaining lists and set them up.
478 ! for (idx = (int)NAME; idx < (int)NONE; ++idx)
482 ! if (fix == (enum ListSpecifier)idx)
485 ! switch ((enum ListSpecifier)idx)
488 w = data->list[NAME];
491 w = (Widget)0; /* for lint */
494 ! for (i = 0; i < count[index]; ++i)
496 ! items[i] = XmStringCreateLocalized(list[index][i]);
497 ! XtFree(list[index][i]);
499 XmListDeleteAllItems(w);
500 ! XmListAddItems(w, items, count[index], 1);
501 ! if (data->sel[index])
503 XmStringFree(items[0]);
504 ! items[0] = XmStringCreateLocalized(data->sel[index]);
505 XmListSelectItem(w, items[0], False);
506 XmListSetBottomItem(w, items[0]);
508 ! for (i = 0; i < count[index]; ++i)
509 XmStringFree(items[i]);
513 w = (Widget)0; /* for lint */
516 ! for (i = 0; i < count[idx]; ++i)
518 ! items[i] = XmStringCreateLocalized(list[idx][i]);
519 ! XtFree(list[idx][i]);
521 XmListDeleteAllItems(w);
522 ! XmListAddItems(w, items, count[idx], 1);
523 ! if (data->sel[idx])
525 XmStringFree(items[0]);
526 ! items[0] = XmStringCreateLocalized(data->sel[idx]);
527 XmListSelectItem(w, items[0], False);
528 XmListSetBottomItem(w, items[0]);
530 ! for (i = 0; i < count[idx]; ++i)
531 XmStringFree(items[i]);
539 ! char *msg = _("no specific match");
542 ! str = XmStringCreateLocalized(msg);
543 XtSetArg(args[n], XmNlabelString, str); ++n;
544 XtSetValues(data->sample, args, n);
545 apply_fontlist(data->sample);
546 ! XmTextSetString(data->name, msg);
554 ! char *nomatch_msg = _("no specific match");
557 ! str = XmStringCreateLocalized(nomatch_msg);
558 XtSetArg(args[n], XmNlabelString, str); ++n;
559 XtSetValues(data->sample, args, n);
560 apply_fontlist(data->sample);
561 ! XmTextSetString(data->name, nomatch_msg);
574 for (i = 0, max = 0; i < data->num; i++)
576 ! get_part(fn(data, i), 7, str);
578 if ((size > max) && (size < MAX_DISPLAY_SIZE))
584 ! strcpy(big_font, fn(data, index));
586 data->old = XLoadQueryFont(XtDisplay(parent), big_font);
587 data->old_list = gui_motif_create_fontlist(data->old);
596 for (i = 0, max = 0; i < data->num; i++)
598 ! get_part(fn(data, i), 7, buf);
600 if ((size > max) && (size < MAX_DISPLAY_SIZE))
606 ! strcpy(big_font, fn(data, idx));
608 data->old = XLoadQueryFont(XtDisplay(parent), big_font);
609 data->old_list = gui_motif_create_fontlist(data->old);
615 ! char name[TEMP_BUF_SIZE];
616 ! char style[TEMP_BUF_SIZE];
617 ! char size[TEMP_BUF_SIZE];
618 ! char encoding[TEMP_BUF_SIZE];
623 ! name_part(found, name);
624 ! style_part(found, style);
625 ! size_part(found, size, data->in_pixels);
626 ! encoding_part(found, encoding);
628 ! if (strlen(name) > 0
629 ! && strlen(style) > 0
630 ! && strlen(size) > 0
631 ! && strlen(encoding) > 0)
633 ! data->sel[NAME] = XtNewString(name);
634 ! data->sel[STYLE] = XtNewString(style);
635 ! data->sel[SIZE] = XtNewString(size);
636 ! data->sel[ENCODING] = XtNewString(encoding);
637 data->font_name = XtNewString(names[0]);
638 display_sample(data);
639 XmTextSetString(data->name, data->font_name);
644 ! char namebuf[TEMP_BUF_SIZE];
645 ! char stylebuf[TEMP_BUF_SIZE];
646 ! char sizebuf[TEMP_BUF_SIZE];
647 ! char encodingbuf[TEMP_BUF_SIZE];
652 ! name_part(found, namebuf);
653 ! style_part(found, stylebuf);
654 ! size_part(found, sizebuf, data->in_pixels);
655 ! encoding_part(found, encodingbuf);
657 ! if (strlen(namebuf) > 0
658 ! && strlen(stylebuf) > 0
659 ! && strlen(sizebuf) > 0
660 ! && strlen(encodingbuf) > 0)
662 ! data->sel[NAME] = XtNewString(namebuf);
663 ! data->sel[STYLE] = XtNewString(stylebuf);
664 ! data->sel[SIZE] = XtNewString(sizebuf);
665 ! data->sel[ENCODING] = XtNewString(encodingbuf);
666 data->font_name = XtNewString(names[0]);
667 display_sample(data);
668 XmTextSetString(data->name, data->font_name);
669 *** ../vim-7.2.054/src/gui_xmebw.c Thu Nov 8 20:48:14 2007
670 --- src/gui_xmebw.c Fri Nov 28 18:58:53 2008
678 #if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
686 #if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
691 case XmEXTERNAL_HIGHLIGHT:
692 adjust = (eb->primitive.highlight_thickness -
693 ! (eb->pushbutton.default_button_shadow_thickness ?
694 ! Xm3D_ENHANCE_PIXEL : 0));
697 case XmINTERNAL_HIGHLIGHT:
704 case XmEXTERNAL_HIGHLIGHT:
705 adjust = (eb->primitive.highlight_thickness -
706 ! (eb->pushbutton.default_button_shadow_thickness
707 ! ? Xm3D_ENHANCE_PIXEL : 0));
710 case XmINTERNAL_HIGHLIGHT:
714 *** ../vim-7.2.054/src/main.c Thu Nov 20 14:11:47 2008
715 --- src/main.c Fri Nov 28 18:32:48 2008
718 * Is there any other system that cannot do this?
726 * Is there any other system that cannot do this?
733 *** ../vim-7.2.054/src/mbyte.c Thu Nov 20 17:09:09 2008
734 --- src/mbyte.c Fri Nov 28 18:44:05 2008
737 * where mblen() returns 0 for invalid character.
738 * Therefore, following condition includes 0.
740 ! (void)mblen(NULL, 0); /* First reset the state. */
741 if (mblen(buf, (size_t)1) <= 0)
745 * where mblen() returns 0 for invalid character.
746 * Therefore, following condition includes 0.
748 ! ignored = mblen(NULL, 0); /* First reset the state. */
749 if (mblen(buf, (size_t)1) <= 0)
757 ! preedit_start_cbproc(XIC xic, XPointer client_data, XPointer call_data)
760 xim_log("xim_decide_input_style()\n");
765 ! preedit_start_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
768 xim_log("xim_decide_input_style()\n");
774 ! preedit_draw_cbproc(XIC xic, XPointer client_data, XPointer call_data)
776 XIMPreeditDrawCallbackStruct *draw_data;
782 ! preedit_draw_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
784 XIMPreeditDrawCallbackStruct *draw_data;
791 ! preedit_caret_cbproc(XIC xic, XPointer client_data, XPointer call_data)
794 xim_log("preedit_caret_cbproc()\n");
799 ! preedit_caret_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
802 xim_log("preedit_caret_cbproc()\n");
808 ! preedit_done_cbproc(XIC xic, XPointer client_data, XPointer call_data)
811 xim_log("preedit_done_cbproc()\n");
816 ! preedit_done_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
819 xim_log("preedit_done_cbproc()\n");
820 *** ../vim-7.2.054/src/message.c Sun Jul 13 19:18:44 2008
821 --- src/message.c Fri Nov 28 12:26:56 2008
824 if (remove_trailing_zeroes)
829 /* Using %g or %G: remove superfluous zeroes. */
831 ! p = tmp + str_arg_l - 1;
834 ! p = (char *)vim_strchr((char_u *)tmp,
835 fmt_spec == 'e' ? 'e' : 'E');
838 /* Remove superfluous '+' and leading
839 * zeroes from the exponent. */
842 /* Change "1.0e+07" to "1.0e07" */
843 ! STRMOVE(p + 1, p + 2);
846 ! i = (p[1] == '-') ? 2 : 1;
847 ! while (p[i] == '0')
849 /* Change "1.0e07" to "1.0e7" */
850 ! STRMOVE(p + i, p + i + 1);
857 ! if (p != NULL && !precision_specified)
858 /* Remove trailing zeroes, but keep the one
859 * just after a dot. */
860 ! while (p > tmp + 2 && *p == '0' && p[-1] != '.')
871 /* Be consistent: some printf("%e") use 1.0e+12
872 * and some 1.0e+012. Remove one zero in the last
874 ! p = (char *)vim_strchr((char_u *)tmp,
875 fmt_spec == 'e' ? 'e' : 'E');
876 ! if (p != NULL && (p[1] == '+' || p[1] == '-')
878 ! && vim_isdigit(p[3])
879 ! && vim_isdigit(p[4]))
881 ! STRMOVE(p + 2, p + 3);
886 if (remove_trailing_zeroes)
891 /* Using %g or %G: remove superfluous zeroes. */
893 ! tp = tmp + str_arg_l - 1;
896 ! tp = (char *)vim_strchr((char_u *)tmp,
897 fmt_spec == 'e' ? 'e' : 'E');
900 /* Remove superfluous '+' and leading
901 * zeroes from the exponent. */
904 /* Change "1.0e+07" to "1.0e07" */
905 ! STRMOVE(tp + 1, tp + 2);
908 ! i = (tp[1] == '-') ? 2 : 1;
909 ! while (tp[i] == '0')
911 /* Change "1.0e07" to "1.0e7" */
912 ! STRMOVE(tp + i, tp + i + 1);
919 ! if (tp != NULL && !precision_specified)
920 /* Remove trailing zeroes, but keep the one
921 * just after a dot. */
922 ! while (tp > tmp + 2 && *tp == '0'
925 ! STRMOVE(tp, tp + 1);
934 /* Be consistent: some printf("%e") use 1.0e+12
935 * and some 1.0e+012. Remove one zero in the last
937 ! tp = (char *)vim_strchr((char_u *)tmp,
938 fmt_spec == 'e' ? 'e' : 'E');
939 ! if (tp != NULL && (tp[1] == '+' || tp[1] == '-')
941 ! && vim_isdigit(tp[3])
942 ! && vim_isdigit(tp[4]))
944 ! STRMOVE(tp + 2, tp + 3);
948 *** ../vim-7.2.054/src/netbeans.c Sat Nov 15 14:10:23 2008
949 --- src/netbeans.c Fri Nov 28 18:51:43 2008
952 nbdebug(("EVT: %s", buf));
953 /* nb_send(buf, "netbeans_end"); avoid "write failed" messages */
955 ! sock_write(sd, buf, (int)STRLEN(buf)); /* ignore errors */
960 nbdebug(("EVT: %s", buf));
961 /* nb_send(buf, "netbeans_end"); avoid "write failed" messages */
963 ! ignored = sock_write(sd, buf, (int)STRLEN(buf));
977 if (buf == NULL || buf->bufp == NULL)
981 pos = get_off_or_lnum(buf->bufp, &args);
987 ! strtol(cp, &cp, 10);
992 nbdebug((" partial line annotation -- Not Yet Implemented!\n"));
995 pos = get_off_or_lnum(buf->bufp, &args);
998 ! ignored = (int)strtol(cp, &cp, 10);
1001 ! if (ignored != -1)
1003 nbdebug((" partial line annotation -- Not Yet Implemented!\n"));
1005 *** ../vim-7.2.054/src/option.c Sun Nov 9 13:43:25 2008
1006 --- src/option.c Fri Nov 28 12:27:34 2008
1010 if (number == 0 && string != NULL)
1014 /* Either we are given a string or we are setting option
1016 ! for (index = 0; string[index] == '0'; ++index)
1018 ! if (string[index] != NUL || index == 0)
1020 /* There's another character after zeros or the string
1021 * is empty. In both cases, we are trying to set a
1024 if (number == 0 && string != NULL)
1028 /* Either we are given a string or we are setting option
1030 ! for (idx = 0; string[idx] == '0'; ++idx)
1032 ! if (string[idx] != NUL || idx == 0)
1034 /* There's another character after zeros or the string
1035 * is empty. In both cases, we are trying to set a
1036 *** ../vim-7.2.054/src/os_unix.c Wed Nov 12 14:09:38 2008
1037 --- src/os_unix.c Fri Nov 28 18:39:55 2008
1040 {-1, "Unknown!", FALSE}
1048 ! write(1, (char *)s, len);
1049 if (p_wd) /* Unix is too fast, slow down a bit more */
1050 RealWaitForChar(read_cmd_fd, p_wd, NULL);
1053 {-1, "Unknown!", FALSE}
1057 + * Write s[len] to the screen.
1064 ! ignored = (int)write(1, (char *)s, len);
1065 if (p_wd) /* Unix is too fast, slow down a bit more */
1066 RealWaitForChar(read_cmd_fd, p_wd, NULL);
1073 ! dup(fd); /* To replace stdin (file descriptor 0) */
1074 ! dup(fd); /* To replace stdout (file descriptor 1) */
1075 ! dup(fd); /* To replace stderr (file descriptor 2) */
1077 /* Don't need this now that we've duplicated it */
1083 ! ignored = dup(fd); /* To replace stdin (fd 0) */
1084 ! ignored = dup(fd); /* To replace stdout (fd 1) */
1085 ! ignored = dup(fd); /* To replace stderr (fd 2) */
1087 /* Don't need this now that we've duplicated it */
1092 /* set up stdin/stdout/stderr for the child */
1094 ! dup(pty_slave_fd);
1096 ! dup(pty_slave_fd);
1100 ! dup(pty_slave_fd);
1103 close(pty_slave_fd); /* has been dupped, close it now */
1106 /* set up stdin/stdout/stderr for the child */
1108 ! ignored = dup(pty_slave_fd);
1110 ! ignored = dup(pty_slave_fd);
1114 ! ignored = dup(pty_slave_fd);
1117 close(pty_slave_fd); /* has been dupped, close it now */
1120 /* set up stdin for the child */
1121 close(fd_toshell[1]);
1123 ! dup(fd_toshell[0]);
1124 close(fd_toshell[0]);
1126 /* set up stdout for the child */
1127 close(fd_fromshell[0]);
1129 ! dup(fd_fromshell[1]);
1130 close(fd_fromshell[1]);
1134 /* set up stdin for the child */
1135 close(fd_toshell[1]);
1137 ! ignored = dup(fd_toshell[0]);
1138 close(fd_toshell[0]);
1140 /* set up stdout for the child */
1141 close(fd_fromshell[0]);
1143 ! ignored = dup(fd_fromshell[1]);
1144 close(fd_fromshell[1]);
1150 /* set up stderr for the child */
1158 /* set up stderr for the child */
1167 curbuf->b_ml.ml_line_count
1168 || curbuf->b_p_eol)))
1169 ! write(toshell_fd, "\n", (size_t)1);
1171 if (lnum > curbuf->b_op_end.lnum)
1175 curbuf->b_ml.ml_line_count
1176 || curbuf->b_p_eol)))
1177 ! ignored = write(toshell_fd, "\n",
1180 if (lnum > curbuf->b_op_end.lnum)
1182 *** ../vim-7.2.054/src/spell.c Fri Nov 28 10:08:05 2008
1183 --- src/spell.c Fri Nov 28 12:28:24 2008
1186 static void put_sugtime __ARGS((spellinfo_T *spin, FILE *fd));
1187 static int write_vim_spell __ARGS((spellinfo_T *spin, char_u *fname));
1188 static void clear_node __ARGS((wordnode_T *node));
1189 ! static int put_node __ARGS((FILE *fd, wordnode_T *node, int index, int regionmask, int prefixtree));
1190 static void spell_make_sugfile __ARGS((spellinfo_T *spin, char_u *wfname));
1191 static int sug_filltree __ARGS((spellinfo_T *spin, slang_T *slang));
1192 static int sug_maketable __ARGS((spellinfo_T *spin));
1194 static void put_sugtime __ARGS((spellinfo_T *spin, FILE *fd));
1195 static int write_vim_spell __ARGS((spellinfo_T *spin, char_u *fname));
1196 static void clear_node __ARGS((wordnode_T *node));
1197 ! static int put_node __ARGS((FILE *fd, wordnode_T *node, int idx, int regionmask, int prefixtree));
1198 static void spell_make_sugfile __ARGS((spellinfo_T *spin, char_u *wfname));
1199 static int sug_filltree __ARGS((spellinfo_T *spin, slang_T *slang));
1200 static int sug_maketable __ARGS((spellinfo_T *spin));
1201 *** ../vim-7.2.054/src/ui.c Sun Sep 14 15:57:54 2008
1202 --- src/ui.c Fri Nov 28 19:04:36 2008
1206 /* Use stderr for stdin, also works for shell commands. */
1210 read_cmd_fd = 2; /* read from stderr instead of stdin */
1214 /* Use stderr for stdin, also works for shell commands. */
1218 read_cmd_fd = 2; /* read from stderr instead of stdin */
1220 *** ../vim-7.2.054/src/window.c Sat Nov 15 14:10:23 2008
1221 --- src/window.c Fri Nov 28 18:46:45 2008
1224 if (mch_dirname(cwd, MAXPATHL) == OK)
1225 globaldir = vim_strsave(cwd);
1227 ! mch_chdir((char *)curwin->w_localdir);
1228 ! shorten_fnames(TRUE);
1230 else if (globaldir != NULL)
1232 /* Window doesn't have a local directory and we are not in the global
1233 * directory: Change to the global directory. */
1234 ! mch_chdir((char *)globaldir);
1235 vim_free(globaldir);
1237 shorten_fnames(TRUE);
1239 if (mch_dirname(cwd, MAXPATHL) == OK)
1240 globaldir = vim_strsave(cwd);
1242 ! if (mch_chdir((char *)curwin->w_localdir) == 0)
1243 ! shorten_fnames(TRUE);
1245 else if (globaldir != NULL)
1247 /* Window doesn't have a local directory and we are not in the global
1248 * directory: Change to the global directory. */
1249 ! ignored = mch_chdir((char *)globaldir);
1250 vim_free(globaldir);
1252 shorten_fnames(TRUE);
1253 *** ../vim-7.2.054/src/version.c Fri Nov 28 12:05:07 2008
1254 --- src/version.c Fri Nov 28 21:12:42 2008
1258 { /* Add new patch number below this line */
1264 PRINCE: He's come to rescue me, father.
1265 LAUNCELOT: (embarrassed) Well, let's not jump to conclusions ...
1266 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
1268 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
1269 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
1270 \\\ download, build and distribute -- http://www.A-A-P.org ///
1271 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///