fix fu*K bugs

This commit is contained in:
TonyChyi 2018-03-20 10:06:14 +08:00
parent 334237cac3
commit 7bc1a238ed

View File

@ -18,7 +18,7 @@ import (
func NewClient(name string) error { func NewClient(name string) error {
cDevName := C.CString(name) cDevName := C.CString(name)
defer C.free(unsafe.Pointer(cDevName)) defer C.free(unsafe.Pointer(cDevName))
status = int(C.new_client(cDevName)) var status = int(C.new_client(cDevName))
if status != 0 { if status != 0 {
stage, errCode := resolveErrCode(status) stage, errCode := resolveErrCode(status)
switch stage { switch stage {
@ -36,7 +36,7 @@ func NewClient(name string) error {
func NewPort(name string) error { func NewPort(name string) error {
cPortName := C.CString(name) cPortName := C.CString(name)
defer C.free(unsafe.Pointer(cPortName)) defer C.free(unsafe.Pointer(cPortName))
status = int(C.new_port(cPortName)) var status = int(C.new_port(cPortName))
if status != 0 { if status != 0 {
return fmt.Errorf("Error while createing sequencer port. %d", status) return fmt.Errorf("Error while createing sequencer port. %d", status)
} }