Skip to content

Commit f6d178f

Browse files
committed
ISO C90 forbids mixed declarations and code
Cannot use C99 syntax, as far as supporting Ruby 2.6 and earlier.
1 parent 52259a1 commit f6d178f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/strscan/strscan.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ static VALUE
12741274
strscan_scan_base10_integer(VALUE self)
12751275
{
12761276
char *ptr;
1277-
long len = 0;
1277+
long len = 0, remaining_len;
12781278
struct strscanner *p;
12791279

12801280
GET_SCANNER(self, p);
@@ -1284,7 +1284,7 @@ strscan_scan_base10_integer(VALUE self)
12841284

12851285
ptr = CURPTR(p);
12861286

1287-
long remaining_len = S_RESTLEN(p);
1287+
remaining_len = S_RESTLEN(p);
12881288

12891289
if (remaining_len <= 0) {
12901290
return Qnil;
@@ -1311,7 +1311,7 @@ static VALUE
13111311
strscan_scan_base16_integer(VALUE self)
13121312
{
13131313
char *ptr;
1314-
long len = 0;
1314+
long len = 0, remaining_len;
13151315
struct strscanner *p;
13161316

13171317
GET_SCANNER(self, p);
@@ -1321,7 +1321,7 @@ strscan_scan_base16_integer(VALUE self)
13211321

13221322
ptr = CURPTR(p);
13231323

1324-
long remaining_len = S_RESTLEN(p);
1324+
remaining_len = S_RESTLEN(p);
13251325

13261326
if (remaining_len <= 0) {
13271327
return Qnil;

0 commit comments

Comments
 (0)