]> granicus.if.org Git - vim/commitdiff
patch 8.0.0776: function prototypes missing without the quickfix feature v8.0.0776
authorBram Moolenaar <Bram@vim.org>
Tue, 25 Jul 2017 21:31:12 +0000 (23:31 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 25 Jul 2017 21:31:12 +0000 (23:31 +0200)
Problem:    Function prototypes missing without the quickfix feature. (Tony
            Mechelynck)
Solution:   Move non-quickfix functions to buffer.c.

src/buffer.c
src/proto/buffer.pro
src/proto/quickfix.pro
src/quickfix.c
src/version.c

index fb133173644109927892352ae3c342a5677083a4..4dbb9e91b51b35bc7eb171aed2170944fc5b7e86 100644 (file)
@@ -5650,6 +5650,73 @@ write_viminfo_bufferlist(FILE *fp)
 }
 #endif
 
+/*
+ * Return TRUE if "buf" is the quickfix buffer.
+ */
+    int
+bt_quickfix(buf_T *buf)
+{
+    return buf != NULL && buf->b_p_bt[0] == 'q';
+}
+
+/*
+ * Return TRUE if "buf" is a terminal buffer.
+ */
+    int
+bt_terminal(buf_T *buf)
+{
+    return buf != NULL && buf->b_p_bt[0] == 't';
+}
+
+/*
+ * Return TRUE if "buf" is a "nofile", "acwrite" or "terminal" buffer.
+ * This means the buffer name is not a file name.
+ */
+    int
+bt_nofile(buf_T *buf)
+{
+    return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
+           || buf->b_p_bt[0] == 'a'
+           || buf->b_p_bt[0] == 't');
+}
+
+/*
+ * Return TRUE if "buf" is a "nowrite", "nofile" or "terminal" buffer.
+ */
+    int
+bt_dontwrite(buf_T *buf)
+{
+    return buf != NULL && (buf->b_p_bt[0] == 'n' || buf->b_p_bt[0] == 't');
+}
+
+    int
+bt_dontwrite_msg(buf_T *buf)
+{
+    if (bt_dontwrite(buf))
+    {
+       EMSG(_("E382: Cannot write, 'buftype' option is set"));
+       return TRUE;
+    }
+    return FALSE;
+}
+
+/*
+ * Return TRUE if the buffer should be hidden, according to 'hidden', ":hide"
+ * and 'bufhidden'.
+ */
+    int
+buf_hide(buf_T *buf)
+{
+    /* 'bufhidden' overrules 'hidden' and ":hide", check it first */
+    switch (buf->b_p_bh[0])
+    {
+       case 'u':                   /* "unload" */
+       case 'w':                   /* "wipe" */
+       case 'd': return FALSE;     /* "delete" */
+       case 'h': return TRUE;      /* "hide" */
+    }
+    return (p_hid || cmdmod.hide);
+}
 
 /*
  * Return special buffer name.
index 183f79a408c925ad5d0de138bca099b3a5b8ea9b..e9a37dec86ccc58433600297a91a7dfb419efc97 100644 (file)
@@ -53,6 +53,12 @@ void ex_buffer_all(exarg_T *eap);
 void do_modelines(int flags);
 int read_viminfo_bufferlist(vir_T *virp, int writing);
 void write_viminfo_bufferlist(FILE *fp);
+int bt_quickfix(buf_T *buf);
+int bt_terminal(buf_T *buf);
+int bt_nofile(buf_T *buf);
+int bt_dontwrite(buf_T *buf);
+int bt_dontwrite_msg(buf_T *buf);
+int buf_hide(buf_T *buf);
 char_u *buf_spname(buf_T *buf);
 int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp);
 void buf_addsign(buf_T *buf, int id, linenr_T lnum, int typenr);
index a1a634eec234e17d04296eed88fe6d64752e50e1..4418cc47b89645b8336897f7b1c5adc05e3d6551 100644 (file)
@@ -28,10 +28,4 @@ int set_ref_in_quickfix(int copyID);
 void ex_cbuffer(exarg_T *eap);
 void ex_cexpr(exarg_T *eap);
 void ex_helpgrep(exarg_T *eap);
-int bt_quickfix(buf_T *buf);
-int bt_terminal(buf_T *buf);
-int bt_nofile(buf_T *buf);
-int bt_dontwrite(buf_T *buf);
-int bt_dontwrite_msg(buf_T *buf);
-int buf_hide(buf_T *buf);
 /* vim: set ft=c : */
index 1d63237a495931c675156e7c5690227e67cc98cd..c34e34d1ce4dfce871d38da124039ffd16d825c5 100644 (file)
@@ -5526,72 +5526,3 @@ ex_helpgrep(exarg_T *eap)
 }
 
 #endif /* FEAT_QUICKFIX */
-
-/*
- * Return TRUE if "buf" is the quickfix buffer.
- */
-    int
-bt_quickfix(buf_T *buf)
-{
-    return buf != NULL && buf->b_p_bt[0] == 'q';
-}
-
-/*
- * Return TRUE if "buf" is a terminal buffer.
- */
-    int
-bt_terminal(buf_T *buf)
-{
-    return buf != NULL && buf->b_p_bt[0] == 't';
-}
-
-/*
- * Return TRUE if "buf" is a "nofile", "acwrite" or "terminal" buffer.
- * This means the buffer name is not a file name.
- */
-    int
-bt_nofile(buf_T *buf)
-{
-    return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
-           || buf->b_p_bt[0] == 'a'
-           || buf->b_p_bt[0] == 't');
-}
-
-/*
- * Return TRUE if "buf" is a "nowrite", "nofile" or "terminal" buffer.
- */
-    int
-bt_dontwrite(buf_T *buf)
-{
-    return buf != NULL && (buf->b_p_bt[0] == 'n' || buf->b_p_bt[0] == 't');
-}
-
-    int
-bt_dontwrite_msg(buf_T *buf)
-{
-    if (bt_dontwrite(buf))
-    {
-       EMSG(_("E382: Cannot write, 'buftype' option is set"));
-       return TRUE;
-    }
-    return FALSE;
-}
-
-/*
- * Return TRUE if the buffer should be hidden, according to 'hidden', ":hide"
- * and 'bufhidden'.
- */
-    int
-buf_hide(buf_T *buf)
-{
-    /* 'bufhidden' overrules 'hidden' and ":hide", check it first */
-    switch (buf->b_p_bh[0])
-    {
-       case 'u':                   /* "unload" */
-       case 'w':                   /* "wipe" */
-       case 'd': return FALSE;     /* "delete" */
-       case 'h': return TRUE;      /* "hide" */
-    }
-    return (p_hid || cmdmod.hide);
-}
-
index c48806a28c79af9a0f9983a59c1325f36d073969..530663ec0595818f36a0942fe7037e55c7be4cbf 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    776,
 /**/
     775,
 /**/