本文整理匯總了Golang中C.unsigned函數的典型用法代碼示例。如果您正苦於以下問題:Golang unsigned函數的具體用法?Golang unsigned怎麽用?Golang unsigned使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了unsigned函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: CreateLexicalBlock
// CreateCompileUnit creates lexical block debug metadata.
func (d *DIBuilder) CreateLexicalBlock(diScope Value, b DILexicalBlock) Value {
result := C.LLVMDIBuilderCreateLexicalBlock(
d.ref,
diScope.C,
b.File.C,
C.unsigned(b.Line),
C.unsigned(b.Column),
)
return Value{C: result}
}
示例2: CreateLexicalBlock
// CreateCompileUnit creates lexical block debug metadata.
func (d *DIBuilder) CreateLexicalBlock(diScope Metadata, b DILexicalBlock) Metadata {
result := C.LLVMDIBuilderCreateLexicalBlock(
d.ref,
diScope.C,
b.File.C,
C.unsigned(b.Line),
C.unsigned(b.Column),
)
return Metadata{C: result}
}
示例3: NewSignalInfo
func NewSignalInfo(rate float64, channels, precision uint, length uint64, mult *float64) *SignalInfo {
var s SignalInfo
s.cSignal = &C.sox_signalinfo_t{}
s.cSignal.rate = C.sox_rate_t(rate)
s.cSignal.channels = C.unsigned(channels)
s.cSignal.precision = C.unsigned(precision)
s.cSignal.length = C.sox_uint64_t(length)
if mult != nil {
var d C.double
d = C.double(*mult)
s.cSignal.mult = &d
}
return &s
}
示例4: InitRepository
func InitRepository(path string, bare bool) (*Repository, error) {
repo := new(Repository)
cpath := C.CString(path)
defer C.free(unsafe.Pointer(cpath))
cbare := C.unsigned(c_FALSE)
if bare {
cbare = C.unsigned(c_TRUE)
}
ecode := C.git_repository_init(&repo.git_repository, cpath, cbare)
if ecode != git_SUCCESS {
return nil, gitError()
}
return repo, nil
}
示例5: CreateAutoVariable
// CreateAutoVariable creates local variable debug metadata.
func (d *DIBuilder) CreateAutoVariable(scope Metadata, v DIAutoVariable) Metadata {
name := C.CString(v.Name)
defer C.free(unsafe.Pointer(name))
result := C.LLVMDIBuilderCreateAutoVariable(
d.ref,
scope.C,
name,
v.File.C,
C.unsigned(v.Line),
v.Type.C,
boolToCInt(v.AlwaysPreserve),
C.unsigned(v.Flags),
)
return Metadata{C: result}
}
示例6: NewFunction
func (ctx *Context) NewFunction(name string, parameters []string, body string, source_url string, starting_line_number int) (*Object, error) {
Cname := NewString(name)
defer Cname.Release()
Cparameters := make([]C.JSStringRef, len(parameters))
defer release_jsstringref_array(Cparameters)
for i := 0; i < len(parameters); i++ {
Cparameters[i] = (C.JSStringRef)(unsafe.Pointer(NewString(parameters[i])))
}
Cbody := NewString(body)
defer Cbody.Release()
var sourceRef *String
if source_url != "" {
sourceRef = NewString(source_url)
defer sourceRef.Release()
}
errVal := ctx.newErrorValue()
ret := C.JSObjectMakeFunction(ctx.ref,
(C.JSStringRef)(unsafe.Pointer(Cname)),
C.unsigned(len(Cparameters)), &Cparameters[0],
(C.JSStringRef)(unsafe.Pointer(Cbody)),
(C.JSStringRef)(unsafe.Pointer(sourceRef)),
C.int(starting_line_number), &errVal.ref)
if errVal.ref != nil {
return nil, errVal
}
return ctx.newObject(ret), nil
}
示例7: New
func New(c *Config) *Disassembler {
if c.Buf != nil && c.Reader != nil {
panic("New: must pass either bytes or a Reader")
}
d := &Disassembler{
bytes: c.Buf,
r: c.Reader,
}
C.ud_init(&d.u)
C.ud_set_user_opaque_data(&d.u, unsafe.Pointer(d))
if d.bytes != nil {
C.ud_set_input_buffer(&d.u, (*C.uint8_t)(unsafe.Pointer(&d.bytes[0])), C.size_t(len(d.bytes)))
} else {
C.ud_set_input_hook(&d.u, (*[0]byte)(C.ud_input_hook))
}
if c.Bits != 0 {
C.ud_set_mode(&d.u, C.uint8_t(c.Bits))
}
if c.PC != 0 {
C.ud_set_pc(&d.u, C.uint64_t(c.PC))
}
// We rely on the fact that the zero value is also the default
// to udis86, and don't check if it is set.
C.ud_set_vendor(&d.u, C.unsigned(c.Vendor))
switch c.Syntax {
case SyntaxIntel:
C.ud_set_syntax(&d.u, (*[0]byte)(C.UD_SYN_INTEL))
case SyntaxATT:
C.ud_set_syntax(&d.u, (*[0]byte)(C.UD_SYN_ATT))
}
return d
}
示例8: RemoveOverlaps
func RemoveOverlaps(rects Rectangles) {
if rects.Len() == 0 {
return
}
rcv := make([]C.struct_rect, rects.Len())
for i := 0; i < rects.Len(); i++ {
rc := &rcv[i]
x0, y0, x1, y1 := rects.Position(i)
rc.x0 = C.double(x0)
rc.x1 = C.double(x1)
rc.y0 = C.double(y0)
rc.y1 = C.double(y1)
rc.fixed = boolchar(rects.Fixed(i))
rc.allow_overlap = boolchar(rects.AllowOverlap(i))
}
removeOverlapsMtx.Lock()
C.remove_overlaps(&rcv[0], C.unsigned(len(rcv)))
removeOverlapsMtx.Unlock()
for i := 0; i < rects.Len(); i++ {
rc := &rcv[i]
x0 := float64(rc.x0)
x1 := float64(rc.x1)
y0 := float64(rc.y0)
y1 := float64(rc.y1)
rects.SetPosition(i, x0, y0, x1, y1)
}
}
示例9: CreateLocalVariable
// CreateLocalVariable creates local variable debug metadata.
func (d *DIBuilder) CreateLocalVariable(scope Value, v DILocalVariable) Value {
name := C.CString(v.Name)
defer C.free(unsafe.Pointer(name))
result := C.LLVMDIBuilderCreateLocalVariable(
d.ref,
C.unsigned(v.Tag),
scope.C,
name,
v.File.C,
C.unsigned(v.Line),
v.Type.C,
boolToCInt(v.AlwaysPreserve),
C.unsigned(v.Flags),
C.unsigned(v.ArgNo),
)
return Value{C: result}
}
示例10: CreateReplaceableCompositeType
// CreateReplaceableCompositeType creates replaceable composite type debug metadata.
func (d *DIBuilder) CreateReplaceableCompositeType(scope Metadata, t DIReplaceableCompositeType) Metadata {
name := C.CString(t.Name)
defer C.free(unsafe.Pointer(name))
result := C.LLVMDIBuilderCreateReplaceableCompositeType(
d.ref,
C.unsigned(t.Tag),
name,
scope.C,
t.File.C,
C.unsigned(t.Line),
C.unsigned(t.RuntimeLang),
C.uint64_t(t.SizeInBits),
C.uint32_t(t.AlignInBits),
C.unsigned(t.Flags),
)
return Metadata{C: result}
}
示例11: CreateMemberType
// CreateMemberType creates struct type debug metadata.
func (d *DIBuilder) CreateMemberType(scope Metadata, t DIMemberType) Metadata {
name := C.CString(t.Name)
defer C.free(unsafe.Pointer(name))
result := C.LLVMDIBuilderCreateMemberType(
d.ref,
scope.C,
name,
t.File.C,
C.unsigned(t.Line),
C.uint64_t(t.SizeInBits),
C.uint32_t(t.AlignInBits),
C.uint64_t(t.OffsetInBits),
C.unsigned(t.Flags),
t.Type.C,
)
return Metadata{C: result}
}
示例12: CreateMemberType
// CreateMemberType creates struct type debug metadata.
func (d *DIBuilder) CreateMemberType(scope Value, t DIMemberType) Value {
name := C.CString(t.Name)
result := C.DIBuilderCreateMemberType(
d.ref,
scope.C,
name,
t.File.C,
C.unsigned(t.Line),
C.uint64_t(t.SizeInBits),
C.uint64_t(t.AlignInBits),
C.uint64_t(t.OffsetInBits),
C.unsigned(t.Flags),
t.Type.C,
)
C.free(unsafe.Pointer(name))
return Value{C: result}
}
示例13: CreateStructType
// CreateStructType creates struct type debug metadata.
func (d *DIBuilder) CreateStructType(scope Metadata, t DIStructType) Metadata {
elements := d.getOrCreateArray(t.Elements)
name := C.CString(t.Name)
defer C.free(unsafe.Pointer(name))
result := C.LLVMDIBuilderCreateStructType(
d.ref,
scope.C,
name,
t.File.C,
C.unsigned(t.Line),
C.uint64_t(t.SizeInBits),
C.uint32_t(t.AlignInBits),
C.unsigned(t.Flags),
t.DerivedFrom.C,
elements.C,
)
return Metadata{C: result}
}
示例14: CheckStateNotify
func CheckStateNotify(param1 uint32) error {
code, err := C.T32_CheckStateNotify(C.unsigned(param1))
if err != nil {
return err
} else if code != 0 {
return errors.New("T32_CheckStateNotify Error")
}
return nil
}
示例15: InitAuto
// ChannelMap.InitAuto initializes the ChannelMap using the given mapping
// and number of channels.
//
// If there is no default channel map known for the given number of channels
// and mapping, then the ChannelMap remains unchanged and an error is returned.
func (m *ChannelMap) InitAuto(channels uint, mapping ChannelMapDef) error {
cmap := &C.pa_channel_map{}
mapped := C.pa_channel_map_init_auto(cmap, C.unsigned(channels), C.pa_channel_map_def_t(mapping))
if mapped == nil {
return fmt.Errorf("Could not map %d channels with ChannelMapDef %v", channels, mapping)
}
m.fromC(cmap)
return nil
}