예제 #1
0
파일: convert.go 프로젝트: jcf/go-osx-plist
// there is no uint64 CFNumber type, so we have to use the SInt64 one
func convertUInt32ToCFNumber(u uint32) C.CFNumberRef {
	sint := C.SInt64(u)
	return C.CFNumberCreate(nil, C.kCFNumberSInt64Type, unsafe.Pointer(&sint))
}
예제 #2
0
파일: convert.go 프로젝트: jcf/go-osx-plist
func convertFloat64ToCFNumber(f float64) C.CFNumberRef {
	double := C.double(f)
	return C.CFNumberCreate(nil, C.kCFNumberDoubleType, unsafe.Pointer(&double))
}
예제 #3
0
파일: convert.go 프로젝트: jcf/go-osx-plist
// ===== CFNumber =====
// for simplicity's sake, only include the largest of any given numeric datatype
func convertInt64ToCFNumber(i int64) C.CFNumberRef {
	sint := C.SInt64(i)
	return C.CFNumberCreate(nil, C.kCFNumberSInt64Type, unsafe.Pointer(&sint))
}