Skip to content

Commit f0a521f

Browse files
committed
patch 8.0.0776: function prototypes missing without the quickfix feature
Problem: Function prototypes missing without the quickfix feature. (Tony Mechelynck) Solution: Move non-quickfix functions to buffer.c.
1 parent fc716d7 commit f0a521f

5 files changed

Lines changed: 75 additions & 75 deletions

File tree

src/buffer.c

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5650,6 +5650,73 @@ write_viminfo_bufferlist(FILE *fp)
56505650
}
56515651
#endif
56525652

5653+
/*
5654+
* Return TRUE if "buf" is the quickfix buffer.
5655+
*/
5656+
int
5657+
bt_quickfix(buf_T *buf)
5658+
{
5659+
return buf != NULL && buf->b_p_bt[0] == 'q';
5660+
}
5661+
5662+
/*
5663+
* Return TRUE if "buf" is a terminal buffer.
5664+
*/
5665+
int
5666+
bt_terminal(buf_T *buf)
5667+
{
5668+
return buf != NULL && buf->b_p_bt[0] == 't';
5669+
}
5670+
5671+
/*
5672+
* Return TRUE if "buf" is a "nofile", "acwrite" or "terminal" buffer.
5673+
* This means the buffer name is not a file name.
5674+
*/
5675+
int
5676+
bt_nofile(buf_T *buf)
5677+
{
5678+
return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
5679+
|| buf->b_p_bt[0] == 'a'
5680+
|| buf->b_p_bt[0] == 't');
5681+
}
5682+
5683+
/*
5684+
* Return TRUE if "buf" is a "nowrite", "nofile" or "terminal" buffer.
5685+
*/
5686+
int
5687+
bt_dontwrite(buf_T *buf)
5688+
{
5689+
return buf != NULL && (buf->b_p_bt[0] == 'n' || buf->b_p_bt[0] == 't');
5690+
}
5691+
5692+
int
5693+
bt_dontwrite_msg(buf_T *buf)
5694+
{
5695+
if (bt_dontwrite(buf))
5696+
{
5697+
EMSG(_("E382: Cannot write, 'buftype' option is set"));
5698+
return TRUE;
5699+
}
5700+
return FALSE;
5701+
}
5702+
5703+
/*
5704+
* Return TRUE if the buffer should be hidden, according to 'hidden', ":hide"
5705+
* and 'bufhidden'.
5706+
*/
5707+
int
5708+
buf_hide(buf_T *buf)
5709+
{
5710+
/* 'bufhidden' overrules 'hidden' and ":hide", check it first */
5711+
switch (buf->b_p_bh[0])
5712+
{
5713+
case 'u': /* "unload" */
5714+
case 'w': /* "wipe" */
5715+
case 'd': return FALSE; /* "delete" */
5716+
case 'h': return TRUE; /* "hide" */
5717+
}
5718+
return (p_hid || cmdmod.hide);
5719+
}
56535720

56545721
/*
56555722
* Return special buffer name.

src/proto/buffer.pro

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ void ex_buffer_all(exarg_T *eap);
5353
void do_modelines(int flags);
5454
int read_viminfo_bufferlist(vir_T *virp, int writing);
5555
void write_viminfo_bufferlist(FILE *fp);
56+
int bt_quickfix(buf_T *buf);
57+
int bt_terminal(buf_T *buf);
58+
int bt_nofile(buf_T *buf);
59+
int bt_dontwrite(buf_T *buf);
60+
int bt_dontwrite_msg(buf_T *buf);
61+
int buf_hide(buf_T *buf);
5662
char_u *buf_spname(buf_T *buf);
5763
int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp);
5864
void buf_addsign(buf_T *buf, int id, linenr_T lnum, int typenr);

src/proto/quickfix.pro

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,4 @@ int set_ref_in_quickfix(int copyID);
2828
void ex_cbuffer(exarg_T *eap);
2929
void ex_cexpr(exarg_T *eap);
3030
void ex_helpgrep(exarg_T *eap);
31-
int bt_quickfix(buf_T *buf);
32-
int bt_terminal(buf_T *buf);
33-
int bt_nofile(buf_T *buf);
34-
int bt_dontwrite(buf_T *buf);
35-
int bt_dontwrite_msg(buf_T *buf);
36-
int buf_hide(buf_T *buf);
3731
/* vim: set ft=c : */

src/quickfix.c

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -5526,72 +5526,3 @@ ex_helpgrep(exarg_T *eap)
55265526
}
55275527

55285528
#endif /* FEAT_QUICKFIX */
5529-
5530-
/*
5531-
* Return TRUE if "buf" is the quickfix buffer.
5532-
*/
5533-
int
5534-
bt_quickfix(buf_T *buf)
5535-
{
5536-
return buf != NULL && buf->b_p_bt[0] == 'q';
5537-
}
5538-
5539-
/*
5540-
* Return TRUE if "buf" is a terminal buffer.
5541-
*/
5542-
int
5543-
bt_terminal(buf_T *buf)
5544-
{
5545-
return buf != NULL && buf->b_p_bt[0] == 't';
5546-
}
5547-
5548-
/*
5549-
* Return TRUE if "buf" is a "nofile", "acwrite" or "terminal" buffer.
5550-
* This means the buffer name is not a file name.
5551-
*/
5552-
int
5553-
bt_nofile(buf_T *buf)
5554-
{
5555-
return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
5556-
|| buf->b_p_bt[0] == 'a'
5557-
|| buf->b_p_bt[0] == 't');
5558-
}
5559-
5560-
/*
5561-
* Return TRUE if "buf" is a "nowrite", "nofile" or "terminal" buffer.
5562-
*/
5563-
int
5564-
bt_dontwrite(buf_T *buf)
5565-
{
5566-
return buf != NULL && (buf->b_p_bt[0] == 'n' || buf->b_p_bt[0] == 't');
5567-
}
5568-
5569-
int
5570-
bt_dontwrite_msg(buf_T *buf)
5571-
{
5572-
if (bt_dontwrite(buf))
5573-
{
5574-
EMSG(_("E382: Cannot write, 'buftype' option is set"));
5575-
return TRUE;
5576-
}
5577-
return FALSE;
5578-
}
5579-
5580-
/*
5581-
* Return TRUE if the buffer should be hidden, according to 'hidden', ":hide"
5582-
* and 'bufhidden'.
5583-
*/
5584-
int
5585-
buf_hide(buf_T *buf)
5586-
{
5587-
/* 'bufhidden' overrules 'hidden' and ":hide", check it first */
5588-
switch (buf->b_p_bh[0])
5589-
{
5590-
case 'u': /* "unload" */
5591-
case 'w': /* "wipe" */
5592-
case 'd': return FALSE; /* "delete" */
5593-
case 'h': return TRUE; /* "hide" */
5594-
}
5595-
return (p_hid || cmdmod.hide);
5596-
}
5597-

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
776,
772774
/**/
773775
775,
774776
/**/

0 commit comments

Comments
 (0)