lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r930457 - in /lucene/lucy/trunk/core/Lucy/Index: Segment.bp Segment.c Snapshot.bp Snapshot.c
Date Sat, 03 Apr 2010 01:52:29 GMT
Author: marvin
Date: Sat Apr  3 01:52:28 2010
New Revision: 930457

URL: http://svn.apache.org/viewvc?rev=930457&view=rev
Log:
Switch over core/Lucy/Index to stdint.h integer types.

Modified:
    lucene/lucy/trunk/core/Lucy/Index/Segment.bp
    lucene/lucy/trunk/core/Lucy/Index/Segment.c
    lucene/lucy/trunk/core/Lucy/Index/Snapshot.bp
    lucene/lucy/trunk/core/Lucy/Index/Snapshot.c

Modified: lucene/lucy/trunk/core/Lucy/Index/Segment.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Index/Segment.bp?rev=930457&r1=930456&r2=930457&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Index/Segment.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Index/Segment.bp Sat Apr  3 01:52:28 2010
@@ -18,22 +18,22 @@ parcel Lucy;
 class Lucy::Index::Segment cnick Seg extends Lucy::Object::Obj {
 
     CharBuf     *name;
-    i64_t        count;
-    i64_t        number;
+    int64_t      count;
+    int64_t      number;
     Hash        *by_name;   /* field numbers by name */
     VArray      *by_num;    /* field names by num */
     Hash        *metadata;
 
     inert incremented Segment*
-    new(i64_t number);
+    new(int64_t number);
 
     public inert Segment*
-    init(Segment *self, i64_t number);
+    init(Segment *self, int64_t number);
 
     /** Return a segment name with a base-36-encoded segment number. 
      */
     inert incremented CharBuf*
-    num_to_name(i64_t number);
+    num_to_name(int64_t number);
 
     /** Return true if the CharBuf is a segment name, i.e. matches this
      * pattern:  /^seg_\w+$/
@@ -47,7 +47,7 @@ class Lucy::Index::Segment cnick Seg ext
      * @param field Field name.
      * @return the field's field number, which is a positive integer.
      */
-    public i32_t
+    public int32_t
     Add_Field(Segment *self, const CharBuf *field);
 
     /** Store arbitrary information in the segment's metadata Hash, to be
@@ -78,14 +78,14 @@ class Lucy::Index::Segment cnick Seg ext
      * 
      * @param field Field name.
      */
-    public i32_t
+    public int32_t
     Field_Num(Segment *self, const CharBuf *field);
 
     /** Given a field number, return the name of its field, or NULL if the
      * field name can't be found.
      */
     public nullable CharBuf*
-    Field_Name(Segment *self, i32_t field_num);
+    Field_Name(Segment *self, int32_t field_num);
 
     /** Getter for the object's seg name.
      */
@@ -94,24 +94,24 @@ class Lucy::Index::Segment cnick Seg ext
 
     /** Getter for the segment number. 
      */
-    public i64_t
+    public int64_t
     Get_Number(Segment *self);
 
     /** Setter for the object's document count.
      */
     public void
-    Set_Count(Segment *self, i64_t count);
+    Set_Count(Segment *self, int64_t count);
 
     /** Getter for the object's document count.
      */
-    public i64_t 
+    public int64_t 
     Get_Count(Segment *self);
 
     /** Add <code>increment</code> to the object's document count, then return
      * the new, modified total.
      */
-    i64_t
-    Increment_Count(Segment *self, i64_t increment);
+    int64_t
+    Increment_Count(Segment *self, int64_t increment);
 
     /** Get the segment metadata.
      */

Modified: lucene/lucy/trunk/core/Lucy/Index/Segment.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Index/Segment.c?rev=930457&r1=930456&r2=930457&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Index/Segment.c (original)
+++ lucene/lucy/trunk/core/Lucy/Index/Segment.c Sat Apr  3 01:52:28 2010
@@ -10,14 +10,14 @@
 #include "Lucy/Util/IndexFileNames.h"
 
 Segment*
-Seg_new(i64_t number)
+Seg_new(int64_t number)
 {
     Segment *self = (Segment*)VTable_Make_Obj(SEGMENT);
     return Seg_init(self, number);
 }
 
 Segment*
-Seg_init(Segment *self, i64_t number)
+Seg_init(Segment *self, int64_t number)
 {
     /* Validate. */
     if (number < 0) { THROW(ERR, "Segment number %i64 less than 0", number); }
@@ -41,7 +41,7 @@ Seg_init(Segment *self, i64_t number)
 }
 
 CharBuf*
-Seg_num_to_name(i64_t number)
+Seg_num_to_name(int64_t number)
 {
     char base36[StrHelp_MAX_BASE36_BYTES];
     StrHelp_to_base36(number, &base36);
@@ -102,10 +102,10 @@ Seg_read_file(Segment *self, Folder *fol
 
     /* Get list of field nums. */
     {
-        u32_t i;
+        uint32_t i;
         VArray *source_by_num = (VArray*)Hash_Fetch_Str(my_metadata, 
             "field_names", 11);
-        u32_t num_fields = source_by_num ? VA_Get_Size(source_by_num) : 0;
+        uint32_t num_fields = source_by_num ? VA_Get_Size(source_by_num) : 0;
         if (source_by_num == NULL) {
             THROW(ERR, "Failed to extract 'field_names' from metadata");
         }
@@ -148,7 +148,7 @@ Seg_write_file(Segment *self, Folder *fo
     }
 }
 
-i32_t 
+int32_t 
 Seg_add_field(Segment *self, const CharBuf *field)
 {
     Integer32 *num = (Integer32*)Hash_Fetch(self->by_name, (Obj*)field);
@@ -156,7 +156,7 @@ Seg_add_field(Segment *self, const CharB
         return Int32_Get_Value(num);
     }
     else {
-        i32_t field_num = VA_Get_Size(self->by_num);
+        int32_t field_num = VA_Get_Size(self->by_num);
         Hash_Store(self->by_name, (Obj*)field, (Obj*)Int32_new(field_num));
         VA_Push(self->by_num, (Obj*)CB_Clone(field));
         return field_num;
@@ -165,15 +165,15 @@ Seg_add_field(Segment *self, const CharB
 
 CharBuf*
 Seg_get_name(Segment *self)               { return self->name; }
-i64_t
+int64_t
 Seg_get_number(Segment *self)             { return self->number; }
 void
-Seg_set_count(Segment *self, i64_t count) { self->count = count; }
-i64_t
+Seg_set_count(Segment *self, int64_t count) { self->count = count; }
+int64_t
 Seg_get_count(Segment *self)              { return self->count; }
 
-i64_t
-Seg_increment_count(Segment *self, i64_t increment) 
+int64_t
+Seg_increment_count(Segment *self, int64_t increment) 
 { 
    self->count += increment;
    return self->count;
@@ -221,14 +221,14 @@ Seg_compare_to(Segment *self, Obj *other
 }
 
 CharBuf*
-Seg_field_name(Segment *self, i32_t field_num)
+Seg_field_name(Segment *self, int32_t field_num)
 {
      return field_num 
         ? (CharBuf*)VA_Fetch(self->by_num, field_num)
         : NULL;
 }
 
-i32_t
+int32_t
 Seg_field_num(Segment *self, const CharBuf *field)
 {
     if (field == NULL) {

Modified: lucene/lucy/trunk/core/Lucy/Index/Snapshot.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Index/Snapshot.bp?rev=930457&r1=930456&r2=930457&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Index/Snapshot.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Index/Snapshot.bp Sat Apr  3 01:52:28 2010
@@ -14,7 +14,7 @@ class Lucy::Index::Snapshot extends Lucy
     Hash        *entries;
     CharBuf     *filename;
 
-    inert i32_t current_file_format;
+    inert int32_t current_file_format;
 
     public inert incremented Snapshot* 
     new();
@@ -32,7 +32,7 @@ class Lucy::Index::Snapshot extends Lucy
 
     /** Return the number of entries (including directories).
      */
-    public u32_t
+    public uint32_t
     Num_Entries(Snapshot *self);
 
 

Modified: lucene/lucy/trunk/core/Lucy/Index/Snapshot.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Index/Snapshot.c?rev=930457&r1=930456&r2=930457&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Index/Snapshot.c (original)
+++ lucene/lucy/trunk/core/Lucy/Index/Snapshot.c Sat Apr  3 01:52:28 2010
@@ -4,7 +4,7 @@
 #include "Lucy/Index/Snapshot.h"
 #include "Lucy/Util/StringHelper.h"
 
-i32_t Snapshot_current_file_format = 1;
+int32_t Snapshot_current_file_format = 1;
 
 Snapshot*
 Snapshot_new()
@@ -61,7 +61,7 @@ Snapshot_list(Snapshot *self) { 
     return Hash_Keys(self->entries); 
 }
 
-u32_t
+uint32_t
 Snapshot_num_entries(Snapshot *self) { return Hash_Get_Size(self->entries); }
 
 void



Mime
View raw message