lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [1/5] lucy git commit: Rename ToPtr to TOPTR per Clownfish mods.
Date Tue, 07 Apr 2015 00:03:55 GMT
Repository: lucy
Updated Branches:
  refs/heads/master e0ad52e3e -> a61402777


Rename ToPtr to TOPTR per Clownfish mods.


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

Branch: refs/heads/master
Commit: f82b146c35a7b61336d819672d0f9f2aaa97fe8d
Parents: 395d84a
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Sat Apr 4 17:50:15 2015 -0700
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Sat Apr 4 17:51:29 2015 -0700

----------------------------------------------------------------------
 go/lucy/analysis.go |  4 ++--
 go/lucy/index.go    | 14 +++++++-------
 go/lucy/plan.go     | 10 +++++-----
 go/lucy/search.go   | 10 +++++-----
 4 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/f82b146c/go/lucy/analysis.go
----------------------------------------------------------------------
diff --git a/go/lucy/analysis.go b/go/lucy/analysis.go
index 84b8a72..1da55d6 100644
--- a/go/lucy/analysis.go
+++ b/go/lucy/analysis.go
@@ -44,7 +44,7 @@ type implEasyAnalyzer struct {
 
 func NewEasyAnalyzer(language string) EasyAnalyzer {
 	lang := clownfish.NewString(language)
-	cfObj := C.lucy_EasyAnalyzer_new((*C.cfish_String)(unsafe.Pointer(lang.ToPtr())))
+	cfObj := C.lucy_EasyAnalyzer_new((*C.cfish_String)(unsafe.Pointer(lang.TOPTR())))
 	return WRAPEasyAnalyzer(unsafe.Pointer(cfObj))
 }
 
@@ -59,6 +59,6 @@ func (obj *implEasyAnalyzer) finalize() {
 	obj.ref = nil
 }
 
-func (obj *implEasyAnalyzer) ToPtr() uintptr {
+func (obj *implEasyAnalyzer) TOPTR() uintptr {
 	return uintptr(unsafe.Pointer(obj.ref))
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/f82b146c/go/lucy/index.go
----------------------------------------------------------------------
diff --git a/go/lucy/index.go b/go/lucy/index.go
index b72e487..338dffa 100644
--- a/go/lucy/index.go
+++ b/go/lucy/index.go
@@ -65,7 +65,7 @@ type OpenIndexerArgs struct {
 func OpenIndexer(args *OpenIndexerArgs) (obj Indexer, err error) {
 	var schemaC *C.lucy_Schema = nil
 	if args.Schema != nil {
-		schemaC = (*C.lucy_Schema)(unsafe.Pointer(args.Schema.ToPtr()))
+		schemaC = (*C.lucy_Schema)(unsafe.Pointer(args.Schema.TOPTR()))
 	}
 	switch args.Index.(type) {
 	case string:
@@ -75,7 +75,7 @@ func OpenIndexer(args *OpenIndexerArgs) (obj Indexer, err error) {
 	ixLoc := clownfish.NewString(args.Index.(string))
 	var managerC *C.lucy_IndexManager = nil
 	if args.Manager != nil {
-		managerC = (*C.lucy_IndexManager)(unsafe.Pointer(args.Manager.ToPtr()))
+		managerC = (*C.lucy_IndexManager)(unsafe.Pointer(args.Manager.TOPTR()))
 	}
 	var flags int32
 	if args.Create {
@@ -86,7 +86,7 @@ func OpenIndexer(args *OpenIndexerArgs) (obj Indexer, err error) {
 	}
 	err = clownfish.TrapErr(func() {
 		cfObj := C.lucy_Indexer_new(schemaC,
-			(*C.cfish_Obj)(unsafe.Pointer(ixLoc.ToPtr())),
+			(*C.cfish_Obj)(unsafe.Pointer(ixLoc.TOPTR())),
 			managerC, C.int32_t(flags))
 		obj = WRAPIndexer(unsafe.Pointer(cfObj))
 	})
@@ -141,7 +141,7 @@ func (obj *implIndexer) AddDoc(doc interface{}) error {
 		valueC := clownfish.NewString(value)
 		C.CFISH_Hash_Store(docFields,
 			(*C.cfish_Obj)(unsafe.Pointer(fieldC)),
-			C.cfish_inc_refcount(unsafe.Pointer(valueC.ToPtr())))
+			C.cfish_inc_refcount(unsafe.Pointer(valueC.TOPTR())))
 	}
 
 	// TODO create an additional method AddDocWithBoost which allows the
@@ -173,7 +173,7 @@ func (obj *implIndexer) findFieldC(name string) *C.cfish_String {
 			}
 		}
 	}
-	return (*C.cfish_String)(unsafe.Pointer(f.ToPtr()))
+	return (*C.cfish_String)(unsafe.Pointer(f.TOPTR()))
 }
 
 func (obj *implIndexer) Commit() error {
@@ -182,10 +182,10 @@ func (obj *implIndexer) Commit() error {
 	})
 }
 
-func (obj *implIndexer) ToPtr() uintptr {
+func (obj *implIndexer) TOPTR() uintptr {
 	return uintptr(unsafe.Pointer(obj.ref))
 }
 
-func (obj *implIndexManager) ToPtr() uintptr {
+func (obj *implIndexManager) TOPTR() uintptr {
 	return uintptr(unsafe.Pointer(obj.ref))
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/f82b146c/go/lucy/plan.go
----------------------------------------------------------------------
diff --git a/go/lucy/plan.go b/go/lucy/plan.go
index 618acd7..a2f4146 100644
--- a/go/lucy/plan.go
+++ b/go/lucy/plan.go
@@ -70,17 +70,17 @@ func (obj *implSchema) finalize() {
 func (obj *implSchema) SpecField(field string, fieldType FieldType) {
 	fieldCF := clownfish.NewString(field)
 	C.LUCY_Schema_Spec_Field(obj.ref,
-		(*C.cfish_String)(unsafe.Pointer(fieldCF.ToPtr())),
-		(*C.lucy_FieldType)(unsafe.Pointer(fieldType.ToPtr())))
+		(*C.cfish_String)(unsafe.Pointer(fieldCF.TOPTR())),
+		(*C.lucy_FieldType)(unsafe.Pointer(fieldType.TOPTR())))
 }
 
-func (obj *implSchema) ToPtr() uintptr {
+func (obj *implSchema) TOPTR() uintptr {
 	return uintptr(unsafe.Pointer(obj.ref))
 }
 
 func NewFullTextType(analyzer Analyzer) FullTextType {
 	cfObj := C.lucy_FullTextType_new(
-		(*C.lucy_Analyzer)(unsafe.Pointer(analyzer.ToPtr())))
+		(*C.lucy_Analyzer)(unsafe.Pointer(analyzer.TOPTR())))
 	return WRAPFullTextType(unsafe.Pointer(cfObj))
 }
 
@@ -95,7 +95,7 @@ func (obj *implFullTextType) finalize() {
 	obj.ref = nil
 }
 
-func (obj *implFullTextType) ToPtr() uintptr {
+func (obj *implFullTextType) TOPTR() uintptr {
 	return uintptr(unsafe.Pointer(obj.ref))
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/f82b146c/go/lucy/search.go
----------------------------------------------------------------------
diff --git a/go/lucy/search.go b/go/lucy/search.go
index 182074d..cc80272 100644
--- a/go/lucy/search.go
+++ b/go/lucy/search.go
@@ -81,7 +81,7 @@ func OpenIndexSearcher(index interface{}) (obj IndexSearcher, err error)
{
 	switch index.(type) {
 	case string:
 		ixLoc := clownfish.NewString(index.(string))
-		indexC = (*C.cfish_Obj)(unsafe.Pointer(ixLoc.ToPtr()))
+		indexC = (*C.cfish_Obj)(unsafe.Pointer(ixLoc.TOPTR()))
 	default:
 		panic("TODO: support Folder")
 	}
@@ -109,7 +109,7 @@ func (obj *implIndexSearcher) Close() error {
 	})
 }
 
-func (obj *implIndexSearcher) ToPtr() uintptr {
+func (obj *implIndexSearcher) TOPTR() uintptr {
 	return uintptr(unsafe.Pointer(obj.ref))
 }
 
@@ -117,14 +117,14 @@ func (obj *implIndexSearcher) Hits(query interface{}, offset uint32,
numWanted u
 	sortSpec SortSpec) (hits Hits, err error) {
 	var sortSpecC *C.lucy_SortSpec
 	if sortSpec != nil {
-		sortSpecC = (*C.lucy_SortSpec)(unsafe.Pointer(sortSpec.ToPtr()))
+		sortSpecC = (*C.lucy_SortSpec)(unsafe.Pointer(sortSpec.TOPTR()))
 	}
 	switch query.(type) {
 	case string:
 		queryStringC := clownfish.NewString(query.(string))
 		err = clownfish.TrapErr(func() {
 			hitsC := C.LUCY_IxSearcher_Hits(obj.ref,
-				(*C.cfish_Obj)(unsafe.Pointer(queryStringC.ToPtr())),
+				(*C.cfish_Obj)(unsafe.Pointer(queryStringC.TOPTR())),
 				C.uint32_t(offset), C.uint32_t(numWanted), sortSpecC)
 			hits = WRAPHits(unsafe.Pointer(hitsC))
 		})
@@ -140,7 +140,7 @@ func WRAPHits(ptr unsafe.Pointer) Hits {
 	return obj
 }
 
-func (obj *implHits) ToPtr() uintptr {
+func (obj *implHits) TOPTR() uintptr {
 	return uintptr(unsafe.Pointer(obj.ref))
 }
 


Mime
View raw message