aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp_bt.c
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-04-26 23:23:44 +0200
committerGitHub <noreply@github.com>2023-04-26 23:23:44 +0200
commit3b0df1780e2c8526bda5dead18ee7cc45925caba (patch)
treec8415dc986f1cd3ddf6044b4ec0318a089db3ed7 /src/nvim/regexp_bt.c
parent7d0479c55810af9bf9f115ba69d1419ea81ec41e (diff)
downloadrneovim-3b0df1780e2c8526bda5dead18ee7cc45925caba.tar.gz
rneovim-3b0df1780e2c8526bda5dead18ee7cc45925caba.tar.bz2
rneovim-3b0df1780e2c8526bda5dead18ee7cc45925caba.zip
refactor: uncrustify
Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
Diffstat (limited to 'src/nvim/regexp_bt.c')
-rw-r--r--src/nvim/regexp_bt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/regexp_bt.c b/src/nvim/regexp_bt.c
index a6f554d4ae..08b97b60ba 100644
--- a/src/nvim/regexp_bt.c
+++ b/src/nvim/regexp_bt.c
@@ -1513,7 +1513,7 @@ static void regtail(uint8_t *p, uint8_t *val)
// Find last node.
uint8_t *scan = p;
- for (;;) {
+ while (true) {
uint8_t *temp = regnext(scan);
if (temp == NULL) {
break;
@@ -2427,7 +2427,7 @@ do_multibyte:
int l;
// Need to get composing character too.
- for (;;) {
+ while (true) {
l = utf_ptr2len((char *)regparse);
if (!utf_composinglike(regparse, regparse + l)) {
break;
@@ -2683,7 +2683,7 @@ static uint8_t *regbranch(int *flagp)
*flagp = WORST | HASNL; // Tentatively.
ret = regnode(BRANCH);
- for (;;) {
+ while (true) {
latest = regconcat(&flags);
if (latest == NULL) {
return NULL;
@@ -3536,7 +3536,7 @@ static bool regmatch(uint8_t *scan, proftime_T *tm, int *timed_out)
backpos.ga_len = 0;
// Repeat until "regstack" is empty.
- for (;;) {
+ while (true) {
// Some patterns may take a long time to match, e.g., "\([a-z]\+\)\+Q".
// Allow interrupting them with CTRL-C.
reg_breakcheck();
@@ -3550,7 +3550,7 @@ static bool regmatch(uint8_t *scan, proftime_T *tm, int *timed_out)
// Repeat for items that can be matched sequentially, without using the
// regstack.
- for (;;) {
+ while (true) {
if (got_int || scan == NULL) {
status = RA_FAIL;
break;
@@ -4770,7 +4770,7 @@ static bool regmatch(uint8_t *scan, proftime_T *tm, int *timed_out)
}
// Repeat until we found a position where it could match.
- for (;;) {
+ while (true) {
if (status != RA_BREAK) {
// Tried first position already, advance.
if (rp->rs_state == RS_STAR_LONG) {