Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix some go 1 stuff

  • Loading branch information...
commit 7ca486cebc872833d046b45a0a4b1293f5888ecb 1 parent ccec594
@mkb218 authored
View
20 src/sndfile/Makefile
@@ -1,20 +0,0 @@
-# Makefile generated by gb: http://go-gb.googlecode.com
-# gb provides configuration-free building and distributing
-
-include $(GOROOT)/src/Make.inc
-
-TARG=sndfile
-GOFILES=\
-
-CGO_OFILES=\
- virtual.o
-
-CGOFILES=\
- sndfile.go\
- command.go\
- raw.go\
- virtual.go
-
-CLEANFILES+=leout.wav truncout.aiff addpeakchunk1.aiff norm.aiff funky2.aiff update broadcast musicenztrumentz.aiff rawtest openfd getsetstring.wav cliptest.aiff ambisonictest.wav channelmaps scalefactor.aiff
-
-include $(GOROOT)/src/Make.pkg
View
2  src/sndfile/command.go
@@ -1,6 +1,6 @@
package sndfile
-// #cgo LDFLAGS: -lsndfile
+// #cgo pkg-config: sndfile
// #include <stdlib.h>
// #include <sndfile.h>
// #include <string.h>
View
2  src/sndfile/raw.go
@@ -1,6 +1,6 @@
package sndfile
-// #cgo LDFLAGS: -lsndfile
+// #cgo pkg-config: sndfile
// #import <sndfile.h>
import "C"
View
10 src/sndfile/sndfile.go
@@ -1,8 +1,8 @@
package sndfile
-// The sndfile package is a binding for libsndfile. It packages the libsndfile API in a go-like manner. Note for macports users: set environment variables CGO_CFLAGS and CGO_LDFLAGS to "-I/opt/local/include" and "-L/opt/local/lib" respectively.
+// The sndfile package is a binding for libsndfile. It packages the libsndfile API in a go-like manner.
-// #cgo LDFLAGS: -lsndfile
+// #cgo pkg-config: sndfile
// #include <stdlib.h>
// #include <sndfile.h>
import "C"
@@ -21,7 +21,7 @@ type File struct {
s *C.SNDFILE
Format Info
virtual *virtualIo // really only necessary to keep a reference so GC doesn't eat it
- fd int
+ fd uintptr
closeFd bool
closed bool
}
@@ -181,7 +181,7 @@ func sfclose(f *File) {
// This probably won't work on windows, because go uses handles instead of integer file descriptors on Windows. Unfortunately I have no way to test.
// The mode and info arguments, and the return values, are the same as for Open().
// close_desc should be true if you want the library to close the file descriptor when you close the sndfile.File object
-func OpenFd(fd int, mode Mode, info *Info, close_desc bool) (o *File, err error) {
+func OpenFd(fd uintptr, mode Mode, info *Info, close_desc bool) (o *File, err error) {
if info == nil {
return nil, errors.New("nil pointer passed to open")
}
@@ -225,7 +225,7 @@ func (f *File) Seek(frames int64, w Whence) (offset int64, err error) {
return
}
-// The close function closes the file, deallocates its internal buffers and returns a non-nil error value in cas of error
+// The close function closes the file, deallocates its internal buffers and returns a non-nil error value in case of error
func (f *File) Close() (err error) {
if f.closed {
return nil
View
2  src/sndfile/virtual.c
@@ -20,7 +20,7 @@ sf_count_t gocall_read (void *ptr, sf_count_t count, void *user_data) {
sf_count_t gocall_write (const void *ptr, sf_count_t count, void *user_data) {
// printf("write %p\n", gsfWrite);
- return gsfWrite(ptr, count, user_data);
+ return gsfWrite((void *)ptr, count, user_data);
}
sf_count_t gocall_tell (void *user_data) {
Please sign in to comment.
Something went wrong with that request. Please try again.