diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-25 16:20:10 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-25 16:20:10 -0400 |
| commit | 6fcfbd9bdb52d662e9828fd84e7890ccc6a52549 (patch) | |
| tree | 94b4a01b17685c42d60adc1415c09466b6259697 | |
| parent | b7fd5f035eaaa30c8ae66ffaae1b70017b7360c9 (diff) | |
Moved some functions around.
| -rw-r--r-- | redo/common_windows.go | 11 | ||||
| -rw-r--r-- | redo/dialog_windows.go | 12 |
2 files changed, 11 insertions, 12 deletions
diff --git a/redo/common_windows.go b/redo/common_windows.go index 3ec4ddd..65eb781 100644 --- a/redo/common_windows.go +++ b/redo/common_windows.go @@ -44,3 +44,14 @@ func getWindowText(hwnd C.HWND) string { C.LPWSTR(unsafe.Pointer(&buf[0]))) return syscall.UTF16ToString(buf) } + +func wstrToString(wstr *C.WCHAR) string { + n := C.wcslen((*C.wchar_t)(unsafe.Pointer(wstr))) + xbuf := &reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(wstr)), + Len: int(n + 1), + Cap: int(n + 1), + } + buf := (*[]uint16)(unsafe.Pointer(xbuf)) + return syscall.UTF16ToString(*buf) +} diff --git a/redo/dialog_windows.go b/redo/dialog_windows.go index 0346f56..1ca7771 100644 --- a/redo/dialog_windows.go +++ b/redo/dialog_windows.go @@ -11,18 +11,6 @@ import ( // #include "winapi_windows.h" import "C" -// TODO move to common_windows.go -func wstrToString(wstr *C.WCHAR) string { - n := C.wcslen((*C.wchar_t)(unsafe.Pointer(wstr))) - xbuf := &reflect.SliceHeader{ - Data: uintptr(unsafe.Pointer(wstr)), - Len: int(n + 1), - Cap: int(n + 1), - } - buf := (*[]uint16)(unsafe.Pointer(xbuf)) - return syscall.UTF16ToString(*buf) -} - func openFile() string { name := C.openFile() if name == nil { |
