lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r930465 - in /lucene/lucy/trunk: clownfish/lib/Clownfish/Binding/Perl/ perl/lib/Lucy/Object/ perl/lib/Lucy/Store/ perl/lib/Lucy/Util/ perl/xs/
Date Sat, 03 Apr 2010 03:28:45 GMT
Author: marvin
Date: Sat Apr  3 03:28:43 2010
New Revision: 930465

URL: http://svn.apache.org/viewvc?rev=930465&view=rev
Log:
Switch over to stdint.h integer types for the Perl bindings.

Modified:
    lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/TypeMap.pm
    lucene/lucy/trunk/perl/lib/Lucy/Object/I32Array.pm
    lucene/lucy/trunk/perl/lib/Lucy/Object/VArray.pm
    lucene/lucy/trunk/perl/lib/Lucy/Store/FileHandle.pm
    lucene/lucy/trunk/perl/lib/Lucy/Util/IndexFileNames.pm
    lucene/lucy/trunk/perl/xs/XSBind.c
    lucene/lucy/trunk/perl/xs/XSBind.h

Modified: lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/TypeMap.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/TypeMap.pm?rev=930465&r1=930464&r2=930465&view=diff
==============================================================================
--- lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/TypeMap.pm (original)
+++ lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/TypeMap.pm Sat Apr  3 03:28:43
2010
@@ -206,6 +206,14 @@ sub _typemap_start {
 
 TYPEMAP
 chy_bool_t\tCHY_BOOL
+int8_t\tCHY_SIGNED_INT
+int16_t\tCHY_SIGNED_INT
+int32_t\tCHY_SIGNED_INT
+int64_t\tCHY_BIG_SIGNED_INT
+uint8_t\tCHY_UNSIGNED_INT
+uint16_t\tCHY_UNSIGNED_INT
+uint32_t\tCHY_UNSIGNED_INT
+uint64_t\tCHY_BIG_UNSIGNED_INT
 chy_i8_t\tCHY_SIGNED_INT
 chy_i16_t\tCHY_SIGNED_INT
 chy_i32_t\tCHY_SIGNED_INT

Modified: lucene/lucy/trunk/perl/lib/Lucy/Object/I32Array.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/lib/Lucy/Object/I32Array.pm?rev=930465&r1=930464&r2=930465&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/lib/Lucy/Object/I32Array.pm (original)
+++ lucene/lucy/trunk/perl/lib/Lucy/Object/I32Array.pm Sat Apr  3 03:28:43 2010
@@ -28,9 +28,9 @@ CODE:
     }
 
     if (ints_av && SvTYPE(ints_av) == SVt_PVAV) {
-        chy_i32_t size  = av_len(ints_av) + 1;
-        chy_i32_t *ints = (chy_i32_t*)LUCY_MALLOCATE(size * sizeof(chy_i32_t));
-        chy_i32_t i;
+        int32_t size  = av_len(ints_av) + 1;
+        int32_t *ints = (int32_t*)LUCY_MALLOCATE(size * sizeof(int32_t));
+        int32_t i;
 
         for (i = 0; i < size; i++) {
             SV **const sv_ptr = av_fetch(ints_av, i, 0);
@@ -55,12 +55,12 @@ to_arrayref(self)
 CODE:
 {
     AV *out_av = newAV();
-    chy_u32_t i;
-    chy_u32_t size = Lucy_I32Arr_Get_Size(self);
+    uint32_t i;
+    uint32_t size = Lucy_I32Arr_Get_Size(self);
 
     av_extend(out_av, size);
     for (i = 0; i < size; i++) {
-        chy_i32_t result = Lucy_I32Arr_Get(self, i);
+        int32_t result = Lucy_I32Arr_Get(self, i);
         SV* result_sv = result == -1 ? newSV(0) : newSViv(result);
         av_push(out_av, result_sv);
     }

Modified: lucene/lucy/trunk/perl/lib/Lucy/Object/VArray.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/lib/Lucy/Object/VArray.pm?rev=930465&r1=930464&r2=930465&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/lib/Lucy/Object/VArray.pm (original)
+++ lucene/lucy/trunk/perl/lib/Lucy/Object/VArray.pm Sat Apr  3 03:28:43 2010
@@ -50,7 +50,7 @@ OUTPUT: RETVAL
 SV*
 delete(self, tick)
     lucy_VArray *self;
-    chy_u32_t    tick;
+    uint32_t    tick;
 CODE:
     RETVAL = LUCY_OBJ_TO_SV_NOINC(Lucy_VA_Delete(self, tick));
 OUTPUT: RETVAL
@@ -58,7 +58,7 @@ OUTPUT: RETVAL
 void
 store(self, tick, value);
     lucy_VArray *self; 
-    chy_u32_t    tick;
+    uint32_t     tick;
     lucy_Obj    *value;
 PPCODE:
 {
@@ -69,7 +69,7 @@ PPCODE:
 SV*
 fetch(self, tick)
     lucy_VArray *self;
-    chy_u32_t    tick;
+    uint32_t     tick;
 CODE:
     RETVAL = LUCY_OBJ_TO_SV(Lucy_VA_Fetch(self, tick));
 OUTPUT: RETVAL

Modified: lucene/lucy/trunk/perl/lib/Lucy/Store/FileHandle.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/lib/Lucy/Store/FileHandle.pm?rev=930465&r1=930464&r2=930465&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/lib/Lucy/Store/FileHandle.pm (original)
+++ lucene/lucy/trunk/perl/lib/Lucy/Store/FileHandle.pm Sat Apr  3 03:28:43 2010
@@ -10,32 +10,32 @@ __BINDING__
 my $xs_code = <<'END_XS_CODE';
 MODULE = Lucy     PACKAGE = Lucy::Store::FileHandle
 
-chy_u32_t
+uint32_t
 FH_READ_ONLY()
 CODE:
     RETVAL = LUCY_FH_READ_ONLY;
 OUTPUT: RETVAL
 
-chy_u32_t
+uint32_t
 FH_WRITE_ONLY()
 CODE:
     RETVAL = LUCY_FH_WRITE_ONLY;
 OUTPUT: RETVAL
 
-chy_u32_t
+uint32_t
 FH_CREATE()
 CODE:
     RETVAL = LUCY_FH_CREATE;
 OUTPUT: RETVAL
 
-chy_u32_t
+uint32_t
 FH_EXCLUSIVE()
 CODE:
     RETVAL = LUCY_FH_EXCLUSIVE;
 OUTPUT: RETVAL
 
 
-chy_i32_t
+int32_t
 object_count()
 CODE:
     RETVAL = lucy_FH_object_count;

Modified: lucene/lucy/trunk/perl/lib/Lucy/Util/IndexFileNames.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/lib/Lucy/Util/IndexFileNames.pm?rev=930465&r1=930464&r2=930465&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/lib/Lucy/Util/IndexFileNames.pm (original)
+++ lucene/lucy/trunk/perl/lib/Lucy/Util/IndexFileNames.pm Sat Apr  3 03:28:43 2010
@@ -10,7 +10,7 @@ __BINDING__
 my $xs_code = <<'END_XS_CODE';
 MODULE = Lucy   PACKAGE = Lucy::Util::IndexFileNames
 
-chy_u64_t
+uint64_t
 extract_gen(name)
     const lucy_CharBuf *name;
 CODE:

Modified: lucene/lucy/trunk/perl/xs/XSBind.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/xs/XSBind.c?rev=930465&r1=930464&r2=930465&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/xs/XSBind.c (original)
+++ lucene/lucy/trunk/perl/xs/XSBind.c Sat Apr  3 03:28:43 2010
@@ -134,15 +134,15 @@ XSBind_lucy_to_perl(lucy_Obj *obj)
         return newSVnv(Lucy_Obj_To_F64(obj));
     }
     else if (sizeof(IV) == 8 && Lucy_Obj_Is_A(obj, LUCY_INTNUM)) {
-        chy_i64_t num = Lucy_Obj_To_I64(obj);
+        int64_t num = Lucy_Obj_To_I64(obj);
         return newSViv((IV)num);
     }
     else if (sizeof(IV) == 4 && Lucy_Obj_Is_A(obj, LUCY_INTEGER32)) {
-        chy_i32_t num = (chy_i32_t)Lucy_Obj_To_I64(obj);
+        int32_t num = (int32_t)Lucy_Obj_To_I64(obj);
         return newSViv((IV)num);
     }
     else if (sizeof(IV) == 4 && Lucy_Obj_Is_A(obj, LUCY_INTEGER64)) {
-        chy_i64_t num = Lucy_Obj_To_I64(obj);
+        int64_t num = Lucy_Obj_To_I64(obj);
         return newSVnv((double)num); /* lossy */
     }
     else {
@@ -219,7 +219,7 @@ XSBind_cb_to_sv(const lucy_CharBuf *cb) 
 static lucy_Hash*
 S_perl_hash_to_lucy_hash(HV *phash)
 {
-    chy_u32_t  num_keys = hv_iterinit(phash);
+    uint32_t  num_keys = hv_iterinit(phash);
     lucy_Hash *retval   = lucy_Hash_new(num_keys);
 
     while (num_keys--) {
@@ -249,9 +249,9 @@ S_perl_hash_to_lucy_hash(HV *phash)
 static lucy_VArray*
 S_perl_array_to_lucy_array(AV *parray)
 {
-    const chy_u32_t size = av_len(parray) + 1;
+    const uint32_t size = av_len(parray) + 1;
     lucy_VArray *retval = lucy_VA_new(size);
-    chy_u32_t i;
+    uint32_t i;
 
     /* Iterate over array elems. */
     for (i = 0; i < size; i++) {
@@ -270,11 +270,11 @@ static SV*
 S_lucy_array_to_perl_array(lucy_VArray *varray)
 {
     AV *perl_array = newAV();
-    chy_u32_t num_elems = Lucy_VA_Get_Size(varray);
+    uint32_t num_elems = Lucy_VA_Get_Size(varray);
 
     /* Iterate over array elems. */
     if (num_elems) {
-        chy_u32_t i;
+        uint32_t i;
         av_fill(perl_array, num_elems - 1);
         for (i = 0; i < num_elems; i++) {
             lucy_Obj *val = Lucy_VA_Fetch(varray, i);
@@ -369,14 +369,14 @@ XSBind_enable_overload(void *pobj)
 }
 
 void
-XSBind_allot_params(SV** stack, chy_i32_t start, chy_i32_t num_stack_elems, 
+XSBind_allot_params(SV** stack, int32_t start, int32_t num_stack_elems, 
                     char* params_hash_name, ...)
 {
     va_list args;
     HV *params_hash = get_hv(params_hash_name, 0);
     SV **target;
-    chy_i32_t i;
-    chy_i32_t args_left = (num_stack_elems - start) / 2;
+    int32_t i;
+    int32_t args_left = (num_stack_elems - start) / 2;
 
     /* Retrieve the params hash, which must be a package global. */
     if (params_hash == NULL) {
@@ -407,7 +407,7 @@ XSBind_allot_params(SV** stack, chy_i32_
         /* Iterate through stack looking for a label match. Work backwards so
          * that if the label is doubled up we get the last one. */
         for (i = num_stack_elems; i >= start + 2; i -= 2) {
-            chy_i32_t tick = i - 2;
+            int32_t tick = i - 2;
             SV *const key_sv = stack[tick];
             if (SvCUR(key_sv) == (STRLEN)label_len) {
                 if (memcmp(SvPVX(key_sv), label, label_len) == 0) {

Modified: lucene/lucy/trunk/perl/xs/XSBind.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/xs/XSBind.h?rev=930465&r1=930464&r2=930465&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/xs/XSBind.h (original)
+++ lucene/lucy/trunk/perl/xs/XSBind.h Sat Apr  3 03:28:43 2010
@@ -150,8 +150,8 @@ lucy_XSBind_enable_overload(void *pobj);
  * labels which are not present in this hash will trigger an exception.
  */
 void
-lucy_XSBind_allot_params(SV** stack, chy_i32_t start, 
-                         chy_i32_t num_stack_elems, 
+lucy_XSBind_allot_params(SV** stack, int32_t start, 
+                         int32_t num_stack_elems, 
                          char* params_hash_name, ...);
 
 /* Define short names for all the functions in this file.  Note that these



Mime
View raw message