4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Warnings from static code analysis.
12 Solution: Small changes to various lines. (Dominique Pelle)
13 Files: src/buffer.c, src/edit.c, src/ex_getln.c, src/fileio.c,
14 src/if_cscope.c, src/netbeans.c, src/ops.c, src/quickfix.c,
15 src/syntax.c, src/ui.c
18 *** ../vim-7.2.332/src/buffer.c 2009-05-17 13:30:58.000000000 +0200
19 --- src/buffer.c 2010-01-19 12:50:24.000000000 +0100
25 ! int nwindows = buf->b_nwindows;
27 int unload_buf = (action != 0);
28 int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
35 int unload_buf = (action != 0);
36 int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
37 *** ../vim-7.2.332/src/edit.c 2009-12-24 15:45:53.000000000 +0100
38 --- src/edit.c 2010-01-19 12:53:18.000000000 +0100
42 p_ic = ignorecase(compl_pattern);
44 ! /* Find up to TAG_MANY matches. Avoids that an enourmous number
45 * of matches is found when compl_pattern is empty */
46 if (find_tags(compl_pattern, &num_matches, &matches,
47 TAG_REGEXP | TAG_NAMES | TAG_NOIC |
50 p_ic = ignorecase(compl_pattern);
52 ! /* Find up to TAG_MANY matches. Avoids that an enormous number
53 * of matches is found when compl_pattern is empty */
54 if (find_tags(compl_pattern, &num_matches, &matches,
55 TAG_REGEXP | TAG_NAMES | TAG_NOIC |
58 || IObuff[len - 2] == '!'))))
61 ! /* copy as much as posible of the new word */
62 if (tmp_ptr - ptr >= IOSIZE - len)
63 tmp_ptr = ptr + IOSIZE - len - 1;
64 STRNCPY(IObuff + len, ptr, tmp_ptr - ptr);
66 || IObuff[len - 2] == '!'))))
69 ! /* copy as much as possible of the new word */
70 if (tmp_ptr - ptr >= IOSIZE - len)
71 tmp_ptr = ptr + IOSIZE - len - 1;
72 STRNCPY(IObuff + len, ptr, tmp_ptr - ptr);
76 && !has_format_option(FO_WRAP))
82 if ((startcol = curwin->w_cursor.col) == 0)
86 *** ../vim-7.2.332/src/ex_getln.c 2009-12-02 17:15:04.000000000 +0100
87 --- src/ex_getln.c 2010-01-19 12:54:47.000000000 +0100
91 if (ga_grow(&line_ga, 40) == FAIL)
93 - pend = (char_u *)line_ga.ga_data + line_ga.ga_len;
95 /* Get one character at a time. Don't use inchar(), it can't handle
96 * special characters. */
100 WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE
103 ! /* longest match: make sure it is not shorter (happens with :help */
104 if (p2 != NULL && type == WILD_LONGEST)
106 for (j = 0; j < xp->xp_pattern_len; ++j)
108 WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE
111 ! /* longest match: make sure it is not shorter, happens with :help */
112 if (p2 != NULL && type == WILD_LONGEST)
114 for (j = 0; j < xp->xp_pattern_len; ++j)
115 *** ../vim-7.2.332/src/fileio.c 2009-12-31 14:52:48.000000000 +0100
116 --- src/fileio.c 2010-01-19 12:56:59.000000000 +0100
120 for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i)
123 # ifndef HAVE_MKDTEMP
129 for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i)
131 # ifndef HAVE_MKDTEMP
141 - itmplen = STRLEN(itmp);
144 /* Leave room for filename */
149 * otherwise it doesn't matter. The use of mkdir() avoids any
150 * security problems because of the predictable number. */
151 nr = (mch_get_pid() + (long)time(NULL)) % 1000000L;
152 + itmplen = STRLEN(itmp);
154 /* Try up to 10000 different values until we find a name that
156 *** ../vim-7.2.332/src/if_cscope.c 2009-07-09 21:22:36.000000000 +0200
157 --- src/if_cscope.c 2010-01-19 12:57:58.000000000 +0100
161 (void)strcpy(tbuf, matches[idx]);
163 ! if ((fname = strtok(tbuf, (const char *)"\t")) == NULL)
165 if ((fname = strtok(NULL, (const char *)"\t")) == NULL)
169 (void)strcpy(tbuf, matches[idx]);
171 ! if (strtok(tbuf, (const char *)"\t") == NULL)
173 if ((fname = strtok(NULL, (const char *)"\t")) == NULL)
175 *** ../vim-7.2.332/src/netbeans.c 2009-09-11 14:19:41.000000000 +0200
176 --- src/netbeans.c 2010-01-19 13:57:11.000000000 +0100
182 ! * This happens because the ExtEd can send a cammand or 2 after
183 * doing a stopDocumentListen command. It doesn't harm anything
184 * so I'm disabling it except for debugging.
190 ! * This happens because the ExtEd can send a command or 2 after
191 * doing a stopDocumentListen command. It doesn't harm anything
192 * so I'm disabling it except for debugging.
216 ! * Send netbeans an unmodufied command.
219 netbeans_unmodified(buf_T *bufp UNUSED)
224 ! * Send netbeans an unmodified command.
227 netbeans_unmodified(buf_T *bufp UNUSED)
233 ! * Add a sign of the reqested type at the requested location.
235 * Reverse engineering:
236 * Apparently an annotation is defined the first time it is used in a buffer.
241 ! * Add a sign of the requested type at the requested location.
243 * Reverse engineering:
244 * Apparently an annotation is defined the first time it is used in a buffer.
245 *** ../vim-7.2.332/src/ops.c 2009-11-25 12:38:49.000000000 +0100
246 --- src/ops.c 2010-01-19 13:04:46.000000000 +0100
252 - char_u *conv_str = str;
255 vc.vc_type = CONV_NONE;
256 if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK)
260 conv_str = string_convert(&vc, str, &intlen);
268 vc.vc_type = CONV_NONE;
269 if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK)
274 conv_str = string_convert(&vc, str, &intlen);
276 *** ../vim-7.2.332/src/quickfix.c 2009-06-24 17:31:27.000000000 +0200
277 --- src/quickfix.c 2010-01-19 13:12:29.000000000 +0100
283 - int need_return = TRUE;
284 char_u *arg = eap->arg;
285 int all = eap->forceit; /* if not :cl!, only show
291 if ((qfp->qf_valid || all) && idx1 <= i && i <= idx2)
298 ! need_return = FALSE;
302 if (qfp->qf_fnum != 0
305 if ((qfp->qf_valid || all) && idx1 <= i && i <= idx2)
312 if (qfp->qf_fnum != 0
316 msg_prt_line(IObuff, FALSE);
317 out_flush(); /* show one line at a time */
318 - need_return = TRUE;
323 *** ../vim-7.2.332/src/syntax.c 2009-12-16 18:13:04.000000000 +0100
324 --- src/syntax.c 2010-01-19 13:12:56.000000000 +0100
327 if (!HASHITEM_EMPTY(hi))
331 for (kp = HI2KE(hi); kp != NULL; kp = kp_next)
333 kp_next = kp->ke_next;
335 *** ../vim-7.2.332/src/ui.c 2009-09-11 16:48:06.000000000 +0200
336 --- src/ui.c 2010-01-19 13:14:04.000000000 +0100
342 ! char_u *conv_buf = buffer;
345 vc.vc_type = CONV_NONE;
353 vc.vc_type = CONV_NONE;
354 *** ../vim-7.2.332/src/version.c 2010-01-19 13:06:42.000000000 +0100
355 --- src/version.c 2010-01-19 14:55:50.000000000 +0100
359 { /* Add new patch number below this line */
365 An actual excerpt from a classified section of a city newspaper:
366 "Illiterate? Write today for free help!"
368 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
369 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
370 \\\ download, build and distribute -- http://www.A-A-P.org ///
371 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///