To: vim_dev@googlegroups.com Subject: Patch 7.4.2239 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.2239 Problem: Warning for missing declaration of skip_vimgrep_pat(). (John Marriott) Solution: Move it to another file. Files: src/quickfix.c, src/proto/quickfix.pro, src/ex_cmds.c, src/proto/ex_cmds.pro *** ../vim-7.4.2238/src/quickfix.c 2016-08-21 14:59:59.916038353 +0200 --- src/quickfix.c 2016-08-21 22:36:03.297406882 +0200 *************** *** 5155,5211 **** } #endif /* FEAT_QUICKFIX */ - - #if defined(FEAT_QUICKFIX) || defined(FEAT_EVAL) || defined(PROTO) - /* - * Skip over the pattern argument of ":vimgrep /pat/[g][j]". - * Put the start of the pattern in "*s", unless "s" is NULL. - * If "flags" is not NULL put the flags in it: VGR_GLOBAL, VGR_NOJUMP. - * If "s" is not NULL terminate the pattern with a NUL. - * Return a pointer to the char just past the pattern plus flags. - */ - char_u * - skip_vimgrep_pat(char_u *p, char_u **s, int *flags) - { - int c; - - if (vim_isIDc(*p)) - { - /* ":vimgrep pattern fname" */ - if (s != NULL) - *s = p; - p = skiptowhite(p); - if (s != NULL && *p != NUL) - *p++ = NUL; - } - else - { - /* ":vimgrep /pattern/[g][j] fname" */ - if (s != NULL) - *s = p + 1; - c = *p; - p = skip_regexp(p + 1, c, TRUE, NULL); - if (*p != c) - return NULL; - - /* Truncate the pattern. */ - if (s != NULL) - *p = NUL; - ++p; - - /* Find the flags */ - while (*p == 'g' || *p == 'j') - { - if (flags != NULL) - { - if (*p == 'g') - *flags |= VGR_GLOBAL; - else - *flags |= VGR_NOJUMP; - } - ++p; - } - } - return p; - } - #endif --- 5155,5157 ---- *** ../vim-7.4.2238/src/proto/quickfix.pro 2016-08-12 16:29:03.347068413 +0200 --- src/proto/quickfix.pro 2016-08-21 22:37:11.020807050 +0200 *************** *** 26,34 **** void ex_cnext(exarg_T *eap); void ex_cfile(exarg_T *eap); void ex_vimgrep(exarg_T *eap); - char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags); - int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict); int get_errorlist(win_T *wp, int qf_idx, list_T *list); int set_errorlist(win_T *wp, list_T *list, int action, char_u *title, dict_T *what); void ex_cbuffer(exarg_T *eap); void ex_cexpr(exarg_T *eap); --- 26,33 ---- void ex_cnext(exarg_T *eap); void ex_cfile(exarg_T *eap); void ex_vimgrep(exarg_T *eap); int get_errorlist(win_T *wp, int qf_idx, list_T *list); + int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict); int set_errorlist(win_T *wp, list_T *list, int action, char_u *title, dict_T *what); void ex_cbuffer(exarg_T *eap); void ex_cexpr(exarg_T *eap); *** ../vim-7.4.2238/src/ex_cmds.c 2016-08-20 18:36:48.308969048 +0200 --- src/ex_cmds.c 2016-08-21 22:36:12.533325082 +0200 *************** *** 8392,8397 **** --- 8392,8451 ---- } #endif + #if defined(FEAT_QUICKFIX) || defined(FEAT_EVAL) || defined(PROTO) + /* + * Skip over the pattern argument of ":vimgrep /pat/[g][j]". + * Put the start of the pattern in "*s", unless "s" is NULL. + * If "flags" is not NULL put the flags in it: VGR_GLOBAL, VGR_NOJUMP. + * If "s" is not NULL terminate the pattern with a NUL. + * Return a pointer to the char just past the pattern plus flags. + */ + char_u * + skip_vimgrep_pat(char_u *p, char_u **s, int *flags) + { + int c; + + if (vim_isIDc(*p)) + { + /* ":vimgrep pattern fname" */ + if (s != NULL) + *s = p; + p = skiptowhite(p); + if (s != NULL && *p != NUL) + *p++ = NUL; + } + else + { + /* ":vimgrep /pattern/[g][j] fname" */ + if (s != NULL) + *s = p + 1; + c = *p; + p = skip_regexp(p + 1, c, TRUE, NULL); + if (*p != c) + return NULL; + + /* Truncate the pattern. */ + if (s != NULL) + *p = NUL; + ++p; + + /* Find the flags */ + while (*p == 'g' || *p == 'j') + { + if (flags != NULL) + { + if (*p == 'g') + *flags |= VGR_GLOBAL; + else + *flags |= VGR_NOJUMP; + } + ++p; + } + } + return p; + } + #endif + #if defined(FEAT_EVAL) || defined(PROTO) /* * List v:oldfiles in a nice way. *** ../vim-7.4.2238/src/proto/ex_cmds.pro 2016-08-20 18:36:48.308969048 +0200 --- src/proto/ex_cmds.pro 2016-08-21 22:37:14.760773923 +0200 *************** *** 65,69 **** --- 65,70 ---- void set_context_in_sign_cmd(expand_T *xp, char_u *arg); void ex_smile(exarg_T *eap); void ex_drop(exarg_T *eap); + char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags); void ex_oldfiles(exarg_T *eap); /* vim: set ft=c : */ *** ../vim-7.4.2238/src/version.c 2016-08-21 21:03:33.255131103 +0200 --- src/version.c 2016-08-21 22:37:06.412847864 +0200 *************** *** 765,766 **** --- 765,768 ---- { /* Add new patch number below this line */ + /**/ + 2239, /**/ -- hundred-and-one symptoms of being an internet addict: 46. Your wife makes a new rule: "The computer cannot come to bed." /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///