source: trunk/dports/ruby/rb-hyperestraier/files/patch-rubynative-src-estraier.c.diff @ 106576

Last change on this file since 106576 was 106576, checked in by kimuraw@…, 7 years ago

ruby/rb-hyperestraier: upgrade to 1.4.13, fix build error with ruby-1.8.7 or later

File size: 1.6 KB
  • src/estraier.c

    old new  
    351351  vdoc = rb_iv_get(vself, VNDATA);
    352352  Data_Get_Struct(vdoc, ESTDOC, doc);
    353353  Check_Type(vwords, T_ARRAY);
    354   len = RARRAY(vwords)->len;
     354  len = RARRAY_LEN(vwords);
    355355  for(i = 0; i < len; i++){
    356356    Check_Type(rb_ary_entry(vwords, i), T_STRING);
    357357  }
     
    764764  CBMAP *hints;
    765765  int i, dnum, *res, rnum;
    766766  Check_Type(vdbs, T_ARRAY);
    767   dnum = RARRAY(vdbs)->len;
     767  dnum = RARRAY_LEN(vdbs);
    768768  dbs = cbmalloc(dnum * sizeof(ESTMTDB *) + 1);
    769769  for(i = 0; i < dnum; i++){
    770770    vdb = rb_ary_entry(vdbs, i);
     
    11891189  VALUE str;
    11901190  int i, len;
    11911191  list = cblistopen();
    1192   len = RARRAY(obj)->len;
     1192  len = RARRAY_LEN(obj);
    11931193  for(i = 0; i < len; i++){
    11941194    str = rb_ary_entry(obj, i);
    1195     cblistpush(list, RSTRING(str)->ptr, RSTRING(str)->len);
     1195    cblistpush(list, RSTRING_PTR(str), RSTRING_LEN(str));
    11961196  }
    11971197  return list;
    11981198}
     
    12181218  int i, len;
    12191219  map = cbmapopenex(31);
    12201220  keys = rb_funcall(obj, rb_intern("keys"), 0);
    1221   len = RARRAY(keys)->len;
     1221  len = RARRAY_LEN(keys);
    12221222  for(i = 0; i < len; i++){
    12231223    key = rb_ary_entry(keys, i);
    12241224    val = rb_hash_aref(obj, key);
    12251225    key = rb_String(key);
    12261226    val = rb_String(val);
    1227     cbmapput(map, RSTRING(key)->ptr, RSTRING(key)->len,
    1228              RSTRING(val)->ptr, RSTRING(val)->len, 0);
     1227    cbmapput(map, RSTRING_PTR(key), RSTRING_LEN(key),
     1228             RSTRING_PTR(val), RSTRING_LEN(val), 0);
    12291229  }
    12301230  return map;
    12311231}
Note: See TracBrowser for help on using the repository browser.