summaryrefslogtreecommitdiff
path: root/gtkcasts_unix.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-26 22:51:12 -0400
committerPietro Gagliardi <[email protected]>2014-04-26 22:51:12 -0400
commit77297672dd67df94abbe23d494fa27638d0c15c3 (patch)
tree54c47131ec0de90e0c7dfc2eccbce6ad246d04cb /gtkcasts_unix.go
parentf75714a6bc9e8cf527df728263bec7f043e0b777 (diff)
Made the C.GoString() part of fromgchar() in gtkcasts_unix.go to reduce the number of calls to that function elsewhere (makes things simpler).
Diffstat (limited to 'gtkcasts_unix.go')
-rw-r--r--gtkcasts_unix.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/gtkcasts_unix.go b/gtkcasts_unix.go
index 133f596..287ed58 100644
--- a/gtkcasts_unix.go
+++ b/gtkcasts_unix.go
@@ -28,9 +28,9 @@ func togbool(b bool) C.gboolean {
return C.FALSE
}
-// TODO wrap in C.GoString()?
-func fromgchar(what *C.gchar) *C.char {
- return (*C.char)(unsafe.Pointer(what))
+func fromgchar(what *C.gchar) string {
+ cstr := (*C.char)(unsafe.Pointer(what))
+ return C.GoString(cstr)
}
func togchar(what *C.char) *C.gchar {