lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [1/3] lucy git commit: Cease using refcount method API.
Date Fri, 13 Feb 2015 21:46:14 GMT
Repository: lucy
Updated Branches:
  refs/heads/master 2b8601a7a -> d52bb268e


Cease using refcount method API.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/9776399a
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/9776399a
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/9776399a

Branch: refs/heads/master
Commit: 9776399a9d7e03269520989c45c2bbfeb474e233
Parents: 2b8601a
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Sun Feb 8 21:59:59 2015 -0800
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Sun Feb 8 21:59:59 2015 -0800

----------------------------------------------------------------------
 core/Lucy/Test/Store/TestRAMDirHandle.c |  4 ++--
 core/Lucy/Util/Freezer.c                | 10 +++-------
 2 files changed, 5 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/9776399a/core/Lucy/Test/Store/TestRAMDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMDirHandle.c b/core/Lucy/Test/Store/TestRAMDirHandle.c
index b4e2077..22b1dff 100644
--- a/core/Lucy/Test/Store/TestRAMDirHandle.c
+++ b/core/Lucy/Test/Store/TestRAMDirHandle.c
@@ -73,9 +73,9 @@ test_all(TestBatchRunner *runner) {
     TEST_FALSE(runner, boffo_was_dir,
                "File correctly identified by Entry_Is_Dir");
 
-    uint32_t refcount = RAMFolder_Get_RefCount(folder);
+    uint32_t refcount = REFCOUNT_NN(folder);
     RAMDH_Close(dh);
-    TEST_INT_EQ(runner, RAMFolder_Get_RefCount(folder), refcount - 1,
+    TEST_INT_EQ(runner, REFCOUNT_NN(folder), refcount - 1,
                 "Folder reference released by Close()");
 
     DECREF(dh);

http://git-wip-us.apache.org/repos/asf/lucy/blob/9776399a/core/Lucy/Util/Freezer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Freezer.c b/core/Lucy/Util/Freezer.c
index 8ad41e5..b491d59 100644
--- a/core/Lucy/Util/Freezer.c
+++ b/core/Lucy/Util/Freezer.c
@@ -139,13 +139,9 @@ Freezer_deserialize(Obj *obj, InStream *instream) {
         if (Obj_Is_A(obj, INTNUM)) {
             if (Obj_Is_A(obj, BOOLNUM)) {
                 bool value = !!InStream_Read_U8(instream);
-                BoolNum *self = (BoolNum*)obj;
-                if (self && self != CFISH_TRUE && self != CFISH_FALSE) {
-                    Bool_Dec_RefCount_t super_decref
-                        = SUPER_METHOD_PTR(BOOLNUM, CFISH_Bool_Dec_RefCount);
-                    super_decref(self);
-                }
-                obj = value ? (Obj*)CFISH_TRUE : (Obj*)CFISH_FALSE;
+                Obj *result = value ? INCREF(CFISH_TRUE) : INCREF(CFISH_FALSE);
+                DECREF(obj);
+                obj = result;
             }
             else if (Obj_Is_A(obj, INTEGER32)) {
                 int32_t value = (int32_t)InStream_Read_C32(instream);


Mime
View raw message