Mercurial > vim
annotate src/proto/misc1.pro @ 33817:4550abd680b6 v9.0.2124
patch 9.0.2124: INT overflow detection logic can be simplified
Commit: https://github.com/vim/vim/commit/2b0882fa6555b4d0197afbdfc32a4533cf6aacf4
Author: Ernie Rael <errael@raelity.com>
Date: Thu Nov 23 20:21:45 2023 +0100
patch 9.0.2124: INT overflow detection logic can be simplified
Problem: INT overflow logic can be simplified
Solution: introduce trim_to_int() function
closes: #13556
Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 23 Nov 2023 20:45:04 +0100 |
parents | 370543108ba1 |
children | 32bc4c71f8a6 |
rev | line source |
---|---|
7 | 1 /* misc1.c */ |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
2 int get_leader_len(char_u *line, char_u **flags, int backward, int include_space); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
3 int get_last_leader_offset(char_u *line, char_u **flags); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
4 int plines(linenr_T lnum); |
32832
0503955dcd34
patch 9.0.1729: screenpos() wrong when w_skipcol and cpoptions+=n
Christian Brabandt <cb@256bit.org>
parents:
31962
diff
changeset
|
5 int plines_win(win_T *wp, linenr_T lnum, int limit_winheight); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
6 int plines_nofill(linenr_T lnum); |
32832
0503955dcd34
patch 9.0.1729: screenpos() wrong when w_skipcol and cpoptions+=n
Christian Brabandt <cb@256bit.org>
parents:
31962
diff
changeset
|
7 int plines_win_nofill(win_T *wp, linenr_T lnum, int limit_winheight); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
8 int plines_win_nofold(win_T *wp, linenr_T lnum); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
9 int plines_win_col(win_T *wp, linenr_T lnum, long column); |
32832
0503955dcd34
patch 9.0.1729: screenpos() wrong when w_skipcol and cpoptions+=n
Christian Brabandt <cb@256bit.org>
parents:
31962
diff
changeset
|
10 int plines_m_win(win_T *wp, linenr_T first, linenr_T last, int limit_winheight); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
11 int gchar_pos(pos_T *pos); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
12 int gchar_cursor(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
13 void pchar_cursor(int c); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
14 char_u *skip_to_option_part(char_u *p); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
15 void check_status(buf_T *buf); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
16 int ask_yesno(char_u *str, int direct); |
28397
d1702731786c
patch 8.2.4723: the ModeChanged autocmd event is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26155
diff
changeset
|
17 void get_mode(char_u *buf); |
18104
e59ff7b5d7a7
patch 8.1.2047: cannot check the current state
Bram Moolenaar <Bram@vim.org>
parents:
18051
diff
changeset
|
18 void f_mode(typval_T *argvars, typval_T *rettv); |
e59ff7b5d7a7
patch 8.1.2047: cannot check the current state
Bram Moolenaar <Bram@vim.org>
parents:
18051
diff
changeset
|
19 void f_state(typval_T *argvars, typval_T *rettv); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
20 int get_keystroke(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
21 int get_number(int colon, int *mouse_used); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
22 int prompt_for_number(int *mouse_used); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
23 void msgmore(long n); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
24 void beep_flush(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
25 void vim_beep(unsigned val); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
26 void init_homedir(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
27 void free_homedir(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
28 void free_users(void); |
31962
4efcb5c68112
patch 9.0.1313: some settings use the current codepage instead of 'encoding'
Bram Moolenaar <Bram@vim.org>
parents:
28459
diff
changeset
|
29 void init_vimdir(void); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
30 char_u *expand_env_save(char_u *src); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
31 char_u *expand_env_save_opt(char_u *src, int one); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
32 void expand_env(char_u *src, char_u *dst, int dstlen); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
33 void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, int esc, int one, char_u *startstr); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
34 char_u *vim_getenv(char_u *name, int *mustfree); |
13963 | 35 void vim_unsetenv(char_u *var); |
28459
52ef65c0637f
patch 8.2.4754: using cached values after unsetting some environment variables
Bram Moolenaar <Bram@vim.org>
parents:
28397
diff
changeset
|
36 void vim_unsetenv_ext(char_u *var); |
19283
9dc843109c97
patch 8.2.0200: Vim9 script commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
37 void vim_setenv_ext(char_u *name, char_u *val); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
38 void vim_setenv(char_u *name, char_u *val); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
39 char_u *get_env_name(expand_T *xp, int idx); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
40 char_u *get_users(expand_T *xp, int idx); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
41 int match_user(char_u *name); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
42 void preserve_exit(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
43 void line_breakcheck(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
44 void fast_breakcheck(void); |
19728
41a1ea967a97
patch 8.2.0420: Vim9: cannot interrupt a loop with CTRL-C
Bram Moolenaar <Bram@vim.org>
parents:
19396
diff
changeset
|
45 void veryfast_breakcheck(void); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
46 char_u *get_cmd_output(char_u *cmd, char_u *infile, int flags, int *ret_len); |
17978
8f4cc259ed7a
patch 8.1.1985: code for dealing with paths is spread out
Bram Moolenaar <Bram@vim.org>
parents:
17789
diff
changeset
|
47 void f_system(typval_T *argvars, typval_T *rettv); |
8f4cc259ed7a
patch 8.1.1985: code for dealing with paths is spread out
Bram Moolenaar <Bram@vim.org>
parents:
17789
diff
changeset
|
48 void f_systemlist(typval_T *argvars, typval_T *rettv); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
49 int goto_im(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6949
diff
changeset
|
50 char_u *get_isolated_shell_name(void); |
15814
99ebf78686a9
patch 8.1.0914: code related to findfile() is spread out
Bram Moolenaar <Bram@vim.org>
parents:
15699
diff
changeset
|
51 int path_is_url(char_u *p); |
99ebf78686a9
patch 8.1.0914: code related to findfile() is spread out
Bram Moolenaar <Bram@vim.org>
parents:
15699
diff
changeset
|
52 int path_with_url(char_u *fname); |
26155
f2392648af3e
patch 8.2.3609: internal error when ModeChanged is triggered recursively
Bram Moolenaar <Bram@vim.org>
parents:
25798
diff
changeset
|
53 dict_T *get_v_event(save_v_event_T *sve); |
f2392648af3e
patch 8.2.3609: internal error when ModeChanged is triggered recursively
Bram Moolenaar <Bram@vim.org>
parents:
25798
diff
changeset
|
54 void restore_v_event(dict_T *v_event, save_v_event_T *sve); |
28397
d1702731786c
patch 8.2.4723: the ModeChanged autocmd event is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26155
diff
changeset
|
55 void may_trigger_modechanged(void); |
33791
370543108ba1
patch 9.0.2114: overflow detection not accurate when adding digits
Christian Brabandt <cb@256bit.org>
parents:
32832
diff
changeset
|
56 int vim_append_digit_int(int *value, int digit); |
370543108ba1
patch 9.0.2114: overflow detection not accurate when adding digits
Christian Brabandt <cb@256bit.org>
parents:
32832
diff
changeset
|
57 int vim_append_digit_long(long *value, int digit); |
33817
4550abd680b6
patch 9.0.2124: INT overflow detection logic can be simplified
Christian Brabandt <cb@256bit.org>
parents:
33791
diff
changeset
|
58 int trim_to_int(long long x); |
7 | 59 /* vim: set ft=c : */ |