]> granicus.if.org Git - vim/commitdiff
patch 8.1.2021: some global functions can be local to the file v8.1.2021
authorBram Moolenaar <Bram@vim.org>
Tue, 10 Sep 2019 19:27:18 +0000 (21:27 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 10 Sep 2019 19:27:18 +0000 (21:27 +0200)
Problem:    Some global functions can be local to the file.
Solution:   Add "static". (Yegappan Lakshmanan, closes #4917)

18 files changed:
src/ex_cmds2.c
src/filepath.c
src/hangulin.c
src/mbyte.c
src/misc1.c
src/os_unix.c
src/proto/ex_cmds2.pro
src/proto/filepath.pro
src/proto/hangulin.pro
src/proto/mbyte.pro
src/proto/misc1.pro
src/proto/os_unix.pro
src/proto/terminal.pro
src/proto/undo.pro
src/pty.c
src/terminal.c
src/undo.c
src/version.c

index 6eafd47e298a40ddd2952c3184b309351a49ede8..81f2c8f5b99dac8ac19955e48ad2c8dfbf27fd49 100644 (file)
@@ -260,7 +260,7 @@ check_due_timer(void)
 /*
  * Find a timer by ID.  Returns NULL if not found;
  */
-    timer_T *
+    static timer_T *
 find_timer(long id)
 {
     timer_T *timer;
@@ -291,7 +291,7 @@ stop_timer(timer_T *timer)
     }
 }
 
-    void
+    static void
 stop_all_timers(void)
 {
     timer_T *timer;
@@ -304,7 +304,7 @@ stop_all_timers(void)
     }
 }
 
-    void
+    static void
 add_timer_info(typval_T *rettv, timer_T *timer)
 {
     list_T     *list = rettv->vval.v_list;
@@ -338,7 +338,7 @@ add_timer_info(typval_T *rettv, timer_T *timer)
     }
 }
 
-    void
+    static void
 add_timer_info_all(typval_T *rettv)
 {
     timer_T *timer;
index 811682e3755e4418e53cb35c44d68b2b7f650263..5ffb8c9b4ab3d4648ba3fe1d7c42330281f52558 100644 (file)
@@ -793,7 +793,7 @@ f_filewritable(typval_T *argvars, typval_T *rettv)
     rettv->vval.v_number = filewritable(tv_get_string(&argvars[0]));
 }
 
-    void
+    static void
 findfilendir(
     typval_T   *argvars UNUSED,
     typval_T   *rettv,
index 17142dadf6b0c92c00c1b4246d0af00f991d29f6..75e7f6a0cec339c3ffc49459aad7470e8f912cce 100644 (file)
@@ -809,7 +809,7 @@ hangul_input_process(char_u *s, int len)
     return len;
 }
 
