<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -188,7 +188,7 @@ VALUE board_occupy( VALUE self, VALUE x, VALUE y, VALUE p ) {
   VALUE occupied = rb_iv_get( self, &quot;@occupied&quot; );
   VALUE c = rb_funcall( Coord, id_new, 2, x, y );
   VALUE ary = rb_hash_aref( occupied, p );
-  if( ary == Qnil || RARRAY(ary)-&gt;len == 0 ) {
+  if( ary == Qnil || RARRAY_LEN(ary) == 0 ) {
     ary = rb_ary_new();
     rb_ary_push( ary, c );
     rb_hash_aset( occupied, p, ary );</diff>
      <filename>ext/vying/c/parts/board/board.c</filename>
    </modified>
    <modified>
      <diff>@@ -77,3 +77,21 @@ ID id_dup, id_x, id_y, id_subscript, id_subscript_assign, id_new,
 VALUE sym_black, sym_white, 
       sym_n, sym_s, sym_w, sym_e, sym_se, sym_nw, sym_sw, sym_ne;
 
+/* Ruby 1.9 and 1.8 compatibility */
+
+#ifndef RSTRING_PTR
+#define RSTRING_PTR(x) (RSTRING(x)-&gt;ptr)
+#endif
+
+#ifndef RSTRING_LEN
+#define RSTRING_LEN(x) (RSTRING(x)-&gt;len)
+#endif
+
+#ifndef RARRAY_PTR
+#define RARRAY_PTR(x) (RARRAY(x)-&gt;ptr)
+#endif
+
+#ifndef RARRAY_LEN
+#define RARRAY_LEN(x) (RARRAY(x)-&gt;len)
+#endif
+</diff>
      <filename>ext/vying/c/parts/board/board.h</filename>
    </modified>
    <modified>
      <diff>@@ -34,13 +34,13 @@ VALUE coords_include( VALUE self, VALUE c ) {
 
   VALUE omitted = rb_iv_get( self, &quot;@omitted&quot; );
 
-  if( RARRAY(omitted)-&gt;len == 0 ) {
+  if( RARRAY_LEN(omitted) == 0 ) {
     return Qtrue;
   }
 
   VALUE coords = rb_iv_get( self, &quot;@coords&quot; );
 
-  if( RARRAY(omitted)-&gt;len &lt; RARRAY(coords)-&gt;len ) {
+  if( RARRAY_LEN(omitted) &lt; RARRAY_LEN(coords) ) {
     return rb_funcall( omitted, id_include, 1, c ) == Qfalse ? Qtrue : Qfalse;
   }
   else {</diff>
      <filename>ext/vying/c/parts/board/coords.c</filename>
    </modified>
    <modified>
      <diff>@@ -26,7 +26,7 @@ VALUE coords_proxy_connected( VALUE self, VALUE cs ) {
 
     ns = rb_funcall( self, id_neighbors, 1, c );
 
-    for( i = 0; i &lt; RARRAY(ns)-&gt;len; i++ ) {
+    for( i = 0; i &lt; RARRAY_LEN(ns); i++ ) {
       VALUE nc = rb_ary_entry( ns, i );
 
       if( RTEST(rb_ary_includes( coords, nc )) ) {
@@ -37,6 +37,6 @@ VALUE coords_proxy_connected( VALUE self, VALUE cs ) {
     c = rb_ary_pop( check );
   }
 
-  return RARRAY(coords)-&gt;len == 0 ? Qtrue : Qfalse;
+  return RARRAY_LEN(coords) == 0 ? Qtrue : Qfalse;
 }
 </diff>
      <filename>ext/vying/c/parts/board/coords_proxy.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,15 +21,11 @@ VALUE custodial_capture_valid( int argc, VALUE *argv, VALUE self ) {
   VALUE p = argv[1];
 
   VALUE range = Qnil;
-  int first;
-  int last;
+  int first = 0;
+  int last = 0;
 
-  VALUE cells = rb_iv_get( self, &quot;@cells&quot; );
   VALUE dir = rb_iv_get( self, &quot;@directions&quot; );
 
-  int w = NUM2INT(rb_iv_get( self, &quot;@width&quot; ));
-  int h = NUM2INT(rb_iv_get( self, &quot;@height&quot; ));
-
   if( argc &gt; 2 &amp;&amp; RTEST(argv[2]) ) {
     range = argv[2];
     first = NUM2INT(rb_funcall( range, id_first, 0 ));
@@ -37,9 +33,9 @@ VALUE custodial_capture_valid( int argc, VALUE *argv, VALUE self ) {
   }
 
   int i, blen;
-  for( i = 0; i &lt; RARRAY(dir)-&gt;len; i++ ) {
+  for( i = 0; i &lt; RARRAY_LEN(dir); i++ ) {
     VALUE d = rb_ary_entry( dir, i );
-    int dx, dy, nx, ny;
+    int dx = 0, dy = 0, nx, ny;
     VALUE np;
 
     blen = 0;
@@ -131,10 +127,9 @@ VALUE custodial( int argc, VALUE *argv, VALUE self ) {
   VALUE replacement = Qnil;
 
   VALUE range = Qnil;
-  int first;
-  int last;
+  int first = 0;
+  int last = 0;
 
-  VALUE cells = rb_iv_get( self, &quot;@cells&quot; );
   VALUE dir = rb_iv_get( self, &quot;@directions&quot; );
 
   VALUE cap = rb_ary_new();
@@ -156,9 +151,9 @@ VALUE custodial( int argc, VALUE *argv, VALUE self ) {
   }
 
   int i;
-  for( i = 0; i &lt; RARRAY(dir)-&gt;len; i++ ) {
+  for( i = 0; i &lt; RARRAY_LEN(dir); i++ ) {
     VALUE d = rb_ary_entry( dir, i );
-    int dx, dy, nx, ny;
+    int dx = 0, dy = 0, nx, ny;
     VALUE np;
 
     blen = 0;</diff>
      <filename>ext/vying/c/parts/board/custodial_capture.c</filename>
    </modified>
    <modified>
      <diff>@@ -11,18 +11,15 @@
 
 VALUE frontier_update( VALUE self, VALUE c ) {
   VALUE frontier = rb_iv_get( self, &quot;@frontier&quot; );
-  VALUE cells = rb_iv_get( self, &quot;@cells&quot; );
   VALUE coords = rb_iv_get( self, &quot;@coords&quot; );
   VALUE dir = rb_funcall( self, id_directions, 1, c );
   int x = NUM2INT(rb_funcall( c, id_x, 0 ));
   int y = NUM2INT(rb_funcall( c, id_y, 0 ));
-  int w = NUM2INT(rb_iv_get( self, &quot;@width&quot; ));
-  int h = NUM2INT(rb_iv_get( self, &quot;@height&quot; ));
 
   int i;
-  for( i = 0; i &lt; RARRAY(dir)-&gt;len; i++ ) {
+  for( i = 0; i &lt; RARRAY_LEN(dir); i++ ) {
     VALUE d = rb_ary_entry( dir, i );
-    int dx, dy;
+    int dx = 0, dy = 0;
     VALUE nx, ny;
 
     if( d == sym_n ) {</diff>
      <filename>ext/vying/c/parts/board/frontier.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dcc3a3edbd7500af196161046dcbc43f837cd056</id>
    </parent>
  </parents>
  <author>
    <name>Eric K Idema</name>
    <email>eki@vying.org</email>
  </author>
  <url>http://github.com/eki/vying/commit/d8d4c3de94083ee26fe166a9e9a3c8f671ca299d</url>
  <id>d8d4c3de94083ee26fe166a9e9a3c8f671ca299d</id>
  <committed-date>2009-04-25T12:09:23-07:00</committed-date>
  <authored-date>2009-04-25T12:09:23-07:00</authored-date>
  <message>Fixed Ruby 1.9 support.</message>
  <tree>e67c04ff226491d22abde265efc5f71cdcf61f68</tree>
  <committer>
    <name>Eric K Idema</name>
    <email>eki@vying.org</email>
  </committer>
</commit>
