Rename ToPtr to TOPTR.

Using all caps avoids a potential conflict with Clownfish user-defined
method named `To_Ptr` -- though the unlikely `TO_PTR` would still cause
a conflict.


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

Branch: refs/heads/master
Commit: 004de889692f06f69828dc0e8e04bfc1e0b0a849
Parents: 3a68274
Author: Marvin Humphrey <[email protected]>
Authored: Sat Apr 4 16:48:56 2015 -0700
Committer: Marvin Humphrey <[email protected]>
Committed: Mon Apr 6 09:08:20 2015 -0700

----------------------------------------------------------------------
 runtime/go/clownfish/clownfish.go      | 8 ++++----
 runtime/go/clownfish/clownfish_test.go | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/004de889/runtime/go/clownfish/clownfish.go
----------------------------------------------------------------------
diff --git a/runtime/go/clownfish/clownfish.go 
b/runtime/go/clownfish/clownfish.go
index d3cc331..5e884a5 100644
--- a/runtime/go/clownfish/clownfish.go
+++ b/runtime/go/clownfish/clownfish.go
@@ -69,7 +69,7 @@ func init() {
 }
 
 type Obj interface {
-       ToPtr() uintptr
+       TOPTR() uintptr
 }
 
 type implObj struct {
@@ -135,7 +135,7 @@ func (obj *implString) finalize() {
        obj.ref = nil
 }
 
-func (obj *implString) ToPtr() uintptr {
+func (obj *implString) TOPTR() uintptr {
        return uintptr(unsafe.Pointer(obj.ref))
 }
 
@@ -172,7 +172,7 @@ func (obj *implErr) finalize() {
        obj.ref = nil
 }
 
-func (obj *implErr) ToPtr() uintptr {
+func (obj *implErr) TOPTR() uintptr {
        return uintptr(unsafe.Pointer(obj.ref))
 }
 
@@ -191,7 +191,7 @@ func GoCfish_TrapErr_internal(routine C.CFISH_Err_Attempt_t,
        context unsafe.Pointer) *C.cfish_Err {
        err := TrapErr(func() { C.GoCfish_RunRoutine(routine, context) })
        if err != nil {
-               ptr := (err.(Err)).ToPtr()
+               ptr := (err.(Err)).TOPTR()
                return ((*C.cfish_Err)(unsafe.Pointer(ptr)))
        }
        return nil

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/004de889/runtime/go/clownfish/clownfish_test.go
----------------------------------------------------------------------
diff --git a/runtime/go/clownfish/clownfish_test.go 
b/runtime/go/clownfish/clownfish_test.go
index a89870b..016e4a0 100644
--- a/runtime/go/clownfish/clownfish_test.go
+++ b/runtime/go/clownfish/clownfish_test.go
@@ -22,7 +22,7 @@ import "unsafe"
 
 func TestStuff(t *testing.T) {
        cfString := clownfish.NewString("foo")
-       goString := clownfish.CFStringToGo(unsafe.Pointer(cfString.ToPtr()))
+       goString := clownfish.CFStringToGo(unsafe.Pointer(cfString.TOPTR()))
        if goString != "foo" {
                t.Error("Round-tripping strings failed")
        }

Reply via email to