Skip to content

Commit 3818f20

Browse files
author
ripley
committed
localize some variables
git-svn-id: https://svn.r-project.org/R/trunk@87882 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent e51e725 commit 3818f20

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/library/tools/src/text.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ delim_match(SEXP x, SEXP delims)
5858
*/
5959

6060
char c;
61-
const char *s, *delim_start, *delim_end;
62-
int n, i, pos, start, end, delim_depth;
61+
const char *delim_start, *delim_end;
62+
int n, i, start, end;
6363
int lstart, lend;
64-
bool is_escaped, equal_start_and_end_delims;
6564
SEXP ans, matchlen;
6665
mbstate_t mb_st; int used;
6766

@@ -71,7 +70,7 @@ delim_match(SEXP x, SEXP delims)
7170
delim_start = translateChar(STRING_ELT(delims, 0));
7271
delim_end = translateChar(STRING_ELT(delims, 1));
7372
lstart = (int) strlen(delim_start); lend = (int) strlen(delim_end);
74-
equal_start_and_end_delims = strcmp(delim_start, delim_end) == 0;
73+
bool equal_start_and_end_delims = strcmp(delim_start, delim_end) == 0;
7574

7675
n = length(x);
7776
PROTECT(ans = allocVector(INTSXP, n));
@@ -80,8 +79,9 @@ delim_match(SEXP x, SEXP delims)
8079
for(i = 0; i < n; i++) {
8180
memset(&mb_st, 0, sizeof(mbstate_t));
8281
start = end = -1;
83-
s = translateChar(STRING_ELT(x, i));
84-
pos = is_escaped = delim_depth = 0;
82+
const char *s = translateChar(STRING_ELT(x, i));
83+
int pos = 0, delim_depth = 0;
84+
bool is_escaped = false;
8585
while((c = *s) != '\0') {
8686
if(c == '\n') {
8787
is_escaped = false;

0 commit comments

Comments
 (0)