Ejemplo n.º 1
0
// 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))
}
Ejemplo n.º 2
0
func convertFloat64ToCFNumber(f float64) C.CFNumberRef {
	double := C.double(f)
	return C.CFNumberCreate(nil, C.kCFNumberDoubleType, unsafe.Pointer(&double))
}
Ejemplo n.º 3
0
// ===== 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))
}