<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,10 +1,3 @@
-
-Source code, additional information, screenshots... available at 
-    http://eigenclass.org/hiki/rcov
-
-If you're on win32, you can also find a pre-built rcovrt.so (which makes
-code coverage analysis &gt;100 times faster) in the above-mentioned pages.
-
 Overview
 ========
 rcov is a code coverage tool for Ruby. It is commonly used for viewing overall
@@ -48,8 +41,6 @@ description of the available options.
 Sample output
 =============
 
-See http://eigenclass.org/hiki.rb?rcov (once again) for screenshots.
-
 The text report (also used by default in RcovTasks) resembles
 
 
@@ -118,32 +109,3 @@ tests:
 License
 -------
 rcov is released under the terms of Ruby's license.
-rcov includes xx 0.1.0, which is subject to the following conditions:
-
-ePark Labs Public License version 1
-Copyright (c) 2005, ePark Labs, Inc. and contributors
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-  1. Redistributions of source code must retain the above copyright notice, this
-     list of conditions and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright notice,
-     this list of conditions and the following disclaimer in the documentation
-     and/or other materials provided with the distribution.
-  3. Neither the name of ePark Labs nor the names of its contributors may be
-     used to endorse or promote products derived from this software without
-     specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-</diff>
      <filename>BLURB</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 rcov is copyrighted free software by Mauricio Fernandez &lt;mfp@acm.org&gt;.
-You can redistribute it and/or modify it under either the terms of the GPL
-(see the file GPL), or the conditions below:
+You can redistribute it and/or modify it under either the terms of the GPL,
+or the conditions below:
 
   1. You may make and give away verbatim copies of the source form of the
      software without restriction, provided that you duplicate all of the
@@ -41,9 +41,6 @@ You can redistribute it and/or modify it under either the terms of the GPL
      software (possibly commercial).  But some files in the distribution
      are not written by the author, so that they are not under these terms.
 
-     For the list of those files and their copying conditions, see the
-     file LEGAL.
-
   5. The scripts and library files supplied as input to or produced as 
      output from the software do not automatically fall under the
      copyright of the software, but belong to whomever generated them, </diff>
      <filename>LICENSE</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,8 @@
 #define RCOVRT_VERSION_MINOR 0
 #define RCOVRT_VERSION_REV   0
 
+#define DEBUG = true;
+
 static VALUE mRcov;
 static VALUE mRCOV__;
 static VALUE oSCRIPT_LINES__;
@@ -17,236 +19,195 @@ static st_table* coverinfo = 0;
 static char coverage_hook_set_p;
 
 struct cov_array {
-        unsigned int len;
-        unsigned int *ptr;
+  unsigned int len;
+  unsigned int *ptr;
 };
 
 static struct cov_array *cached_array = 0;
 static char *cached_file = 0; 
 
