Skip to content

Commit 8ee52af

Browse files
yegappanbrammool
authored andcommitted
patch 8.2.3320: some local functions are not static
Problem: Some local functions are not static. Solution: Add "static". Move snprintf() related code to strings.c. (Yegappan Lakshmanan, closes #8734)
1 parent eed9616 commit 8ee52af

31 files changed

Lines changed: 1303 additions & 1327 deletions

src/alloc.c

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,15 @@ lalloc(size_t size, int message)
232232
mem_pre_alloc_l(&size);
233233
#endif
234234

235-
/*
236-
* Loop when out of memory: Try to release some memfile blocks and
237-
* if some blocks are released call malloc again.
238-
*/
235+
// Loop when out of memory: Try to release some memfile blocks and
236+
// if some blocks are released call malloc again.
239237
for (;;)
240238
{
241-
/*
242-
* Handle three kind of systems:
243-
* 1. No check for available memory: Just return.
244-
* 2. Slow check for available memory: call mch_avail_mem() after
245-
* allocating KEEP_ROOM amount of memory.
246-
* 3. Strict check for available memory: call mch_avail_mem()
247-
*/
239+
// Handle three kind of systems:
240+
// 1. No check for available memory: Just return.
241+
// 2. Slow check for available memory: call mch_avail_mem() after
242+
// allocating KEEP_ROOM amount of memory.
243+
// 3. Strict check for available memory: call mch_avail_mem()
248244
if ((p = malloc(size)) != NULL)
249245
{
250246
#ifndef HAVE_AVAIL_MEM
@@ -268,10 +264,8 @@ lalloc(size_t size, int message)
268264
goto theend;
269265
#endif
270266
}
271-
/*
272-
* Remember that mf_release_all() is being called to avoid an endless
273-
* loop, because mf_release_all() may call alloc() recursively.
274-
*/
267+
// Remember that mf_release_all() is being called to avoid an endless
268+
// loop, because mf_release_all() may call alloc() recursively.
275269
if (releasing)
276270
break;
277271
releasing = TRUE;

src/channel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3025,7 +3025,7 @@ channel_has_readahead(channel_T *channel, ch_part_T part)
30253025
* Return a string indicating the status of the channel.
30263026
* If "req_part" is not negative check that part.
30273027
*/
3028-
char *
3028+
static char *
30293029
channel_status(channel_T *channel, int req_part)
30303030
{
30313031
ch_part_T part;

src/dict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ dict2string(typval_T *tv, int copyID, int restore_copyID)
805805
* Advance over a literal key, including "-". If the first character is not a
806806
* literal key character then "key" is returned.
807807
*/
808-
char_u *
808+
static char_u *
809809
skip_literal_key(char_u *key)
810810
{
811811
char_u *p;

src/digraph.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,7 +2029,7 @@ registerdigraph(int char1, int char2, int n)
20292029
* If they are valid, returns TRUE; otherwise, give an error message and
20302030
* returns FALSE.
20312031
*/
2032-
int
2032+
static int
20332033
check_digraph_chars_valid(int char1, int char2)
20342034
{
20352035
if (char2 == 0)
@@ -2193,7 +2193,7 @@ digraph_getlist_appendpair(digr_T *dp, list_T *l)
21932193
li2->li_tv.vval.v_string = vim_strsave(buf);
21942194
}
21952195

2196-
void
2196+
static void
21972197
digraph_getlist_common(int list_all, typval_T *rettv)
21982198
{
21992199
int i;

src/edit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,7 @@ ins_ctrl_v(void)
15871587
* Note that this doesn't wait for characters, they must be in the typeahead
15881588
* buffer already.
15891589
*/
1590-
int
1590+
static int
15911591
decodeModifyOtherKeys(int c)
15921592
{
15931593
char_u *p = typebuf.tb_buf + typebuf.tb_off;

src/ex_docmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ do_cmdline_cmd(char_u *cmd)
598598
* Execute the "+cmd" argument of "edit +cmd fname" and the like.
599599
* This allows for using a range without ":" in Vim9 script.
600600
*/
601-
int
601+
static int
602602
do_cmd_argument(char_u *cmd)
603603
{
604604
return do_cmdline(cmd, NULL, NULL,

src/getchar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ stuffRedoReadbuff(char_u *s)
631631
add_buff(&readbuf2, s, -1L);
632632
}
633633

634-
void
634+
static void
635635
stuffReadbuffLen(char_u *s, long len)
636636
{
637637
add_buff(&readbuf1, s, len);

src/job.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ invoke_prompt_interrupt(void)
15821582
/*
15831583
* Return the effective prompt for the specified buffer.
15841584
*/
1585-
char_u *
1585+
static char_u *
15861586
buf_prompt_text(buf_T* buf)
15871587
{
15881588
if (buf->b_prompt_text == NULL)

src/list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ list_append_tv(list_T *l, typval_T *tv)
620620
* As list_append_tv() but move the value instead of copying it.
621621
* Return FAIL when out of memory.
622622
*/
623-
int
623+
static int
624624
list_append_tv_move(list_T *l, typval_T *tv)
625625
{
626626
listitem_T *li = listitem_alloc();

0 commit comments

Comments
 (0)