You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2013/08/09 04:15:05 UTC

[lucy-commits] [1/7] git commit: refs/heads/method-imp-names - Transition Clownfish TestHarness to _IMP.

Updated Branches:
  refs/heads/method-imp-names 16706b1ed -> e797381d7


Transition Clownfish TestHarness to _IMP.


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

Branch: refs/heads/method-imp-names
Commit: a7ef5bc1dfdad538df78f711ff185c0db2d218e3
Parents: 16706b1
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Thu Aug 8 15:13:22 2013 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Thu Aug 8 15:22:23 2013 -0700

----------------------------------------------------------------------
 .../Clownfish/TestHarness/TestBatchRunner.c     | 52 ++++++++++----------
 .../core/Clownfish/TestHarness/TestFormatter.c  | 38 +++++++-------
 .../core/Clownfish/TestHarness/TestSuite.c      |  8 +--
 .../Clownfish/TestHarness/TestSuiteRunner.c     | 14 +++---
 4 files changed, 56 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/a7ef5bc1/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.c b/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.c
index a2e7a5c..bccf6fc 100644
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.c
+++ b/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.c
@@ -64,13 +64,13 @@ TestBatchRunner_init(TestBatchRunner *self, TestFormatter *formatter) {
 }
 
 void
-TestBatchRunner_destroy(TestBatchRunner *self) {
+TestBatchRunner_Destroy_IMP(TestBatchRunner *self) {
     DECREF(self->formatter);
     SUPER_DESTROY(self, TESTBATCHRUNNER);
 }
 
 bool
-TestBatchRunner_run_batch(TestBatchRunner *self, TestBatch *batch) {
+TestBatchRunner_Run_Batch_IMP(TestBatchRunner *self, TestBatch *batch) {
     struct try_run_tests_context args;
     args.runner = self;
     args.batch  = batch;
@@ -107,24 +107,24 @@ S_try_run_tests(void *context) {
 }
 
 void
-TestBatchRunner_plan(TestBatchRunner *self, TestBatch *batch,
-                     uint32_t num_planned) {
+TestBatchRunner_Plan_IMP(TestBatchRunner *self, TestBatch *batch,
+                         uint32_t num_planned) {
     self->num_planned = num_planned;
     TestFormatter_Batch_Prologue(self->formatter, batch, num_planned);
 }
 
 uint32_t
-TestBatchRunner_get_num_planned(TestBatchRunner *self) {
+TestBatchRunner_Get_Num_Planned_IMP(TestBatchRunner *self) {
     return self->num_planned;
 }
 
 uint32_t
-TestBatchRunner_get_num_tests(TestBatchRunner *self) {
+TestBatchRunner_Get_Num_Tests_IMP(TestBatchRunner *self) {
     return self->test_num;
 }
 
 uint32_t
-TestBatchRunner_get_num_failed(TestBatchRunner *self) {
+TestBatchRunner_Get_Num_Failed_IMP(TestBatchRunner *self) {
     return self->num_failed;
 }
 
@@ -209,21 +209,21 @@ TestBatchRunner_skip(TestBatchRunner *self, const char *pattern, ...) {
 }
 
 bool
-TestBatchRunner_vtest_true(TestBatchRunner *self, bool condition,
-                           const char *pattern, va_list args) {
+TestBatchRunner_VTest_True_IMP(TestBatchRunner *self, bool condition,
+                               const char *pattern, va_list args) {
     return S_vtest_true(self, condition, pattern, args);
 }
 
 bool
-TestBatchRunner_vtest_false(TestBatchRunner *self, bool condition,
-                            const char *pattern, va_list args) {
+TestBatchRunner_VTest_False_IMP(TestBatchRunner *self, bool condition,
+                                const char *pattern, va_list args) {
     return S_vtest_true(self, !condition, pattern, args);
 }
 
 bool
-TestBatchRunner_vtest_int_equals(TestBatchRunner *self, long got,
-                                 long expected, const char *pattern,
-                                 va_list args) {
+TestBatchRunner_VTest_Int_Equals_IMP(TestBatchRunner *self, long got,
+                                     long expected, const char *pattern,
+                                     va_list args) {
     bool pass = (got == expected);
     S_vtest_true(self, pass, pattern, args);
     if (!pass) {
@@ -235,9 +235,9 @@ TestBatchRunner_vtest_int_equals(TestBatchRunner *self, long got,
 }
 
 bool
-TestBatchRunner_vtest_float_equals(TestBatchRunner *self, double got,
-                                   double expected, const char *pattern,
-                                   va_list args) {
+TestBatchRunner_VTest_Float_Equals_IMP(TestBatchRunner *self, double got,
+                                       double expected, const char *pattern,
+                                       va_list args) {
     double relative_error = got / expected - 1.0;
     bool   pass           = (fabs(relative_error) < 1e-6);
     S_vtest_true(self, pass, pattern, args);
@@ -250,9 +250,9 @@ TestBatchRunner_vtest_float_equals(TestBatchRunner *self, double got,
 }
 
 bool
-TestBatchRunner_vtest_string_equals(TestBatchRunner *self, const char *got,
-                                    const char *expected, const char *pattern,
-                                    va_list args) {
+TestBatchRunner_VTest_String_Equals_IMP(TestBatchRunner *self, const char *got,
+                                        const char *expected,
+                                        const char *pattern, va_list args) {
     bool pass = (strcmp(got, expected) == 0);
     S_vtest_true(self, pass, pattern, args);
     if (!pass) {
@@ -264,20 +264,20 @@ TestBatchRunner_vtest_string_equals(TestBatchRunner *self, const char *got,
 }
 
 bool
-TestBatchRunner_vpass(TestBatchRunner *self, const char *pattern,
-                      va_list args) {
+TestBatchRunner_VPass_IMP(TestBatchRunner *self, const char *pattern,
+                          va_list args) {
     return S_vtest_true(self, true, pattern, args);
 }
 
 bool
-TestBatchRunner_vfail(TestBatchRunner *self, const char *pattern,
-                      va_list args) {
+TestBatchRunner_VFail_IMP(TestBatchRunner *self, const char *pattern,
+                          va_list args) {
     return S_vtest_true(self, false, pattern, args);
 }
 
 void
-TestBatchRunner_vskip(TestBatchRunner *self, const char *pattern,
-                      va_list args) {
+TestBatchRunner_VSkip_IMP(TestBatchRunner *self, const char *pattern,
+                          va_list args) {
     self->test_num++;
     // TODO: Add a VTest_Skip method to TestFormatter
     TestFormatter_VTest_Result(self->formatter, true, self->test_num,

http://git-wip-us.apache.org/repos/asf/lucy/blob/a7ef5bc1/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c b/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c
index 3d9facd..e322539 100644
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c
+++ b/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c
@@ -72,17 +72,17 @@ TestFormatterCF_init(TestFormatterCF *self) {
 }
 
 void
-TestFormatterCF_batch_prologue(TestFormatterCF *self, TestBatch *batch,
-                               uint32_t num_planned) {
+TestFormatterCF_Batch_Prologue_IMP(TestFormatterCF *self, TestBatch *batch,
+                                   uint32_t num_planned) {
     UNUSED_VAR(self);
     CharBuf *class_name = TestBatch_Get_Class_Name(batch);
     printf("Running %s...\n", CB_Get_Ptr8(class_name));
 }
 
 void
-TestFormatterCF_vtest_result(TestFormatterCF *self, bool pass,
-                             uint32_t test_num, const char *fmt,
-                             va_list args) {
+TestFormatterCF_VTest_Result_IMP(TestFormatterCF *self, bool pass,
+                                 uint32_t test_num, const char *fmt,
+                                 va_list args) {
     UNUSED_VAR(self);
     if (!pass) {
         printf("  Failed test %u: ", test_num);
@@ -92,23 +92,23 @@ TestFormatterCF_vtest_result(TestFormatterCF *self, bool pass,
 }
 
 void
-TestFormatterCF_vtest_comment(TestFormatterCF *self, const char *fmt,
-                              va_list args) {
+TestFormatterCF_VTest_Comment_IMP(TestFormatterCF *self, const char *fmt,
+                                  va_list args) {
     UNUSED_VAR(self);
     printf("    ");
     vprintf(fmt, args);
 }
 
 void
-TestFormatterCF_vbatch_comment(TestFormatterCF *self, const char *fmt,
-                               va_list args) {
+TestFormatterCF_VBatch_Comment_IMP(TestFormatterCF *self, const char *fmt,
+                                   va_list args) {
     UNUSED_VAR(self);
     printf("  ");
     vprintf(fmt, args);
 }
 
 void
-TestFormatterCF_summary(TestFormatterCF *self, TestSuiteRunner *runner) {
+TestFormatterCF_Summary_IMP(TestFormatterCF *self, TestSuiteRunner *runner) {
     UNUSED_VAR(self);
     uint32_t num_batches = TestSuiteRunner_Get_Num_Batches(runner);
     uint32_t num_batches_failed
@@ -144,16 +144,16 @@ TestFormatterTAP_init(TestFormatterTAP *self) {
 }
 
 void
-TestFormatterTAP_batch_prologue(TestFormatterTAP *self, TestBatch *batch,
+TestFormatterTAP_Batch_Prologue_IMP(TestFormatterTAP *self, TestBatch *batch,
                                 uint32_t num_planned) {
     UNUSED_VAR(self);
     printf("1..%u\n", num_planned);
 }
 
 void
-TestFormatterTAP_vtest_result(TestFormatterTAP *self, bool pass,
-                              uint32_t test_num, const char *fmt,
-                              va_list args) {
+TestFormatterTAP_VTest_Result_IMP(TestFormatterTAP *self, bool pass,
+                                  uint32_t test_num, const char *fmt,
+                                  va_list args) {
     UNUSED_VAR(self);
     const char *result = pass ? "ok" : "not ok";
     printf("%s %u - ", result, test_num);
@@ -162,23 +162,23 @@ TestFormatterTAP_vtest_result(TestFormatterTAP *self, bool pass,
 }
 
 void
-TestFormatterTAP_vtest_comment(TestFormatterTAP *self, const char *fmt,
-                               va_list args) {
+TestFormatterTAP_VTest_Comment_IMP(TestFormatterTAP *self, const char *fmt,
+                                   va_list args) {
     UNUSED_VAR(self);
     printf("#   ");
     vprintf(fmt, args);
 }
 
 void
-TestFormatterTAP_vbatch_comment(TestFormatterTAP *self, const char *fmt,
-                                va_list args) {
+TestFormatterTAP_VBatch_Comment_IMP(TestFormatterTAP *self, const char *fmt,
+                                    va_list args) {
     UNUSED_VAR(self);
     printf("# ");
     vprintf(fmt, args);
 }
 
 void
-TestFormatterTAP_summary(TestFormatterTAP *self, TestSuiteRunner *runner) {
+TestFormatterTAP_Summary_IMP(TestFormatterTAP *self, TestSuiteRunner *runner) {
     UNUSED_VAR(self);
     UNUSED_VAR(runner);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/a7ef5bc1/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.c b/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.c
index 8ef8eb4..57131e6 100644
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.c
+++ b/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.c
@@ -48,18 +48,18 @@ TestSuite_init(TestSuite *self) {
 }
 
 void
-TestSuite_destroy(TestSuite *self) {
+TestSuite_Destroy_IMP(TestSuite *self) {
     DECREF(self->batches);
     SUPER_DESTROY(self, TESTSUITE);
 }
 
 void
-TestSuite_add_batch(TestSuite *self, TestBatch *batch) {
+TestSuite_Add_Batch_IMP(TestSuite *self, TestBatch *batch) {
     VA_Push(self->batches, (Obj*)batch);
 }
 
 bool
-TestSuite_run_batch(TestSuite *self, CharBuf *class_name,
+TestSuite_Run_Batch_IMP(TestSuite *self, CharBuf *class_name,
                     TestFormatter *formatter) {
     S_unbuffer_stdout();
 
@@ -81,7 +81,7 @@ TestSuite_run_batch(TestSuite *self, CharBuf *class_name,
 }
 
 bool
-TestSuite_run_all_batches(TestSuite *self, TestFormatter *formatter) {
+TestSuite_Run_All_Batches_IMP(TestSuite *self, TestFormatter *formatter) {
     S_unbuffer_stdout();
 
     TestSuiteRunner *runner = TestSuiteRunner_new(formatter);

http://git-wip-us.apache.org/repos/asf/lucy/blob/a7ef5bc1/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c b/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c
index 5949fb6..64be5bd 100644
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c
+++ b/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c
@@ -44,13 +44,13 @@ TestSuiteRunner_init(TestSuiteRunner *self, TestFormatter *formatter) {
 }
 
 void
-TestSuiteRunner_destroy(TestSuiteRunner *self) {
+TestSuiteRunner_Destroy_IMP(TestSuiteRunner *self) {
     DECREF(self->formatter);
     SUPER_DESTROY(self, TESTSUITERUNNER);
 }
 
 bool
-TestSuiteRunner_run_batch(TestSuiteRunner *self, TestBatch *batch) {
+TestSuiteRunner_Run_Batch_IMP(TestSuiteRunner *self, TestBatch *batch) {
     TestBatchRunner *batch_runner = TestBatchRunner_new(self->formatter);
     bool success = TestBatchRunner_Run_Batch(batch_runner, batch);
 
@@ -67,29 +67,29 @@ TestSuiteRunner_run_batch(TestSuiteRunner *self, TestBatch *batch) {
 }
 
 bool
-TestSuiteRunner_finish(TestSuiteRunner *self) {
+TestSuiteRunner_Finish_IMP(TestSuiteRunner *self) {
     TestFormatter_Summary(self->formatter, self);
 
     return self->num_batches != 0 && self->num_batches_failed == 0;
 }
 
 uint32_t
-TestSuiteRunner_get_num_tests(TestSuiteRunner *self) {
+TestSuiteRunner_Get_Num_Tests_IMP(TestSuiteRunner *self) {
     return self->num_tests;
 }
 
 uint32_t
-TestSuiteRunner_get_num_tests_failed(TestSuiteRunner *self) {
+TestSuiteRunner_Get_Num_Tests_Failed_IMP(TestSuiteRunner *self) {
     return self->num_tests_failed;
 }
 
 uint32_t
-TestSuiteRunner_get_num_batches(TestSuiteRunner *self) {
+TestSuiteRunner_Get_Num_Batches_IMP(TestSuiteRunner *self) {
     return self->num_batches;
 }
 
 uint32_t
-TestSuiteRunner_get_num_batches_failed(TestSuiteRunner *self) {
+TestSuiteRunner_Get_Num_Batches_Failed_IMP(TestSuiteRunner *self) {
     return self->num_batches_failed;
 }
 


[lucy-commits] [2/7] git commit: refs/heads/method-imp-names - Migrate Clownfish runtime unit tests to _IMP.

Posted by ma...@apache.org.
Migrate Clownfish runtime unit tests to _IMP.


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

Branch: refs/heads/method-imp-names
Commit: e8e6b88655bca86dc05b2f308142b8a907be8a9a
Parents: a7ef5bc
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Thu Aug 8 15:52:32 2013 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Thu Aug 8 18:29:12 2013 -0700

----------------------------------------------------------------------
 clownfish/runtime/core/Clownfish/Test/TestByteBuf.c           | 2 +-
 clownfish/runtime/core/Clownfish/Test/TestCharBuf.c           | 2 +-
 clownfish/runtime/core/Clownfish/Test/TestErr.c               | 2 +-
 clownfish/runtime/core/Clownfish/Test/TestHash.c              | 2 +-
 clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c  | 4 ++--
 clownfish/runtime/core/Clownfish/Test/TestNum.c               | 2 +-
 clownfish/runtime/core/Clownfish/Test/TestObj.c               | 2 +-
 clownfish/runtime/core/Clownfish/Test/TestVArray.c            | 2 +-
 clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c       | 2 +-
 clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c       | 2 +-
 clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c  | 2 +-
 clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c | 2 +-
 12 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/e8e6b886/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c b/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c
index 159a8db..dcea3b5 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c
@@ -143,7 +143,7 @@ test_Cat(TestBatchRunner *runner) {
 }
 
 void
-TestBB_run(TestByteBuf *self, TestBatchRunner *runner) {
+TestBB_Run_IMP(TestByteBuf *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 21);
     test_Equals(runner);
     test_Grow(runner);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e8e6b886/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c b/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c
index 5b2fdf4..234c691 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c
@@ -395,7 +395,7 @@ test_vcatf_x32(TestBatchRunner *runner) {
 }
 
 void
-TestCB_run(TestCharBuf *self, TestBatchRunner *runner) {
+TestCB_Run_IMP(TestCharBuf *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 54);
     test_vcatf_s(runner);
     test_vcatf_null_string(runner);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e8e6b886/clownfish/runtime/core/Clownfish/Test/TestErr.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestErr.c b/clownfish/runtime/core/Clownfish/Test/TestErr.c
index ddf0457..bc4f434 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestErr.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestErr.c
@@ -42,7 +42,7 @@ test_To_String(TestBatchRunner *runner) {
 }
 
 void
-TestErr_run(TestErr *self, TestBatchRunner *runner) {
+TestErr_Run_IMP(TestErr *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 1);
     test_To_String(runner);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/e8e6b886/clownfish/runtime/core/Clownfish/Test/TestHash.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestHash.c b/clownfish/runtime/core/Clownfish/Test/TestHash.c
index abd7617..9d70ca2 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestHash.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestHash.c
@@ -221,7 +221,7 @@ test_stress(TestBatchRunner *runner) {
 }
 
 void
-TestHash_run(TestHash *self, TestBatchRunner *runner) {
+TestHash_Run_IMP(TestHash *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 27);
     srand((unsigned int)time((time_t*)NULL));
     test_Equals(runner);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e8e6b886/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c b/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
index d895595..c69d2ec 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
@@ -38,7 +38,7 @@ StupidHashCharBuf_new(const char *text) {
 }
 
 int32_t
-StupidHashCharBuf_hash_sum(StupidHashCharBuf *self) {
+StupidHashCharBuf_Hash_Sum_IMP(StupidHashCharBuf *self) {
     UNUSED_VAR(self);
     return 1;
 }
@@ -75,7 +75,7 @@ test_all(TestBatchRunner *runner) {
 }
 
 void
-TestLFReg_run(TestLockFreeRegistry *self, TestBatchRunner *runner) {
+TestLFReg_Run_IMP(TestLockFreeRegistry *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 6);
     test_all(runner);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/e8e6b886/clownfish/runtime/core/Clownfish/Test/TestNum.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestNum.c b/clownfish/runtime/core/Clownfish/Test/TestNum.c
index 9def22d..a1a95eb 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestNum.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestNum.c
@@ -273,7 +273,7 @@ test_Mimic(TestBatchRunner *runner) {
 }
 
 void
-TestNum_run(TestNum *self, TestBatchRunner *runner) {
+TestNum_Run_IMP(TestNum *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 53);
     test_To_String(runner);
     test_accessors(runner);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e8e6b886/clownfish/runtime/core/Clownfish/Test/TestObj.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestObj.c b/clownfish/runtime/core/Clownfish/Test/TestObj.c
index 4ca121a..663999b 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestObj.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestObj.c
@@ -178,7 +178,7 @@ test_abstract_routines(TestBatchRunner *runner) {
 }
 
 void
-TestObj_run(TestObj *self, TestBatchRunner *runner) {
+TestObj_Run_IMP(TestObj *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 18);
     test_refcounts(runner);
     test_To_String(runner);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e8e6b886/clownfish/runtime/core/Clownfish/Test/TestVArray.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestVArray.c b/clownfish/runtime/core/Clownfish/Test/TestVArray.c
index d64403a..231da7d 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestVArray.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestVArray.c
@@ -294,7 +294,7 @@ test_Clone_and_Shallow_Copy(TestBatchRunner *runner) {
 }
 
 void
-TestVArray_run(TestVArray *self, TestBatchRunner *runner) {
+TestVArray_Run_IMP(TestVArray *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 43);
     test_Equals(runner);
     test_Store_Fetch(runner);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e8e6b886/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c b/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
index d2cb408..320ff91 100644
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
+++ b/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
@@ -57,7 +57,7 @@ test_cas_ptr(TestBatchRunner *runner) {
 }
 
 void
-TestAtomic_run(TestAtomic *self, TestBatchRunner *runner) {
+TestAtomic_Run_IMP(TestAtomic *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 6);
     test_cas_ptr(runner);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/e8e6b886/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c b/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
index 24c8ad3..2551bc8 100644
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
+++ b/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
@@ -108,7 +108,7 @@ test_oversize__rounding(TestBatchRunner *runner) {
 }
 
 void
-TestMemory_run(TestMemory *self, TestBatchRunner *runner) {
+TestMemory_Run_IMP(TestMemory *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 30);
     test_oversize__growth_rate(runner);
     test_oversize__ceiling(runner);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e8e6b886/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c b/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
index 0ae476d..4d31131 100644
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
+++ b/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
@@ -356,7 +356,7 @@ test_bigend_f64(TestBatchRunner *runner) {
 }
 
 void
-TestNumUtil_run(TestNumberUtils *self, TestBatchRunner *runner) {
+TestNumUtil_Run_IMP(TestNumberUtils *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 1196);
     srand((unsigned int)time((time_t*)NULL));
     test_u1(runner);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e8e6b886/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c b/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c
index ccadd1c..f9d36cf 100644
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c
+++ b/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c
@@ -286,7 +286,7 @@ test_back_utf8_char(TestBatchRunner *runner) {
 }
 
 void
-TestStrHelp_run(TestStringHelper *self, TestBatchRunner *runner) {
+TestStrHelp_Run_IMP(TestStringHelper *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 40);
     test_overlap(runner);
     test_to_base36(runner);


[lucy-commits] [5/7] git commit: refs/heads/method-imp-names - Fix misspelling of method imp Prefix.

Posted by ma...@apache.org.
Fix misspelling of method imp Prefix.

Will be rolled into earlier commit before merging to master.


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

Branch: refs/heads/method-imp-names
Commit: 195cc042254e70f95a77c3c28bd0b6b889af6c78
Parents: e8e6b88
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Thu Aug 8 18:11:48 2013 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Thu Aug 8 19:13:34 2013 -0700

----------------------------------------------------------------------
 clownfish/compiler/src/CFCMethod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/195cc042/clownfish/compiler/src/CFCMethod.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCMethod.c b/clownfish/compiler/src/CFCMethod.c
index 1e10484..9bcf8a0 100644
--- a/clownfish/compiler/src/CFCMethod.c
+++ b/clownfish/compiler/src/CFCMethod.c
@@ -138,7 +138,7 @@ CFCMethod_init(CFCMethod *self, CFCParcel *parcel, const char *exposure,
     self->short_imp_func
         = CFCUtil_sprintf("%s_%s_IMP", CFCMethod_get_class_cnick(self),
                           self->macro_sym);
-    self->imp_func = CFCUtil_sprintf("%s%s", CFCMethod_get_prefix(self),
+    self->imp_func = CFCUtil_sprintf("%s%s", CFCMethod_get_Prefix(self),
                                      self->short_imp_func);
 
     // Assume that this method is novel until we discover when applying


[lucy-commits] [7/7] git commit: refs/heads/method-imp-names - Address direct invocation of method imp funcs.

Posted by ma...@apache.org.
Address direct invocation of method imp funcs.

Where the implementing functions for methods are invoked directly
within the Clownfish runtime, either change the spelling to the
new-style with _IMP suffix, or change the call to use dynamic
method invocation.


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

Branch: refs/heads/method-imp-names
Commit: a0263b38edc7f09ce3dce4fd1752f68cd66c3076
Parents: 195cc04
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Thu Aug 8 18:15:47 2013 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Thu Aug 8 19:13:34 2013 -0700

----------------------------------------------------------------------
 clownfish/runtime/core/Clownfish/ByteBuf.c | 3 ++-
 clownfish/runtime/core/Clownfish/CharBuf.c | 8 ++++----
 clownfish/runtime/core/Clownfish/Err.c     | 2 +-
 clownfish/runtime/core/Clownfish/Hash.c    | 8 ++++----
 clownfish/runtime/core/Clownfish/VArray.c  | 2 +-
 clownfish/runtime/core/Clownfish/VTable.c  | 8 ++++----
 6 files changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/a0263b38/clownfish/runtime/core/Clownfish/ByteBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/ByteBuf.c b/clownfish/runtime/core/Clownfish/ByteBuf.c
index 29a1412..4ffbd84 100644
--- a/clownfish/runtime/core/Clownfish/ByteBuf.c
+++ b/clownfish/runtime/core/Clownfish/ByteBuf.c
@@ -235,7 +235,8 @@ ViewBB_init(ViewByteBuf *self, char *buf, size_t size) {
 
 void
 ViewBB_Destroy_IMP(ViewByteBuf *self) {
-    Obj_destroy((Obj*)self);
+    Obj_Destroy_t super_duper_destroy = METHOD_PTR(OBJ, Cfish_Obj_Destroy);
+    super_duper_destroy((Obj*)self);
 }
 
 void

http://git-wip-us.apache.org/repos/asf/lucy/blob/a0263b38/clownfish/runtime/core/Clownfish/CharBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/CharBuf.c b/clownfish/runtime/core/Clownfish/CharBuf.c
index 78f4c7b..0233681 100644
--- a/clownfish/runtime/core/Clownfish/CharBuf.c
+++ b/clownfish/runtime/core/Clownfish/CharBuf.c
@@ -470,7 +470,7 @@ CB_Cat_Str_IMP(CharBuf *self, const char* ptr, size_t size) {
     if (!StrHelp_utf8_valid(ptr, size)) {
         DIE_INVALID_UTF8(ptr, size);
     }
-    CB_cat_trusted_str(self, ptr, size);
+    CB_Cat_Trusted_Str_IMP(self, ptr, size);
 }
 
 void
@@ -499,7 +499,7 @@ CB_Cat_IMP(CharBuf *self, const CharBuf *other) {
 
 bool
 CB_Starts_With_IMP(CharBuf *self, const CharBuf *prefix) {
-    return CB_starts_with_str(self, prefix->ptr, prefix->size);
+    return CB_Starts_With_Str_IMP(self, prefix->ptr, prefix->size);
 }
 
 bool
@@ -519,7 +519,7 @@ CB_Equals_IMP(CharBuf *self, Obj *other) {
     CharBuf *const twin = (CharBuf*)other;
     if (twin == self)              { return true; }
     if (!Obj_Is_A(other, CHARBUF)) { return false; }
-    return CB_equals_str(self, twin->ptr, twin->size);
+    return CB_Equals_Str_IMP(self, twin->ptr, twin->size);
 }
 
 int32_t
@@ -538,7 +538,7 @@ CB_Equals_Str_IMP(CharBuf *self, const char *ptr, size_t size) {
 
 bool
 CB_Ends_With_IMP(CharBuf *self, const CharBuf *postfix) {
-    return CB_ends_with_str(self, postfix->ptr, postfix->size);
+    return CB_Ends_With_Str_IMP(self, postfix->ptr, postfix->size);
 }
 
 bool

http://git-wip-us.apache.org/repos/asf/lucy/blob/a0263b38/clownfish/runtime/core/Clownfish/Err.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Err.c b/clownfish/runtime/core/Clownfish/Err.c
index 30757b8..5dab78b 100644
--- a/clownfish/runtime/core/Clownfish/Err.c
+++ b/clownfish/runtime/core/Clownfish/Err.c
@@ -163,7 +163,7 @@ Err_Add_Frame_IMP(Err *self, const char *file, int line, const char *func) {
 
 void
 Err_rethrow(Err *self, const char *file, int line, const char *func) {
-    Err_add_frame(self, file, line, func);
+    Err_Add_Frame_IMP(self, file, line, func);
     Err_do_throw(self);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/a0263b38/clownfish/runtime/core/Clownfish/Hash.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Hash.c b/clownfish/runtime/core/Clownfish/Hash.c
index 3af71ed..b4c61cb 100644
--- a/clownfish/runtime/core/Clownfish/Hash.c
+++ b/clownfish/runtime/core/Clownfish/Hash.c
@@ -173,7 +173,7 @@ Hash_Make_Key_IMP(Hash *self, Obj *key, int32_t hash_sum) {
 Obj*
 Hash_Fetch_Str_IMP(Hash *self, const char *key, size_t key_len) {
     ZombieCharBuf *key_buf = ZCB_WRAP_STR(key, key_len);
-    return Hash_fetch(self, (Obj*)key_buf);
+    return Hash_Fetch_IMP(self, (Obj*)key_buf);
 }
 
 static INLINE HashEntry*
@@ -225,7 +225,7 @@ Hash_Delete_IMP(Hash *self, const Obj *key) {
 Obj*
 Hash_Delete_Str_IMP(Hash *self, const char *key, size_t key_len) {
     ZombieCharBuf *key_buf = ZCB_WRAP_STR(key, key_len);
-    return Hash_delete(self, (Obj*)key_buf);
+    return Hash_Delete_IMP(self, (Obj*)key_buf);
 }
 
 uint32_t
@@ -275,7 +275,7 @@ Hash_Keys_IMP(Hash *self) {
     VArray *keys = VA_new(self->size);
     Hash_Iterate(self);
     while (Hash_Next(self, &key, &val)) {
-        VA_push(keys, INCREF(key));
+        VA_Push(keys, INCREF(key));
     }
     return keys;
 }
@@ -286,7 +286,7 @@ Hash_Values_IMP(Hash *self) {
     Obj *val;
     VArray *values = VA_new(self->size);
     Hash_Iterate(self);
-    while (Hash_Next(self, &key, &val)) { VA_push(values, INCREF(val)); }
+    while (Hash_Next(self, &key, &val)) { VA_Push(values, INCREF(val)); }
     return values;
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/a0263b38/clownfish/runtime/core/Clownfish/VArray.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VArray.c b/clownfish/runtime/core/Clownfish/VArray.c
index 953161c..2d16a0a 100644
--- a/clownfish/runtime/core/Clownfish/VArray.c
+++ b/clownfish/runtime/core/Clownfish/VArray.c
@@ -211,7 +211,7 @@ VA_Excise_IMP(VArray *self, uint32_t offset, uint32_t length) {
 
 void
 VA_Clear_IMP(VArray *self) {
-    VA_excise(self, 0, self->size);
+    VA_Excise_IMP(self, 0, self->size);
 }
 
 void

http://git-wip-us.apache.org/repos/asf/lucy/blob/a0263b38/clownfish/runtime/core/Clownfish/VTable.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VTable.c b/clownfish/runtime/core/Clownfish/VTable.c
index 6388234..ae06828 100644
--- a/clownfish/runtime/core/Clownfish/VTable.c
+++ b/clownfish/runtime/core/Clownfish/VTable.c
@@ -110,14 +110,14 @@ VTable_bootstrap(const VTableSpec *specs, size_t num_specs)
         for (size_t i = 0; i < spec->num_overridden_meths; ++i) {
             const OverriddenMethSpec *mspec = &spec->overridden_meth_specs[i];
             *mspec->offset = *mspec->parent_offset;
-            VTable_override(vtable, mspec->func, *mspec->offset);
+            VTable_Override_IMP(vtable, mspec->func, *mspec->offset);
         }
 
         for (size_t i = 0; i < spec->num_novel_meths; ++i) {
             const NovelMethSpec *mspec = &spec->novel_meth_specs[i];
             *mspec->offset = novel_offset;
             novel_offset += sizeof(cfish_method_t);
-            VTable_override(vtable, mspec->func, *mspec->offset);
+            VTable_Override_IMP(vtable, mspec->func, *mspec->offset);
         }
 
         *spec->vtable = vtable;
@@ -131,7 +131,7 @@ VTable_bootstrap(const VTableSpec *specs, size_t num_specs)
         const VTableSpec *spec = &specs[i];
         VTable *vtable = *spec->vtable;
 
-        VTable_init_obj(VTABLE, vtable);
+        VTable_Init_Obj_IMP(VTABLE, vtable);
     }
 
     /* Now it's safe to call methods.
@@ -282,7 +282,7 @@ VTable_singleton(const CharBuf *class_name, VTable *parent) {
             Hash *meths = Hash_new(num_fresh);
             CharBuf *scrunched = CB_new(0);
             for (uint32_t i = 0; i < num_fresh; i++) {
-                CharBuf *meth = (CharBuf*)VA_fetch(fresh_host_methods, i);
+                CharBuf *meth = (CharBuf*)VA_Fetch(fresh_host_methods, i);
                 S_scrunch_charbuf(meth, scrunched);
                 Hash_Store(meths, (Obj*)scrunched, (Obj*)CFISH_TRUE);
             }


[lucy-commits] [6/7] git commit: refs/heads/method-imp-names - Address a few unused var warnings.

Posted by ma...@apache.org.
Address a few unused var warnings.


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

Branch: refs/heads/method-imp-names
Commit: 45c6219ecbeca7639d4fb48c0dcb3aa9ebf97df7
Parents: 8228d42
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Thu Aug 8 18:35:10 2013 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Thu Aug 8 19:13:34 2013 -0700

----------------------------------------------------------------------
 clownfish/compiler/perl/lib/Clownfish/CFC.xs           |  2 ++
 clownfish/compiler/src/CFCPerl.c                       | 10 +++++++++-
 clownfish/compiler/src/CFCPerlMethod.c                 | 13 ++++---------
 .../runtime/core/Clownfish/TestHarness/TestFormatter.c |  2 ++
 4 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/45c6219e/clownfish/compiler/perl/lib/Clownfish/CFC.xs
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC.xs b/clownfish/compiler/perl/lib/Clownfish/CFC.xs
index 3013236..410658d 100644
--- a/clownfish/compiler/perl/lib/Clownfish/CFC.xs
+++ b/clownfish/compiler/perl/lib/Clownfish/CFC.xs
@@ -2239,6 +2239,7 @@ method_bindings(unused, klass)
     SV *unused;
     CFCClass *klass;
 CODE:
+    CHY_UNUSED_VAR(unused);
     CFCPerlMethod **bound = CFCPerlClass_method_bindings(klass);
     RETVAL = S_array_of_cfcbase_to_av((CFCBase**)bound);
     FREEMEM(bound);
@@ -2249,6 +2250,7 @@ constructor_bindings(unused, klass)
     SV *unused;
     CFCClass *klass;
 CODE:
+    CHY_UNUSED_VAR(unused);
     CFCPerlConstructor **bound = CFCPerlClass_constructor_bindings(klass);
     RETVAL = S_array_of_cfcbase_to_av((CFCBase**)bound);
     FREEMEM(bound);

http://git-wip-us.apache.org/repos/asf/lucy/blob/45c6219e/clownfish/compiler/src/CFCPerl.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerl.c b/clownfish/compiler/src/CFCPerl.c
index 6612cd1..1547bb7 100644
--- a/clownfish/compiler/src/CFCPerl.c
+++ b/clownfish/compiler/src/CFCPerl.c
@@ -236,6 +236,15 @@ S_write_boot_c(CFCPerl *self) {
             const char **aliases
                 = CFCPerlClass_get_class_aliases(class_binding);
             for (size_t j = 0; aliases[j] != NULL; j++) {
+                if (!strlen(alias_adds)) {
+                    // There's at least one alias, so include the buffer.
+                    alias_adds
+                        = CFCUtil_cat(alias_adds,
+                                      "    cfish_ZombieCharBuf *alias "
+                                      "= CFISH_ZCB_WRAP_STR(\"\", 0);\n",
+                                      NULL);
+                }
+
                 const char *alias = aliases[j];
                 size_t alias_len  = strlen(alias);
                 const char pattern[] =
@@ -284,7 +293,6 @@ S_write_boot_c(CFCPerl *self) {
         "%s() {\n"
         "%s"
         "\n"
-        "    cfish_ZombieCharBuf *alias = CFISH_ZCB_WRAP_STR(\"\", 0);\n"
         "%s"
         "\n"
         "    AV *isa;\n"

http://git-wip-us.apache.org/repos/asf/lucy/blob/45c6219e/clownfish/compiler/src/CFCPerlMethod.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlMethod.c b/clownfish/compiler/src/CFCPerlMethod.c
index c109bd1..8fce391 100644
--- a/clownfish/compiler/src/CFCPerlMethod.c
+++ b/clownfish/compiler/src/CFCPerlMethod.c
@@ -41,8 +41,7 @@ S_xsub_body(CFCPerlMethod *self);
 
 // Create an assignment statement for extracting $self from the Perl stack.
 static char*
-S_self_assign_statement(CFCPerlMethod *self, CFCType *type,
-                        const char *method_name);
+S_self_assign_statement(CFCPerlMethod *self, CFCType *type);
 
 // Return code for an xsub which uses labeled params.
 static char*
@@ -220,8 +219,7 @@ S_xsub_body(CFCPerlMethod *self) {
 
 // Create an assignment statement for extracting $self from the Perl stack.
 static char*
-S_self_assign_statement(CFCPerlMethod *self, CFCType *type,
-                        const char *method_name) {
+S_self_assign_statement(CFCPerlMethod *self, CFCType *type) {
     (void)self; // unused
     const char *type_c = CFCType_to_c(type);
     if (!CFCType_is_object(type)) {
@@ -242,8 +240,7 @@ S_xsub_def_labeled_params(CFCPerlMethod *self) {
     CFCVariable *self_var    = arg_vars[0];
     CFCType     *self_type   = CFCVariable_get_type(self_var);
     const char  *self_micro_sym = CFCVariable_micro_sym(self_var);
-    const char  *micro_sym   = CFCMethod_micro_sym(self->method);
-    char *self_assign = S_self_assign_statement(self, self_type, micro_sym);
+    char *self_assign = S_self_assign_statement(self, self_type);
     char *allot_params = CFCPerlSub_build_allot_params((CFCPerlSub*)self);
     char *body = S_xsub_body(self);
 
@@ -323,9 +320,7 @@ S_xsub_def_positional_args(CFCPerlMethod *self) {
         const char  *type_c   = CFCType_to_c(var_type);
 
         if (i == 0) {    // self
-            const char *meth_micro_sym = CFCMethod_micro_sym(self->method);
-            char *statement
-                = S_self_assign_statement(self, var_type, meth_micro_sym);
+            char *statement = S_self_assign_statement(self, var_type);
             var_assignments = CFCUtil_cat(var_assignments, statement, NULL);
             FREEMEM(statement);
         }

http://git-wip-us.apache.org/repos/asf/lucy/blob/45c6219e/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c b/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c
index e322539..2ccfe97 100644
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c
+++ b/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c
@@ -75,6 +75,7 @@ void
 TestFormatterCF_Batch_Prologue_IMP(TestFormatterCF *self, TestBatch *batch,
                                    uint32_t num_planned) {
     UNUSED_VAR(self);
+    UNUSED_VAR(num_planned);
     CharBuf *class_name = TestBatch_Get_Class_Name(batch);
     printf("Running %s...\n", CB_Get_Ptr8(class_name));
 }
@@ -147,6 +148,7 @@ void
 TestFormatterTAP_Batch_Prologue_IMP(TestFormatterTAP *self, TestBatch *batch,
                                 uint32_t num_planned) {
     UNUSED_VAR(self);
+    UNUSED_VAR(batch);
     printf("1..%u\n", num_planned);
 }
 


[lucy-commits] [3/7] git commit: refs/heads/method-imp-names - Migrate C bindings for Clownfish runtime to _IMP.

Posted by ma...@apache.org.
Migrate C bindings for Clownfish runtime to _IMP.


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

Branch: refs/heads/method-imp-names
Commit: 8228d429fb167d8e07fb0dad9672e124f74e07a1
Parents: a0263b3
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Thu Aug 8 18:29:58 2013 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Thu Aug 8 19:13:34 2013 -0700

----------------------------------------------------------------------
 clownfish/runtime/c/src/Clownfish/Err.c              | 4 ++--
 clownfish/runtime/c/src/Clownfish/LockFreeRegistry.c | 2 +-
 clownfish/runtime/c/src/Clownfish/Obj.c              | 8 ++++----
 clownfish/runtime/c/src/Clownfish/VTable.c           | 8 ++++----
 4 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/8228d429/clownfish/runtime/c/src/Clownfish/Err.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/src/Clownfish/Err.c b/clownfish/runtime/c/src/Clownfish/Err.c
index 17b7535..6ce7ecb 100644
--- a/clownfish/runtime/c/src/Clownfish/Err.c
+++ b/clownfish/runtime/c/src/Clownfish/Err.c
@@ -54,14 +54,14 @@ Err_do_throw(Err *error) {
         longjmp(*current_env, 1);
     }
     else {
-        CharBuf *message = Err_get_mess(error);
+        CharBuf *message = Err_Get_Mess(error);
         fprintf(stderr, "%s", CB_Get_Ptr8(message));
         exit(EXIT_FAILURE);
     }
 }
 
 void*
-Err_to_host(Err *self) {
+Err_To_Host_IMP(Err *self) {
     UNUSED_VAR(self);
     THROW(ERR, "TODO");
     UNREACHABLE_RETURN(void*);

http://git-wip-us.apache.org/repos/asf/lucy/blob/8228d429/clownfish/runtime/c/src/Clownfish/LockFreeRegistry.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/src/Clownfish/LockFreeRegistry.c b/clownfish/runtime/c/src/Clownfish/LockFreeRegistry.c
index 481299e..eabdc9c 100644
--- a/clownfish/runtime/c/src/Clownfish/LockFreeRegistry.c
+++ b/clownfish/runtime/c/src/Clownfish/LockFreeRegistry.c
@@ -22,7 +22,7 @@
 #include "Clownfish/Err.h"
 
 void*
-LFReg_to_host(LockFreeRegistry *self) {
+LFReg_To_Host_IMP(LockFreeRegistry *self) {
     UNUSED_VAR(self);
     THROW(ERR, "TODO");
     UNREACHABLE_RETURN(void*);

http://git-wip-us.apache.org/repos/asf/lucy/blob/8228d429/clownfish/runtime/c/src/Clownfish/Obj.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/src/Clownfish/Obj.c b/clownfish/runtime/c/src/Clownfish/Obj.c
index 6018c70..c5d40cf 100644
--- a/clownfish/runtime/c/src/Clownfish/Obj.c
+++ b/clownfish/runtime/c/src/Clownfish/Obj.c
@@ -22,18 +22,18 @@
 #include "Clownfish/Err.h"
 
 uint32_t
-Obj_get_refcount(Obj *self) {
+Obj_Get_RefCount_IMP(Obj *self) {
     return self->refcount;
 }
 
 Obj*
-Obj_inc_refcount(Obj *self) {
+Obj_Inc_RefCount_IMP(Obj *self) {
     self->refcount++;
     return self;
 }
 
 uint32_t
-Obj_dec_refcount(Obj *self) {
+Obj_Dec_RefCount_IMP(Obj *self) {
     uint32_t modified_refcount = INT32_MAX;
     switch (self->refcount) {
         case 0:
@@ -51,7 +51,7 @@ Obj_dec_refcount(Obj *self) {
 }
 
 void*
-Obj_to_host(Obj *self) {
+Obj_To_Host_IMP(Obj *self) {
     UNUSED_VAR(self);
     THROW(ERR, "TODO");
     UNREACHABLE_RETURN(void*);

http://git-wip-us.apache.org/repos/asf/lucy/blob/8228d429/clownfish/runtime/c/src/Clownfish/VTable.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/src/Clownfish/VTable.c b/clownfish/runtime/c/src/Clownfish/VTable.c
index 0bdd150..b2cac36 100644
--- a/clownfish/runtime/c/src/Clownfish/VTable.c
+++ b/clownfish/runtime/c/src/Clownfish/VTable.c
@@ -26,7 +26,7 @@
 #include "Clownfish/VArray.h"
 
 Obj*
-VTable_make_obj(VTable *self) {
+VTable_Make_Obj_IMP(VTable *self) {
     Obj *obj = (Obj*)Memory_wrapped_calloc(self->obj_alloc_size, 1);
     obj->vtable = self;
     obj->refcount = 1;
@@ -34,7 +34,7 @@ VTable_make_obj(VTable *self) {
 }
 
 Obj*
-VTable_init_obj(VTable *self, void *allocation) {
+VTable_Init_Obj_IMP(VTable *self, void *allocation) {
     Obj *obj = (Obj*)allocation;
     obj->vtable = self;
     obj->refcount = 1;
@@ -42,7 +42,7 @@ VTable_init_obj(VTable *self, void *allocation) {
 }
 
 Obj*
-VTable_foster_obj(VTable *self, void *host_obj) {
+VTable_Foster_Obj_IMP(VTable *self, void *host_obj) {
     UNUSED_VAR(self);
     UNUSED_VAR(host_obj);
     THROW(ERR, "TODO");
@@ -69,7 +69,7 @@ VTable_find_parent_class(const CharBuf *class_name) {
 }
 
 void*
-VTable_to_host(VTable *self) {
+VTable_To_Host_IMP(VTable *self) {
     UNUSED_VAR(self);
     THROW(ERR, "TODO");
     UNREACHABLE_RETURN(void*);


[lucy-commits] [4/7] git commit: refs/heads/method-imp-names - Migrate Clownfish runtime Perl bindings to _IMP.

Posted by ma...@apache.org.
Migrate Clownfish runtime Perl bindings to _IMP.


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

Branch: refs/heads/method-imp-names
Commit: e797381d77c380c31e85db4b124be2660a54c04a
Parents: 45c6219
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Thu Aug 8 19:10:53 2013 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Thu Aug 8 19:13:34 2013 -0700

----------------------------------------------------------------------
 .../perl/buildlib/Clownfish/Build/Binding.pm    |  8 ++++----
 clownfish/runtime/perl/xs/XSBind.c              | 20 ++++++++++----------
 2 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/e797381d/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm b/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm
index fd02a6b..6a7d22b 100644
--- a/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm
+++ b/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm
@@ -168,7 +168,7 @@ SV*
 _clone(self)
     cfish_CharBuf *self;
 CODE:
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(cfish_CB_clone(self));
+    RETVAL = CFISH_OBJ_TO_SV_NOINC(Cfish_CB_Clone_IMP(self));
 OUTPUT: RETVAL
 
 SV*
@@ -268,7 +268,7 @@ _fetch(self, key)
     cfish_Hash *self;
     const cfish_CharBuf *key;
 CODE:
-    RETVAL = CFISH_OBJ_TO_SV(cfish_Hash_fetch(self, (cfish_Obj*)key));
+    RETVAL = CFISH_OBJ_TO_SV(Cfish_Hash_Fetch_IMP(self, (cfish_Obj*)key));
 OUTPUT: RETVAL
 
 void
@@ -279,7 +279,7 @@ store(self, key, value);
 PPCODE:
 {
     if (value) { CFISH_INCREF(value); }
-    cfish_Hash_store(self, (cfish_Obj*)key, value);
+    Cfish_Hash_Store_IMP(self, (cfish_Obj*)key, value);
 }
 
 void
@@ -549,7 +549,7 @@ store(self, tick, value);
 PPCODE:
 {
     if (value) { CFISH_INCREF(value); }
-    cfish_VA_store(self, tick, value);
+    Cfish_VA_Store_IMP(self, tick, value);
 }
 
 SV*

http://git-wip-us.apache.org/repos/asf/lucy/blob/e797381d/clownfish/runtime/perl/xs/XSBind.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/xs/XSBind.c b/clownfish/runtime/perl/xs/XSBind.c
index 092b5e9..c0a5f28 100644
--- a/clownfish/runtime/perl/xs/XSBind.c
+++ b/clownfish/runtime/perl/xs/XSBind.c
@@ -620,14 +620,14 @@ S_lazy_init_host_obj(cfish_Obj *self) {
 }
 
 uint32_t
-cfish_Obj_get_refcount(cfish_Obj *self) {
+Cfish_Obj_Get_RefCount_IMP(cfish_Obj *self) {
     return self->ref.count & XSBIND_REFCOUNT_FLAG
            ? self->ref.count >> XSBIND_REFCOUNT_SHIFT
            : SvREFCNT((SV*)self->ref.host_obj);
 }
 
 cfish_Obj*
-cfish_Obj_inc_refcount(cfish_Obj *self) {
+Cfish_Obj_Inc_RefCount_IMP(cfish_Obj *self) {
     if (self->ref.count & XSBIND_REFCOUNT_FLAG) {
         if (self->ref.count == XSBIND_REFCOUNT_FLAG) {
             CFISH_THROW(CFISH_ERR, "Illegal refcount of 0");
@@ -641,7 +641,7 @@ cfish_Obj_inc_refcount(cfish_Obj *self) {
 }
 
 uint32_t
-cfish_Obj_dec_refcount(cfish_Obj *self) {
+Cfish_Obj_Dec_RefCount_IMP(cfish_Obj *self) {
     uint32_t modified_refcount = I32_MAX;
     if (self->ref.count & XSBIND_REFCOUNT_FLAG) {
         if (self->ref.count == XSBIND_REFCOUNT_FLAG) {
@@ -667,7 +667,7 @@ cfish_Obj_dec_refcount(cfish_Obj *self) {
 }
 
 void*
-cfish_Obj_to_host(cfish_Obj *self) {
+Cfish_Obj_To_Host_IMP(cfish_Obj *self) {
     if (self->ref.count & XSBIND_REFCOUNT_FLAG) { S_lazy_init_host_obj(self); }
     return newRV_inc((SV*)self->ref.host_obj);
 }
@@ -675,7 +675,7 @@ cfish_Obj_to_host(cfish_Obj *self) {
 /*************************** Clownfish::VTable ******************************/
 
 cfish_Obj*
-cfish_VTable_make_obj(cfish_VTable *self) {
+Cfish_VTable_Make_Obj_IMP(cfish_VTable *self) {
     cfish_Obj *obj
         = (cfish_Obj*)cfish_Memory_wrapped_calloc(self->obj_alloc_size, 1);
     obj->vtable = self;
@@ -684,7 +684,7 @@ cfish_VTable_make_obj(cfish_VTable *self) {
 }
 
 cfish_Obj*
-cfish_VTable_init_obj(cfish_VTable *self, void *allocation) {
+Cfish_VTable_Init_Obj_IMP(cfish_VTable *self, void *allocation) {
     cfish_Obj *obj = (cfish_Obj*)allocation;
     obj->vtable = self;
     obj->ref.count = (1 << XSBIND_REFCOUNT_SHIFT) | XSBIND_REFCOUNT_FLAG;
@@ -692,7 +692,7 @@ cfish_VTable_init_obj(cfish_VTable *self, void *allocation) {
 }
 
 cfish_Obj*
-cfish_VTable_foster_obj(cfish_VTable *self, void *host_obj) {
+Cfish_VTable_Foster_Obj_IMP(cfish_VTable *self, void *host_obj) {
     cfish_Obj *obj
         = (cfish_Obj*)cfish_Memory_wrapped_calloc(self->obj_alloc_size, 1);
     SV *inner_obj = SvRV((SV*)host_obj);
@@ -756,7 +756,7 @@ cfish_VTable_find_parent_class(const cfish_CharBuf *class_name) {
 }
 
 void*
-cfish_VTable_to_host(cfish_VTable *self) {
+Cfish_VTable_To_Host_IMP(cfish_VTable *self) {
     bool first_time = self->ref.count & XSBIND_REFCOUNT_FLAG ? true : false;
     Cfish_VTable_To_Host_t to_host
         = CFISH_SUPER_METHOD_PTR(CFISH_VTABLE, Cfish_VTable_To_Host);
@@ -847,7 +847,7 @@ cfish_Err_do_throw(cfish_Err *err) {
 }
 
 void*
-cfish_Err_to_host(cfish_Err *self) {
+Cfish_Err_To_Host_IMP(cfish_Err *self) {
     Cfish_Err_To_Host_t super_to_host
         = CFISH_SUPER_METHOD_PTR(CFISH_ERR, Cfish_Err_To_Host);
     SV *perl_obj = (SV*)super_to_host(self);
@@ -921,7 +921,7 @@ cfish_Err_trap(Cfish_Err_Attempt_t routine, void *context) {
 /*********************** Clownfish::LockFreeRegistry ************************/
 
 void*
-cfish_LFReg_to_host(cfish_LockFreeRegistry *self) {
+Cfish_LFReg_To_Host_IMP(cfish_LockFreeRegistry *self) {
     bool first_time = self->ref.count & XSBIND_REFCOUNT_FLAG ? true : false;
     Cfish_LFReg_To_Host_t to_host
         = CFISH_SUPER_METHOD_PTR(CFISH_LOCKFREEREGISTRY, Cfish_LFReg_To_Host);