Skip to content

Commit 40f676f

Browse files
committedJan 3, 2021
Remove trailing whitespaces in source files
1 parent 0cb96dc commit 40f676f

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed
 

‎re.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ int re_matchp(re_t pattern, const char* text, int* matchlength)
9090
do
9191
{
9292
idx += 1;
93-
93+
9494
if (matchpattern(pattern, text, matchlength))
9595
{
9696
if (text[0] == '\0')
9797
return -1;
98-
98+
9999
return idx;
100100
}
101101
}
@@ -151,8 +151,8 @@ re_t re_compile(const char* pattern)
151151
case 's': { re_compiled[j].type = WHITESPACE; } break;
152152
case 'S': { re_compiled[j].type = NOT_WHITESPACE; } break;
153153

154-
/* Escaped character, e.g. '.' or '$' */
155-
default:
154+
/* Escaped character, e.g. '.' or '$' */
155+
default:
156156
{
157157
re_compiled[j].type = CHAR;
158158
re_compiled[j].ch = pattern[i];
@@ -162,7 +162,7 @@ re_t re_compile(const char* pattern)
162162
/* '\\' as last char in pattern -> invalid regular expression. */
163163
/*
164164
else
165-
{
165+
{
166166
re_compiled[j].type = CHAR;
167167
re_compiled[j].ch = pattern[i];
168168
}
@@ -184,7 +184,7 @@ re_t re_compile(const char* pattern)
184184
{
185185
return 0;
186186
}
187-
}
187+
}
188188
else
189189
{
190190
re_compiled[j].type = CHAR_CLASS;
@@ -356,7 +356,7 @@ static int matchcharclass(char c, const char* str)
356356
if (matchmetachar(c, str))
357357
{
358358
return 1;
359-
}
359+
}
360360
else if ((c == str[0]) && !ismetachar(c))
361361
{
362362
return 1;
@@ -411,7 +411,7 @@ static int matchstar(regex_t p, regex_t* pattern, const char* text, int* matchle
411411
return 1;
412412
(*matchlength)--;
413413
}
414-
414+
415415
*matchlength = prelen;
416416
return 0;
417417
}
@@ -430,7 +430,7 @@ static int matchplus(regex_t p, regex_t* pattern, const char* text, int* matchle
430430
return 1;
431431
(*matchlength)--;
432432
}
433-
433+
434434
return 0;
435435
}
436436

‎scripts/regex_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
the binary 'tests/test_rand' to check if the generated text also matches
77
the regex-pattern in the C implementation.
88
The exit-code of the testing program, is used to determine test success.
9-
9+
1010
This script is called by the Makefile when doing 'make test'
1111
"""
1212

‎tests/test2.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2085,13 +2085,13 @@ int main()
20852085

20862086
printf(" matching on %lu bytes of test input: ", bufsizes[i]);
20872087
fflush(stdout);
2088-
printf("%d \n", re_match(".+nonexisting.+", buf, &dummy));
2088+
printf("%d \n", re_match(".+nonexisting.+", buf, &dummy));
20892089

20902090
buf[bufsizes[i]] = old;
20912091
}
20922092

20932093
printf("\n\n");
2094-
2094+
20952095
return 0;
20962096
}
20972097

‎tests/test_print.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ int main(int argc, char** argv)
1515
else
1616
{
1717
printf("\nUsage: %s <PATTERN> \n", argv[0]);
18-
}
19-
return -2;
18+
}
19+
return -2;
2020
}
2121

‎tests/test_rand.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This program tries to match a given regular expression with text given as input to stdin.
33
If the text is a match for the pattern, the program returns 0.
44
If the text doesn't match the pattern, the program returns -2.
5-
5+
66
This program is used in random testing to test a lot of random text and regex together.
77
See ./scripts/regex_test.py and the Makefile for this project for the gritty details.
88
*/
@@ -17,13 +17,13 @@ int main(int argc, char** argv)
1717
if (argc == 3)
1818
{
1919
int m = re_match(argv[1], argv[2], &length);
20-
if (m != -1)
20+
if (m != -1)
2121
return 0;
2222
}
2323
else
2424
{
2525
printf("\nUsage: %s <PATTERN> <TEXT> \n", argv[0]);
26-
}
27-
return -2;
26+
}
27+
return -2;
2828
}
2929

0 commit comments

Comments
 (0)
Please sign in to comment.