lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r932808 - in /lucene/lucy/trunk/core/Lucy/Object: ByteBuf.bp ByteBuf.c
Date Sat, 10 Apr 2010 23:39:09 GMT
Author: marvin
Date: Sat Apr 10 23:39:09 2010
New Revision: 932808

URL: http://svn.apache.org/viewvc?rev=932808&view=rev
Log:
Give ByteBuf a Compare_To() method.  Give ViewByteBuf a separate init()
function.

Modified:
    lucene/lucy/trunk/core/Lucy/Object/ByteBuf.bp
    lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c

Modified: lucene/lucy/trunk/core/Lucy/Object/ByteBuf.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/ByteBuf.bp?rev=932808&r1=932807&r2=932808&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/ByteBuf.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Object/ByteBuf.bp Sat Apr 10 23:39:09 2010
@@ -89,6 +89,9 @@ class Lucy::Object::ByteBuf cnick BB ext
     bool_t
     Equals_Bytes(ByteBuf *self, const void *bytes, size_t size);
 
+    public int32_t
+    Compare_To(ByteBuf *self, Obj *other);
+
     public incremented ByteBuf*
     Clone(ByteBuf *self);
 
@@ -120,6 +123,9 @@ class Lucy::Object::ViewByteBuf cnick Vi
     inert incremented ViewByteBuf*
     new(char *buf, size_t size);
 
+    inert incremented ViewByteBuf*
+    init(ViewByteBuf *self, char *buf, size_t size);
+
     /** Assign buf and size members to the passed in values.
      */
     void

Modified: lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c?rev=932808&r1=932807&r2=932808&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c Sat Apr 10 23:39:09 2010
@@ -227,20 +227,28 @@ BB_compare(const void *va, const void *v
     return comparison;
 }
 
+int32_t
+BB_compare_to(ByteBuf *self, Obj *other)
+{
+    CERTIFY(other, BYTEBUF);
+    return BB_compare(&self, &other);
+}
+
 /******************************************************************/
 
 ViewByteBuf*
 ViewBB_new(char *buf, size_t size) 
 {
     ViewByteBuf *self = (ViewByteBuf*)VTable_Make_Obj(VIEWBYTEBUF);
+    return ViewBB_init(self, buf, size);
+}
 
-    // Init. 
-    self->cap = 0;
-
-    // Assign. 
+ViewByteBuf*
+ViewBB_init(ViewByteBuf *self, char *buf, size_t size) 
+{
+    self->cap  = 0;
     self->buf  = buf;
     self->size = size;
-    
     return self;
 }
 



Mime
View raw message