1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

warning: no indirect flag

* regparse.c (is_onechar_cclass): remove "found" indirect flag to
  suppress warnings by gcc 4.7.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-07-18 08:41:01 +00:00
parent 02f802f2ce
commit 40ce1eb403

View file

@ -5684,8 +5684,8 @@ countbits(unsigned int bits)
static int
is_onechar_cclass(CClassNode* cc, OnigCodePoint* code)
{
OnigCodePoint c; /* c is used iff found == 1 */
int found = 0;
const OnigCodePoint not_found = (OnigCodePoint)-1;
OnigCodePoint c = not_found;
int i;
BBuf *bbuf = cc->mbuf;
@ -5699,9 +5699,9 @@ is_onechar_cclass(CClassNode* cc, OnigCodePoint* code)
if ((n == 1) && (data[0] == data[1])) {
/* only one char found in the bbuf, save the code point. */
c = data[0];
if ((c >= SINGLE_BYTE_SIZE) || !BITSET_AT(cc->bs, c)) {
/* set found=1 if c is not included in the bitset */
found = 1;
if (((c < SINGLE_BYTE_SIZE) && BITSET_AT(cc->bs, c))) {
/* skip if c is included in the bitset */
c = not_found;
}
}
else {
@ -5713,8 +5713,7 @@ is_onechar_cclass(CClassNode* cc, OnigCodePoint* code)
for (i = 0; i < (int )BITSET_SIZE; i++) {
Bits b1 = cc->bs[i];
if (b1 != 0) {
if (((b1 & (b1 - 1)) == 0) && (found == 0)) {
found = 1;
if (((b1 & (b1 - 1)) == 0) && (c == not_found)) {
c = BITS_IN_ROOM * i + countbits(b1 - 1);
} else {
return 0; /* the character class contains multiple chars */
@ -5722,7 +5721,7 @@ is_onechar_cclass(CClassNode* cc, OnigCodePoint* code)
}
}
if (found) {
if (c != not_found) {
*code = c;
return 1;
}