-/* 
- *
- * coverage hook and associated functions 
- *
- * */
-static struct cov_array *
-coverage_increase_counter_uncached(char *sourcefile, unsigned int sourceline,
-                                   char mark_only)
-{
+static struct cov_array * coverage_increase_counter_uncached(char *sourcefile, unsigned int sourceline, char mark_only) {
   struct cov_array *carray = NULL;
  
   if(sourcefile == NULL) {
-          /* &quot;can't happen&quot;, just ignore and avoid segfault */
-          return NULL;
-  } else if(!st_lookup(coverinfo, (st_data_t)sourcefile, (st_data_t*)&amp;carray)) {
-          VALUE arr;
-
-          arr = rb_hash_aref(oSCRIPT_LINES__, rb_str_new2(sourcefile));
-          if(NIL_P(arr)) 
-                  return 0;
-          rb_check_type(arr, T_ARRAY);
-          carray = calloc(1, sizeof(struct cov_array));
-          carray-&gt;ptr = calloc(RARRAY_LEN(arr), sizeof(unsigned int));
-          carray-&gt;len = RARRAY_LEN(arr);
-          st_insert(coverinfo, (st_data_t)strdup(sourcefile), 
-                          (st_data_t) carray);
-  } else {
-          /* recovered carray, sanity check */
-          assert(carray &amp;&amp; &quot;failed to create valid carray&quot;);
+    /* &quot;can't happen&quot;, just ignore and avoid segfault */
+    return NULL;
+  } 
+  else if(!st_lookup(coverinfo, (st_data_t)sourcefile, (st_data_t*)&amp;carray)) {
+    VALUE arr;
+
+    arr = rb_hash_aref(oSCRIPT_LINES__, rb_str_new2(sourcefile));
+    if(NIL_P(arr)) 
+      return 0;
+    rb_check_type(arr, T_ARRAY);
+    carray = calloc(1, sizeof(struct cov_array));
+    carray-&gt;ptr = calloc(RARRAY_LEN(arr), sizeof(unsigned int));
+    carray-&gt;len = RARRAY_LEN(arr);
+    st_insert(coverinfo, (st_data_t)strdup(sourcefile), (st_data_t) carray);
+  } 
+  else {
+    /* recovered carray, sanity check */
+    assert(carray &amp;&amp; &quot;failed to create valid carray&quot;);
   }
 
   if(mark_only) {
-          if(!carray-&gt;ptr[sourceline])
-                  carray-&gt;ptr[sourceline] = 1;
-  } else {
-       if (carray &amp;&amp; carray-&gt;len &gt; sourceline) {
-          carray-&gt;ptr[sourceline]++;
-       }
+    if(!carray-&gt;ptr[sourceline])
+      carray-&gt;ptr[sourceline] = 1;
+  } 
+  else {
+    if (carray &amp;&amp; carray-&gt;len &gt; sourceline) {
+      carray-&gt;ptr[sourceline]++;
+    }
   }
 
   return carray;
 }
 
-
-static void
-coverage_mark_caller()
-{
-  // if @coverage_hook_activated
-  //   COVER[file] ||= Array.new(SCRIPT_LINES__[file].size, 0)
-  //   COVER[file][line - 1] ||= 0
-  //   COVER[file][line - 1] += 1
-  // end
-  
+static void coverage_mark_caller() {
   coverage_increase_counter_uncached(rb_sourcefile(), rb_sourceline(), 1);
 }
 
-
-static void
-coverage_increase_counter_cached(char *sourcefile, int sourceline)
-{
- if(cached_file == sourcefile &amp;&amp; cached_array &amp;&amp; cached_array-&gt;len &gt; sourceline) {
-         cached_array-&gt;ptr[sourceline]++;
-         return;
- }
- cached_file = sourcefile;
- cached_array = coverage_increase_counter_uncached(sourcefile, sourceline, 0);
+static void coverage_increase_counter_cached(char *sourcefile, int sourceline) {
+  if(cached_file == sourcefile &amp;&amp; cached_array &amp;&amp; cached_array-&gt;len &gt; sourceline) {
+    cached_array-&gt;ptr[sourceline]++;
+    return;
+  }
+  cached_file = sourcefile;
+  cached_array = coverage_increase_counter_uncached(sourcefile, sourceline, 0);
 }
 
-static void
-coverage_event_coverage_hook(rb_event_flag_t event, VALUE node, 
-                VALUE self, ID mid, VALUE klass)
-{
- char *sourcefile;
- unsigned int sourceline;
- static unsigned int in_hook = 0;
- 
- if(in_hook) {
-         return;
- }
-
- in_hook++;
-
-#if COVERAGE_DEBUG_EVENTS
- do {
-         int status;
-         VALUE old_exception;
-         old_exception = rb_gv_get(&quot;$!&quot;);
-         rb_protect(rb_inspect, klass, &amp;status);
-         if(!status) {
-                 printf(&quot;EVENT: %d %s %s %s %d\n&quot;, event,
-                                 klass ? RSTRING(rb_inspect(klass))-&gt;ptr : &quot;&quot;, 
-                                 mid ? (mid == ID_ALLOCATOR ? &quot;ID_ALLOCATOR&quot; : rb_id2name(mid))
-                                 : &quot;unknown&quot;,
-                                 node ? node-&gt;nd_file : &quot;&quot;, node ? nd_line(node) : 0);
-         } else {
-                 printf(&quot;EVENT: %d %s %s %d\n&quot;, event,
-                                 mid ? (mid == ID_ALLOCATOR ? &quot;ID_ALLOCATOR&quot; : rb_id2name(mid)) 
-                                 : &quot;unknown&quot;,
-                                 node ? node-&gt;nd_file : &quot;&quot;, node ? nd_line(node) : 0);
-         }
-         rb_gv_set(&quot;$!&quot;, old_exception);
- } while (0); 
-#endif
-
- if(event &amp; RUBY_EVENT_C_CALL) {
-         coverage_mark_caller();
- }
- if(event &amp; (RUBY_EVENT_C_CALL | RUBY_EVENT_C_RETURN | RUBY_EVENT_CLASS)) {
-         in_hook--;
-         return;
- }
-
- // printf(&quot;NODE? %s , %s\n&quot;, rb_id2name(rb_frame_this_func()), RSTRING_PTR(rb_inspect(node)));
+static void coverage_event_coverage_hook(rb_event_flag_t event, VALUE node, VALUE self, ID mid, VALUE klass) {
+  char *sourcefile;
+  unsigned int sourceline;
+  static unsigned int in_hook = 0;
  
- sourcefile = rb_sourcefile();
- sourceline = rb_sourceline();
- 
- if (0 == sourceline || 0 == sourcefile) {
-         in_hook--;
-         return;
- }
+  if(in_hook) {
+    return;
+  }
 
- coverage_increase_counter_cached(sourcefile, sourceline);
- if(event &amp; RUBY_EVENT_CALL)
-         coverage_mark_caller();
- in_hook--;
+  in_hook++;
+
+  #if COVERAGE_DEBUG_EVENTS
+  do {
+    int status;
+    VALUE old_exception;
+    old_exception = rb_gv_get(&quot;$!&quot;);
+    rb_protect(rb_inspect, klass, &amp;status);
+    if(!status) {
+      printf(&quot;EVENT: %d %s %s %s %d\n&quot;, event,
+             klass ? RSTRING(rb_inspect(klass))-&gt;ptr : &quot;&quot;, 
+             mid ? (mid == ID_ALLOCATOR ? &quot;ID_ALLOCATOR&quot; : rb_id2name(mid))
+             : &quot;unknown&quot;,
+             node ? node-&gt;nd_file : &quot;&quot;, node ? nd_line(node) : 0);
+    } 
+    else {
+      printf(&quot;EVENT: %d %s %s %d\n&quot;, event,
+             mid ? (mid == ID_ALLOCATOR ? &quot;ID_ALLOCATOR&quot; : rb_id2name(mid)) 
+             : &quot;unknown&quot;,
+             node ? node-&gt;nd_file : &quot;&quot;, node ? nd_line(node) : 0);
+    }
+    rb_gv_set(&quot;$!&quot;, old_exception);
+  } while (0); 
+  #endif
+
+  if(event &amp; RUBY_EVENT_C_CALL) {
+    coverage_mark_caller();
+  }
+  if(event &amp; (RUBY_EVENT_C_CALL | RUBY_EVENT_C_RETURN | RUBY_EVENT_CLASS)) {
+    in_hook--;
+    return;
+  }
+  
+  sourcefile = rb_sourcefile();
+  sourceline = rb_sourceline();
+  
+  if (0 == sourceline || 0 == sourcefile) {
+    in_hook--;
+    return;
+  }
+  
+  coverage_increase_counter_cached(sourcefile, sourceline);
+  if(event &amp; RUBY_EVENT_CALL)
+    coverage_mark_caller();
+  in_hook--;
 }
 
-
-static VALUE
-cov_install_coverage_hook(VALUE self)
-{
+static VALUE cov_install_coverage_hook(VALUE self) {
   if(!coverage_hook_set_p) {
-       if(!coverinfo)
-               coverinfo = st_init_strtable();
-          coverage_hook_set_p = 1;
-          /* TODO: allow C_CALL too, since it's supported already
-           * the overhead is around ~30%, tested on typo */
-           VALUE holder = 0;
-           rb_add_event_hook(coverage_event_coverage_hook, 
-                        RUBY_EVENT_ALL &amp; ~RUBY_EVENT_C_CALL &amp;
-                        ~RUBY_EVENT_C_RETURN &amp; ~RUBY_EVENT_CLASS, holder);
-          return Qtrue;
+    if(!coverinfo)
+      coverinfo = st_init_strtable();
+    coverage_hook_set_p = 1;
+    /* TODO: allow C_CALL too, since it's supported already
+     * the overhead is around ~30%, tested on typo */
+    VALUE holder = 0;
+    rb_add_event_hook(coverage_event_coverage_hook, 
+                      RUBY_EVENT_ALL &amp; ~RUBY_EVENT_C_CALL &amp;
+                      ~RUBY_EVENT_C_RETURN &amp; ~RUBY_EVENT_CLASS, holder);
+    return Qtrue;
   }
   else
-          return Qfalse;
+    return Qfalse;
 }
 
-
-static int
-populate_cover(st_data_t key, st_data_t value, st_data_t cover)
-{
- VALUE rcover;
- VALUE rkey;
- VALUE rval;
- struct cov_array *carray;
- unsigned int i;
- 
- rcover = (VALUE)cover;
- carray = (struct cov_array *) value;
- rkey = rb_str_new2((char*) key);
- rval = rb_ary_new2(carray-&gt;len);
- for(i = 0; i &lt; carray-&gt;len; i++)
-         rb_ary_push(rval, UINT2NUM(carray-&gt;ptr[i]));
-
- rb_hash_aset(rcover, rkey, rval);
- 
- return ST_CONTINUE;
+static int populate_cover(st_data_t key, st_data_t value, st_data_t cover) {
+  VALUE rcover;
+  VALUE rkey;
+  VALUE rval;
+  struct cov_array *carray;
+  unsigned int i;
+  
+  rcover = (VALUE)cover;
+  carray = (struct cov_array *) value;
+  rkey = rb_str_new2((char*) key);
+  rval = rb_ary_new2(carray-&gt;len);
+  for(i = 0; i &lt; carray-&gt;len; i++)
+    rb_ary_push(rval, UINT2NUM(carray-&gt;ptr[i]));
+  
+  rb_hash_aset(rcover, rkey, rval);
+  
+  return ST_CONTINUE;
 }
 
-
-static int
-free_table(st_data_t key, st_data_t value, st_data_t ignored)
-{
- struct cov_array *carray;
- 
- carray = (struct cov_array *) value;
- free((char *)key);
- free(carray-&gt;ptr);
- free(carray);
-
- return ST_CONTINUE;
+static int free_table(st_data_t key, st_data_t value, st_data_t ignored) {
+  struct cov_array *carray;
+  
+  carray = (struct cov_array *) value;
+  free((char *)key);
+  free(carray-&gt;ptr);
+  free(carray);
+  
+  return ST_CONTINUE;
 }
 
-
-static VALUE
-cov_remove_coverage_hook(VALUE self)
-{
- if(!coverage_hook_set_p) 
-         return Qfalse;
- else {
-         rb_remove_event_hook(coverage_event_coverage_hook);
-         coverage_hook_set_p = 0;
-         return Qtrue;
- }
+static VALUE cov_remove_coverage_hook(VALUE self) {
+  if(!coverage_hook_set_p) 
+    return Qfalse;
+  else {
+    rb_remove_event_hook(coverage_event_coverage_hook);
+    coverage_hook_set_p = 0;
+    return Qtrue;
+  }
 }
 
-
-static VALUE
-cov_generate_coverage_info(VALUE self)
-{
+static VALUE cov_generate_coverage_info(VALUE self) {
   VALUE cover;
 
   if(rb_const_defined_at(mRCOV__, id_cover)) {
-       rb_mod_remove_const(mRCOV__, ID2SYM(id_cover));
+    rb_mod_remove_const(mRCOV__, ID2SYM(id_cover));
   }
 
   cover = rb_hash_new();
   if(coverinfo)
-       st_foreach(coverinfo, populate_cover, cover);
+    st_foreach(coverinfo, populate_cover, cover);
   rb_define_const(mRCOV__, &quot;COVER&quot;, cover);
 
   return cover;
 }
 
-
-static VALUE
-cov_reset_coverage(VALUE self)
-{
+static VALUE cov_reset_coverage(VALUE self) {
   if(coverage_hook_set_p) {
-       rb_raise(rb_eRuntimeError, 
-               &quot;Cannot reset the coverage info in the middle of a traced run.&quot;);
-       return Qnil;
+    rb_raise(rb_eRuntimeError, &quot;Cannot reset the coverage info in the middle of a traced run.&quot;);
+    return Qnil;
   }
 
   cached_array = 0;
@@ -258,10 +219,7 @@ cov_reset_coverage(VALUE self)
   return Qnil;
 }
 
-
-static VALUE
-cov_ABI(VALUE self)
-{
+static VALUE cov_ABI(VALUE self) {
   VALUE ret;
 
   ret = rb_ary_new();
@@ -272,44 +230,37 @@ cov_ABI(VALUE self)
   return ret;
 }
 
-
-void
-Init_rcovrt()
-{
- ID id_rcov = rb_intern(&quot;Rcov&quot;);
- ID id_coverage__ = rb_intern(&quot;RCOV__&quot;);
- ID id_script_lines__ = rb_intern(&quot;SCRIPT_LINES__&quot;);
- 
- id_cover = rb_intern(&quot;COVER&quot;);
- 
- if(rb_const_defined(rb_cObject, id_rcov)) 
-         mRcov = rb_const_get(rb_cObject, id_rcov);
- else
-         mRcov = rb_define_module(&quot;Rcov&quot;);
- 
- if(rb_const_defined(mRcov, id_coverage__))
-         mRCOV__ = rb_const_get_at(mRcov, id_coverage__);
- else
-         mRCOV__ = rb_define_module_under(mRcov, &quot;RCOV__&quot;);
- 
- if(rb_const_defined(rb_cObject, id_script_lines__))
-         oSCRIPT_LINES__ = rb_const_get(rb_cObject, rb_intern(&quot;SCRIPT_LINES__&quot;));
- else {
-         oSCRIPT_LINES__ = rb_hash_new();
-         rb_const_set(rb_cObject, id_script_lines__, oSCRIPT_LINES__);
- }
- 
- coverage_hook_set_p = 0;
- 
- rb_define_singleton_method(mRCOV__, &quot;install_coverage_hook&quot;, 
-                 cov_install_coverage_hook, 0);
- rb_define_singleton_method(mRCOV__, &quot;remove_coverage_hook&quot;, 
-                 cov_remove_coverage_hook, 0);
- rb_define_singleton_method(mRCOV__, &quot;generate_coverage_info&quot;, 
-              cov_generate_coverage_info, 0);
- rb_define_singleton_method(mRCOV__, &quot;reset_coverage&quot;, cov_reset_coverage, 0);
- rb_define_singleton_method(mRCOV__, &quot;ABI&quot;, cov_ABI, 0);
- 
- Init_rcov_callsite();
+void Init_rcovrt() {
+  ID id_rcov = rb_intern(&quot;Rcov&quot;);
+  ID id_coverage__ = rb_intern(&quot;RCOV__&quot;);
+  ID id_script_lines__ = rb_intern(&quot;SCRIPT_LINES__&quot;);
+  
+  id_cover = rb_intern(&quot;COVER&quot;);
+  
+  if(rb_const_defined(rb_cObject, id_rcov)) 
+    mRcov = rb_const_get(rb_cObject, id_rcov);
+  else
+    mRcov = rb_define_module(&quot;Rcov&quot;);
+  
+  if(rb_const_defined(mRcov, id_coverage__))
+    mRCOV__ = rb_const_get_at(mRcov, id_coverage__);
+  else
+    mRCOV__ = rb_define_module_under(mRcov, &quot;RCOV__&quot;);
+  
+  if(rb_const_defined(rb_cObject, id_script_lines__))
+    oSCRIPT_LINES__ = rb_const_get(rb_cObject, rb_intern(&quot;SCRIPT_LINES__&quot;));
+  else {
+    oSCRIPT_LINES__ = rb_hash_new();
+    rb_const_set(rb_cObject, id_script_lines__, oSCRIPT_LINES__);
+  }
+  
+  coverage_hook_set_p = 0;
+  
+  rb_define_singleton_method(mRCOV__, &quot;install_coverage_hook&quot;, cov_install_coverage_hook, 0);
+  rb_define_singleton_method(mRCOV__, &quot;remove_coverage_hook&quot;, cov_remove_coverage_hook, 0);
+  rb_define_singleton_method(mRCOV__, &quot;generate_coverage_info&quot;, cov_generate_coverage_info, 0);
+  rb_define_singleton_method(mRCOV__, &quot;reset_coverage&quot;, cov_reset_coverage, 0);
+  rb_define_singleton_method(mRCOV__, &quot;ABI&quot;, cov_ABI, 0);
+  
+  Init_rcov_callsite();
 }
-/* vim: set sw=8 expandtab: */</diff>
      <filename>ext/rcovrt/1.9/rcovrt.c</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,3 @@
-def d(x)
-  4*x
-end
-
 def a
   b 10
 end</diff>
      <filename>test/assets/sample_05.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>LEGAL</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>5a56057b5031f80d4d3e91fbe3e726add367f83a</id>
    </parent>
  </parents>
  <author>
    <name>Aaron Bedra</name>
    <email>aaron@thinkrelevance.com</email>
  </author>
  <url>http://github.com/relevance/rcov/commit/c115f4a67e74708992d0b2913e06b6cd3e6f1d8b</url>
  <id>c115f4a67e74708992d0b2913e06b6cd3e6f1d8b</id>
  <committed-date>2009-05-29T07:38:09-07:00</committed-date>
  <authored-date>2009-05-29T07:38:09-07:00</authored-date>
  <message>Updating license bits</message>
  <tree>11e33b0c1e34f5583f9aaed35ac09fb4350faa82</tree>
  <committer>
    <name>Aaron Bedra</name>
    <email>aaron@thinkrelevance.com</email>
  </committer>
</commit>
