aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp_bt.c
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2023-09-29 14:58:48 +0200
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2023-10-09 11:45:46 +0200
commit8e932480f61d6101bf8bea1abc07ed93826221fd (patch)
tree06cf8d0af6e786aba6d01343c54ba52b01738daa /src/nvim/regexp_bt.c
parentdacd34364ff3af98bc2d357c43e3ce06638e2ce9 (diff)
downloadrneovim-8e932480f61d6101bf8bea1abc07ed93826221fd.tar.gz
rneovim-8e932480f61d6101bf8bea1abc07ed93826221fd.tar.bz2
rneovim-8e932480f61d6101bf8bea1abc07ed93826221fd.zip
refactor: the long goodbye
long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
Diffstat (limited to 'src/nvim/regexp_bt.c')
-rw-r--r--src/nvim/regexp_bt.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/regexp_bt.c b/src/nvim/regexp_bt.c
index 0e1ea9d3b0..a38600c324 100644
--- a/src/nvim/regexp_bt.c
+++ b/src/nvim/regexp_bt.c
@@ -2466,8 +2466,8 @@ static uint8_t *regpiece(int *flagp)
int op;
uint8_t *next;
int flags;
- long minval;
- long maxval;
+ int minval;
+ int maxval;
ret = regatom(&flags);
if (ret == NULL) {
@@ -4869,7 +4869,7 @@ static bool regmatch(uint8_t *scan, proftime_T *tm, int *timed_out)
/// @param timed_out flag set on timeout or NULL
///
/// @return 0 for failure, or number of lines contained in the match.
-static long regtry(bt_regprog_T *prog, colnr_T col, proftime_T *tm, int *timed_out)
+static int regtry(bt_regprog_T *prog, colnr_T col, proftime_T *tm, int *timed_out)
{
rex.input = rex.line + col;
rex.need_clear_subexpr = true;
@@ -4939,12 +4939,12 @@ static long regtry(bt_regprog_T *prog, colnr_T col, proftime_T *tm, int *timed_o
/// @param timed_out flag set on timeout or NULL
///
/// @return 0 for failure, or number of lines contained in the match.
-static long bt_regexec_both(uint8_t *line, colnr_T startcol, proftime_T *tm, int *timed_out)
+static int bt_regexec_both(uint8_t *line, colnr_T startcol, proftime_T *tm, int *timed_out)
{
bt_regprog_T *prog;
uint8_t *s;
colnr_T col = startcol;
- long retval = 0L;
+ int retval = 0;
// Create "regstack" and "backpos" if they are not allocated yet.
// We allocate *_INITIAL amount of bytes first and then set the grow size
@@ -5175,8 +5175,8 @@ static int bt_regexec_nl(regmatch_T *rmp, uint8_t *line, colnr_T col, bool line_
///
/// @return zero if there is no match and number of lines contained in the match
/// otherwise.
-static long bt_regexec_multi(regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col,
- proftime_T *tm, int *timed_out)
+static int bt_regexec_multi(regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col,
+ proftime_T *tm, int *timed_out)
{
init_regexec_multi(rmp, win, buf, lnum);
return bt_regexec_both(NULL, col, tm, timed_out);