-    void
+    static void
 hangul_input_clear(void)
 {
     sp = 0;
index ff23ab6afa01d2f7b97e4fcee3dc36333d6ef8b2..c214f3787b9862866858670ac00738a32d9e076e 100644 (file)
@@ -144,6 +144,7 @@ static int utf_ptr2cells_len(char_u *p, int size);
 static int dbcs_char2cells(int c);
 static int dbcs_ptr2cells_len(char_u *p, int size);
 static int dbcs_ptr2char(char_u *p);
+static int dbcs_head_off(char_u *base, char_u *p);
 
 /*
  * Lookup table to quickly get the length in bytes of a UTF-8 character from
@@ -3778,7 +3779,7 @@ latin_head_off(char_u *base UNUSED, char_u *p UNUSED)
     return 0;
 }
 
-    int
+    static int
 dbcs_head_off(char_u *base, char_u *p)
 {
     char_u     *q;
index 45dcc327b7a7727b7f5fe6a04de2f29f07b04cad..ca5afef00b15ae3bee8067521e8236b6ced6f599 100644 (file)
@@ -2761,7 +2761,7 @@ done:
 
 # if defined(FEAT_EVAL) || defined(PROTO)
 
-    void
+    static void
 get_cmd_output_as_rettv(
     typval_T   *argvars,
     typval_T   *rettv,
index 5efb5d1358fadeb7cd5e6d4884e883d6fe072951..2851459e41d79c6c4fa91f416e137d019536c24f 100644 (file)
@@ -4276,7 +4276,7 @@ open_pty(int *pty_master_fd, int *pty_slave_fd, char_u **name1, char_u **name2)
 /*
  * Send SIGINT to a child process if "c" is an interrupt character.
  */
-    void
+    static void
 may_send_sigint(int c UNUSED, pid_t pid UNUSED, pid_t wpid UNUSED)
 {
 # ifdef SIGINT
index 2ecda169f552f5ef7fe4bc4c599f6b4b6bf01f2b..9f694da93be4f3f6e255f5a285c36b14d691a732 100644 (file)
@@ -2,11 +2,7 @@
 long proftime_time_left(proftime_T *due, proftime_T *now);
 timer_T *create_timer(long msec, int repeat);
 long check_due_timer(void);
-timer_T *find_timer(long id);
 void stop_timer(timer_T *timer);
-void stop_all_timers(void);
-void add_timer_info(typval_T *rettv, timer_T *timer);
-void add_timer_info_all(typval_T *rettv);
 int set_ref_in_timer(int copyID);
 void timer_free_all(void);
 void f_timer_info(typval_T *argvars, typval_T *rettv);
index 405c8b5f650acd3c519149430ec52f1d45b0fce5..bfb3ffb1024082e003a31f4cab5ac6ac4cc785ac 100644 (file)
@@ -6,7 +6,6 @@ void f_executable(typval_T *argvars, typval_T *rettv);
 void f_exepath(typval_T *argvars, typval_T *rettv);
 void f_filereadable(typval_T *argvars, typval_T *rettv);
 void f_filewritable(typval_T *argvars, typval_T *rettv);
-void findfilendir(typval_T *argvars, typval_T *rettv, int find_what);
 void f_finddir(typval_T *argvars, typval_T *rettv);
 void f_findfile(typval_T *argvars, typval_T *rettv);
 void f_fnamemodify(typval_T *argvars, typval_T *rettv);
index 3aef39df4af806cb3725b88c2dc632c5049d6917..6509ba8d406022f6fb763230ce2ff4da6a87a9be 100644 (file)
@@ -5,7 +5,6 @@ int im_get_status(void);
 void hangul_input_state_toggle(void);
 void hangul_keyboard_set(void);
 int hangul_input_process(char_u *s, int len);
-void hangul_input_clear(void);
 char_u *hangul_string_convert(char_u *buf, int *p_len);
 char_u *hangul_composing_buffer_get(int *p_len);
 /* vim: set ft=c : */
index 86b525c4685277c79f50e51d96aae19e26ef0618..cbfa90961c73d2040ae68399a8fb3f712f24096a 100644 (file)
@@ -50,7 +50,6 @@ int utf_isupper(int a);
 int mb_strnicmp(char_u *s1, char_u *s2, size_t nn);
 void show_utf8(void);
 int latin_head_off(char_u *base, char_u *p);
-int dbcs_head_off(char_u *base, char_u *p);
 int dbcs_screen_head_off(char_u *base, char_u *p);
 int utf_head_off(char_u *base, char_u *p);
 void mb_copy_char(char_u **fp, char_u **tp);
index f0c37838b62080c51ddaf8cdc98a0fae34f76f10..08eb853752f3db192da110d000b3d46fb808aea9 100644 (file)
@@ -48,7 +48,6 @@ void preserve_exit(void);
 void line_breakcheck(void);
 void fast_breakcheck(void);
 char_u *get_cmd_output(char_u *cmd, char_u *infile, int flags, int *ret_len);
-void get_cmd_output_as_rettv(typval_T *argvars, typval_T *rettv, int retlist);
 void f_system(typval_T *argvars, typval_T *rettv);
 void f_systemlist(typval_T *argvars, typval_T *rettv);
 int goto_im(void);
index 449b3e96f5df986fd0c4e32ee7ecfe087312eb15..86e12a0f69fbaefe445442284d0dd4fa040c9bde 100644 (file)
@@ -59,7 +59,6 @@ int mch_get_shellsize(void);
 int mch_report_winsize(int fd, int rows, int cols);
 void mch_set_shellsize(void);
 void mch_new_shellsize(void);
-void may_send_sigint(int c, pid_t pid, pid_t wpid);
 int mch_call_shell(char_u *cmd, int options);
 void mch_job_start(char **argv, job_T *job, jobopt_T *options, int is_terminal);
 char *mch_job_status(job_T *job);
index 996db6ddac6df57925d6e7153eb79559ed8b5c8c..0527aa88c9966e1258d3255609ec10dcf122bf4e 100644 (file)
@@ -56,7 +56,6 @@ void f_term_start(typval_T *argvars, typval_T *rettv);
 void f_term_wait(typval_T *argvars, typval_T *rettv);
 void term_send_eof(channel_T *ch);
 job_T *term_getjob(term_T *term);
-void term_free_conpty(term_T *term);
 int use_conpty(void);
 int terminal_enabled(void);
 /* vim: set ft=c : */
index 93b99096a763c6d964445414653191f2ade4b5cb..97dbef37cd0d481059b93e74251288678d6f850b 100644 (file)
@@ -7,7 +7,6 @@ int u_savedel(linenr_T lnum, long nlines);
 int undo_allowed(void);
 int u_savecommon(linenr_T top, linenr_T bot, linenr_T newbot, int reload);
 void u_compute_hash(char_u *hash);
-char_u *u_get_undo_file_name(char_u *buf_ffname, int reading);
 void u_write_undo(char_u *name, int forceit, buf_T *buf, char_u *hash);
 void u_read_undo(char_u *name, char_u *hash, char_u *orig_name);
 void u_undo(int count);
@@ -27,7 +26,6 @@ int bufIsChanged(buf_T *buf);
 int anyBufIsChanged(void);
 int bufIsChangedNotTerm(buf_T *buf);
 int curbufIsChanged(void);
-void u_eval_tree(u_header_T *first_uhp, list_T *list);
 void f_undofile(typval_T *argvars, typval_T *rettv);
 void f_undotree(typval_T *argvars, typval_T *rettv);
 /* vim: set ft=c : */
index 7a9e693b6dcc2b99eef6b30786ef29a0855bdda5..a2162e210866048286aff999fe312fac9d44c01b 100644 (file)
--- a/src/pty.c
+++ b/src/pty.c
@@ -347,7 +347,7 @@ mch_openpty(char **ttyn)
 #define PTY_DONE
 
 #ifdef _IBMR2
-int aixhack = -1;
+static int aixhack = -1;
 #endif
 
     int
index 6d9fb2431744db5b8e136a46b0ef8f47021719f9..3d66bbb9b66320568a24ad4d10f89feadadce400 100644 (file)
@@ -875,7 +875,7 @@ free_scrollback(term_T *term)
 
 
 // Terminals that need to be freed soon.
-term_T *terminals_to_free = NULL;
+static term_T  *terminals_to_free = NULL;
 
 /*
  * Free a terminal and everything it refers to.
@@ -6024,7 +6024,7 @@ conpty_term_report_winsize(term_T *term, int rows, int cols)
     pResizePseudoConsole(term->tl_conpty, consize);
 }
 
-    void
+    static void
 term_free_conpty(term_T *term)
 {
     if (term->tl_siex.lpAttributeList != NULL)
index 8145af0f7a51f3814256ebf6243887b980118e3e..732efab9fd47f6c234a8b16e0dcd66a0187bdba4 100644 (file)
@@ -775,7 +775,7 @@ u_compute_hash(char_u *hash)
  * When "reading" is FALSE use the first name where the directory exists.
  * Returns NULL when there is no place to write or no file to read.
  */
-    char_u *
+    static char_u *
 u_get_undo_file_name(char_u *buf_ffname, int reading)
 {
     char_u     *dirp;
@@ -3590,7 +3590,7 @@ curbufIsChanged(void)
  * For undotree(): Append the list of undo blocks at "first_uhp" to "list".
  * Recursive.
  */
-    void
+    static void
 u_eval_tree(u_header_T *first_uhp, list_T *list)
 {
     u_header_T  *uhp = first_uhp;
index 44b6a5183fcc6bf7e0f03b54c56413bbbdced7a7..7ac39204b67d510889cc4b86b2fab9cd45fe0690 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2021,
 /**/
     2020,
 /**/