lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [18/22] lucy-clownfish git commit: Rename VArray to Vector
Date Wed, 29 Apr 2015 19:55:19 GMT
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3fb61a74/runtime/perl/lib/Clownfish.pod
----------------------------------------------------------------------
diff --git a/runtime/perl/lib/Clownfish.pod b/runtime/perl/lib/Clownfish.pod
index e177adc..e94e595 100644
--- a/runtime/perl/lib/Clownfish.pod
+++ b/runtime/perl/lib/Clownfish.pod
@@ -507,10 +507,10 @@ before the call and decrement it when it's no longer used. If the caller
does
 not make further use of the passed-in object, it must not decrement its
 reference count after the call.
 
-This is typically used in container classes like VArray:
+This is typically used in container classes like Vector:
 
     String *string = String_newf("Hello");
-    VA_Push(array, (Obj*)string);
+    Vec_Push(array, (Obj*)string);
     // No need to DECREF the string.
 
 =head3 Default parameter values
@@ -625,7 +625,7 @@ Example:
     /* Clownfish header */
 
     class Path {
-        VArray *nodes;
+        Vector *nodes;
 
         public void
         Destroy(Path *self);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3fb61a74/runtime/perl/lib/Clownfish/VArray.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/lib/Clownfish/VArray.pm b/runtime/perl/lib/Clownfish/VArray.pm
index 561371d..a120baf 100644
--- a/runtime/perl/lib/Clownfish/VArray.pm
+++ b/runtime/perl/lib/Clownfish/VArray.pm
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-package Clownfish::VArray;
+package Clownfish::Vector;
 use Clownfish;
 our $VERSION = '0.004000';
 $VERSION = eval $VERSION;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3fb61a74/runtime/perl/t/binding/016-varray.t
----------------------------------------------------------------------
diff --git a/runtime/perl/t/binding/016-varray.t b/runtime/perl/t/binding/016-varray.t
index 4397cf5..2be6d09 100644
--- a/runtime/perl/t/binding/016-varray.t
+++ b/runtime/perl/t/binding/016-varray.t
@@ -21,7 +21,7 @@ use Clownfish;
 
 my ( $varray, $twin );
 
-$varray = Clownfish::VArray->new;
+$varray = Clownfish::Vector->new;
 $varray->push( Clownfish::String->new($_) ) for 1 .. 5;
 $varray->delete(3);
 $twin = $varray->_clone;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3fb61a74/runtime/perl/t/core/016-varray.t
----------------------------------------------------------------------
diff --git a/runtime/perl/t/core/016-varray.t b/runtime/perl/t/core/016-varray.t
index 5ddb5c1..858afdb 100644
--- a/runtime/perl/t/core/016-varray.t
+++ b/runtime/perl/t/core/016-varray.t
@@ -17,7 +17,7 @@ use strict;
 use warnings;
 
 use Clownfish::Test;
-my $success = Clownfish::Test::run_tests("Clownfish::Test::TestVArray");
+my $success = Clownfish::Test::run_tests("Clownfish::Test::TestVector");
 
 exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3fb61a74/runtime/perl/xs/XSBind.c
----------------------------------------------------------------------
diff --git a/runtime/perl/xs/XSBind.c b/runtime/perl/xs/XSBind.c
index b853939..df069c9 100644
--- a/runtime/perl/xs/XSBind.c
+++ b/runtime/perl/xs/XSBind.c
@@ -41,15 +41,15 @@
 static cfish_Hash*
 S_perl_hash_to_cfish_hash(pTHX_ HV *phash);
 
-// Convert a Perl array into a Clownfish VArray.  Caller takes responsibility
+// Convert a Perl array into a Clownfish Vector.  Caller takes responsibility
 // for a refcount.
-static cfish_VArray*
+static cfish_Vector*
 S_perl_array_to_cfish_array(pTHX_ AV *parray);
 
-// Convert a VArray to a Perl array.  Caller takes responsibility for a
+// Convert a Vector to a Perl array.  Caller takes responsibility for a
 // refcount.
 static SV*
-S_cfish_array_to_perl_array(pTHX_ cfish_VArray *varray);
+S_cfish_array_to_perl_array(pTHX_ cfish_Vector *varray);
 
 // Convert a Hash to a Perl hash.  Caller takes responsibility for a refcount.
 static SV*
@@ -119,7 +119,7 @@ XSBind_maybe_sv_to_cfish_obj(pTHX_ SV *sv, cfish_Class *klass,
             // Attempt to convert Perl hashes and arrays into their Clownfish
             // analogues.
             SV *inner = SvRV(sv);
-            if (SvTYPE(inner) == SVt_PVAV && klass == CFISH_VARRAY) {
+            if (SvTYPE(inner) == SVt_PVAV && klass == CFISH_VECTOR) {
                 retval = (cfish_Obj*)
                          S_perl_array_to_cfish_array(aTHX_ (AV*)inner);
             }
@@ -153,8 +153,8 @@ XSBind_cfish_to_perl(pTHX_ cfish_Obj *obj) {
     else if (CFISH_Obj_Is_A(obj, CFISH_BYTEBUF)) {
         return XSBind_bb_to_sv(aTHX_ (cfish_ByteBuf*)obj);
     }
-    else if (CFISH_Obj_Is_A(obj, CFISH_VARRAY)) {
-        return S_cfish_array_to_perl_array(aTHX_ (cfish_VArray*)obj);
+    else if (CFISH_Obj_Is_A(obj, CFISH_VECTOR)) {
+        return S_cfish_array_to_perl_array(aTHX_ (cfish_Vector*)obj);
     }
     else if (CFISH_Obj_Is_A(obj, CFISH_HASH)) {
         return S_cfish_hash_to_perl_hash(aTHX_ (cfish_Hash*)obj);
@@ -292,34 +292,34 @@ S_perl_hash_to_cfish_hash(pTHX_ HV *phash) {
     return retval;
 }
 
-static cfish_VArray*
+static cfish_Vector*
 S_perl_array_to_cfish_array(pTHX_ AV *parray) {
     const uint32_t  size   = av_len(parray) + 1;
-    cfish_VArray   *retval = cfish_VA_new(size);
+    cfish_Vector   *retval = cfish_Vec_new(size);
 
     // Iterate over array elems.
     for (uint32_t i = 0; i < size; i++) {
         SV **elem_sv = av_fetch(parray, i, false);
         if (elem_sv) {
             cfish_Obj *elem = XSBind_perl_to_cfish(aTHX_ *elem_sv);
-            if (elem) { CFISH_VA_Store(retval, i, elem); }
+            if (elem) { CFISH_Vec_Store(retval, i, elem); }
         }
     }
-    CFISH_VA_Resize(retval, size); // needed if last elem is NULL
+    CFISH_Vec_Resize(retval, size); // needed if last elem is NULL
 
     return retval;
 }
 
 static SV*
-S_cfish_array_to_perl_array(pTHX_ cfish_VArray *varray) {
+S_cfish_array_to_perl_array(pTHX_ cfish_Vector *varray) {
     AV *perl_array = newAV();
-    uint32_t num_elems = CFISH_VA_Get_Size(varray);
+    uint32_t num_elems = CFISH_Vec_Get_Size(varray);
 
     // Iterate over array elems.
     if (num_elems) {
         av_fill(perl_array, num_elems - 1);
         for (uint32_t i = 0; i < num_elems; i++) {
-            cfish_Obj *val = CFISH_VA_Fetch(varray, i);
+            cfish_Obj *val = CFISH_Vec_Fetch(varray, i);
             if (val == NULL) {
                 continue;
             }
@@ -808,7 +808,7 @@ cfish_Class_register_with_host(cfish_Class *singleton, cfish_Class *parent)
{
     LEAVE;
 }
 
-cfish_VArray*
+cfish_Vector*
 cfish_Class_fresh_host_methods(cfish_String *class_name) {
     dTHX;
     dSP;
@@ -820,7 +820,7 @@ cfish_Class_fresh_host_methods(cfish_String *class_name) {
     PUTBACK;
     call_pv("Clownfish::Class::_fresh_host_methods", G_SCALAR);
     SPAGAIN;
-    cfish_VArray *methods = (cfish_VArray*)XSBind_perl_to_cfish(aTHX_ POPs);
+    cfish_Vector *methods = (cfish_Vector*)XSBind_perl_to_cfish(aTHX_ POPs);
     PUTBACK;
     FREETMPS;
     LEAVE;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3fb61a74/runtime/perl/xs/XSBind.h
----------------------------------------------------------------------
diff --git a/runtime/perl/xs/XSBind.h b/runtime/perl/xs/XSBind.h
index 357af1e..b1c7b22 100644
--- a/runtime/perl/xs/XSBind.h
+++ b/runtime/perl/xs/XSBind.h
@@ -26,7 +26,7 @@
 #include "Clownfish/Err.h"
 #include "Clownfish/Hash.h"
 #include "Clownfish/Num.h"
-#include "Clownfish/VArray.h"
+#include "Clownfish/Vector.h"
 #include "Clownfish/Class.h"
 
 /* Avoid conflicts with Clownfish bool type. */
@@ -117,14 +117,14 @@ cfish_XSBind_cfish_obj_to_sv_noinc(pTHX_ cfish_Obj *obj) {
     cfish_XSBind_cfish_obj_to_sv_noinc(aTHX_ (cfish_Obj*)_obj)
 
 /** Deep conversion of Clownfish objects to Perl objects -- Strings to UTF-8
- * SVs, ByteBufs to SVs, VArrays to Perl array refs, Hashes to Perl hashrefs,
+ * SVs, ByteBufs to SVs, Vectors to Perl array refs, Hashes to Perl hashrefs,
  * and any other object to a Perl object wrapping the Clownfish Obj.
  */
 CFISH_VISIBLE SV*
 cfish_XSBind_cfish_to_perl(pTHX_ cfish_Obj *obj);
 
 /** Deep conversion of Perl data structures to Clownfish objects -- Perl hash
- * to Hash, Perl array to VArray, Clownfish objects stripped of their
+ * to Hash, Perl array to Vector, Clownfish objects stripped of their
  * wrappers, and everything else stringified and turned to a String.
  */
 CFISH_VISIBLE cfish_Obj*

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3fb61a74/runtime/ruby/ext/Bind.c
----------------------------------------------------------------------
diff --git a/runtime/ruby/ext/Bind.c b/runtime/ruby/ext/Bind.c
index e44737b..edf0fa9 100644
--- a/runtime/ruby/ext/Bind.c
+++ b/runtime/ruby/ext/Bind.c
@@ -24,8 +24,8 @@ Bind_cfish_to_ruby(cfish_Obj *obj) {
   if (CFISH_Obj_Is_A(obj, CFISH_STRING)) {
       return Bind_str_to_ruby((cfish_String*)obj);
   }
-  else if (CFISH_Obj_Is_A(obj, CFISH_VARRAY)) {
-      return S_cfish_array_to_ruby_array((cfish_VArray*)obj);
+  else if (CFISH_Obj_Is_A(obj, CFISH_VECTOR)) {
+      return S_cfish_array_to_ruby_array((cfish_Vector*)obj);
   }
 }
 
@@ -40,8 +40,8 @@ Bind_str_to_ruby(cfish_String *str) {
 }
 
 static VALUE
-S_cfish_array_to_ruby_array(cfish_VArray *varray) {
-    uint32_t num_elems = CFISH_VA_Get_Size(varray);
+S_cfish_array_to_ruby_array(cfish_Vector *varray) {
+    uint32_t num_elems = CFISH_Vec_Get_Size(varray);
 
     VALUE ruby_array = rb_ary_new2(num_elems - 1);
 
@@ -49,7 +49,7 @@ S_cfish_array_to_ruby_array(cfish_VArray *varray) {
         //TODO Need to determine why c99 mode is not being honored
         uint32_t i;
         for (uint32_t i = 0; i < num_elems; i++) {
-            cfish_Obj *val = CFISH_VA_Fetch(varray, i);
+            cfish_Obj *val = CFISH_Vec_Fetch(varray, i);
             if (val == NULL) {
                 continue;
             }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3fb61a74/runtime/ruby/ext/Bind.h
----------------------------------------------------------------------
diff --git a/runtime/ruby/ext/Bind.h b/runtime/ruby/ext/Bind.h
index 12a5ba3..c8d6c1c 100644
--- a/runtime/ruby/ext/Bind.h
+++ b/runtime/ruby/ext/Bind.h
@@ -31,12 +31,12 @@ extern "C" {
 #include "Clownfish/Err.h"
 #include "Clownfish/Hash.h"
 #include "Clownfish/Num.h"
-#include "Clownfish/VArray.h"
+#include "Clownfish/Vector.h"
 #include "Clownfish/Class.h"
 
 VALUE Bind_cfish_to_ruby(cfish_Obj *obj);
 VALUE Bind_str_to_ruby(cfish_String *str);
-static VALUE S_cfish_array_to_ruby_array(cfish_VArray *varray);
+static VALUE S_cfish_array_to_ruby_array(cfish_Vector *varray);
 
 #ifdef __cplusplus
 }


Mime
View raw message