Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* ext/hpricot_scan: big problems on Ruby 1.8.6, use INT2FIX instead …

…of INT2NUM. hashes were being cast to bignums.
  • Loading branch information...
commit ceda421d7e9061c54bc84cc44451f21aee644b8a 1 parent cd161c1
_why authored
View
4,228 ext/hpricot_scan/hpricot_css.c
2,112 additions, 2,116 deletions not shown
View
6 ext/hpricot_scan/hpricot_scan.c
@@ -247,7 +247,7 @@ rb_hpricot_token(hpricot_state *S, VALUE sym, VALUE tag, VALUE attr, char *raw,
if (H_ELE_GET(S->focus, H_ELE_EC) == sym_CDATA &&
(sym != sym_procins && sym != sym_comment && sym != sym_cdata && sym != sym_text) &&
- !(sym == sym_etag && INT2NUM(rb_str_hash(tag)) == H_ELE_GET(S->focus, H_ELE_HASH)))
+ !(sym == sym_etag && INT2FIX(rb_str_hash(tag)) == H_ELE_GET(S->focus, H_ELE_HASH)))
{
sym = sym_text;
tag = rb_str_new(raw, rawlen);
@@ -265,7 +265,7 @@ rb_hpricot_token(hpricot_state *S, VALUE sym, VALUE tag, VALUE attr, char *raw,
}
if (sym == sym_emptytag || sym == sym_stag) {
- VALUE name = INT2NUM(rb_str_hash(tag));
+ VALUE name = INT2FIX(rb_str_hash(tag));
H_ELE(cElem);
H_ELE_SET(ele, H_ELE_HASH, name);
@@ -325,7 +325,7 @@ rb_hpricot_token(hpricot_state *S, VALUE sym, VALUE tag, VALUE attr, char *raw,
//
// (see also: the search above for fixups)
//
- name = INT2NUM(rb_str_hash(tag));
+ name = INT2FIX(rb_str_hash(tag));
while (e != S->doc)
{
if (H_ELE_GET(e, H_ELE_HASH) == name)
View
6 ext/hpricot_scan/hpricot_scan.rl
@@ -280,7 +280,7 @@ rb_hpricot_token(hpricot_state *S, VALUE sym, VALUE tag, VALUE attr, char *raw,
if (H_ELE_GET(S->focus, H_ELE_EC) == sym_CDATA &&
(sym != sym_procins && sym != sym_comment && sym != sym_cdata && sym != sym_text) &&
- !(sym == sym_etag && INT2NUM(rb_str_hash(tag)) == H_ELE_GET(S->focus, H_ELE_HASH)))
+ !(sym == sym_etag && INT2FIX(rb_str_hash(tag)) == H_ELE_GET(S->focus, H_ELE_HASH)))
{
sym = sym_text;
tag = rb_str_new(raw, rawlen);
@@ -298,7 +298,7 @@ rb_hpricot_token(hpricot_state *S, VALUE sym, VALUE tag, VALUE attr, char *raw,
}
if (sym == sym_emptytag || sym == sym_stag) {
- VALUE name = INT2NUM(rb_str_hash(tag));
+ VALUE name = INT2FIX(rb_str_hash(tag));
H_ELE(cElem);
H_ELE_SET(ele, H_ELE_HASH, name);
@@ -358,7 +358,7 @@ rb_hpricot_token(hpricot_state *S, VALUE sym, VALUE tag, VALUE attr, char *raw,
//
// (see also: the search above for fixups)
//
- name = INT2NUM(rb_str_hash(tag));
+ name = INT2FIX(rb_str_hash(tag));
while (e != S->doc)
{
if (H_ELE_GET(e, H_ELE_HASH) == name)
Please sign in to comment.
Something went wrong with that request. Please try again.