// BuildAudioCVT initializes an AudioCVT structure for conversion.
// (https://wiki.libsdl.org/SDL_BuildAudioCVT)
491229
func BuildAudioCVT(cvt *AudioCVT, srcFormat AudioFormat, srcChannels uint8, srcRate int, dstFormat AudioFormat, dstChannels uint8, dstRate int) (converted bool, err error) {
	switch int(C.SDL_BuildAudioCVT(cvt.cptr(), srcFormat.c(), C.Uint8(srcChannels), C.int(srcRate), dstFormat.c(), C.Uint8(dstChannels), C.int(dstRate))) {
	case 1:
		return true, nil
	case 0:
		return false, nil
	}
	return false, GetError()
}
741099
func (p *ExamplePlugin) buildData(stringVal string, uint32Val uint32, boolVal bool) *etcdexample.EtcdExample {
	return &etcdexample.EtcdExample{
		StringVal: stringVal,
		Uint32Val: uint32Val,
		BoolVal:   boolVal,
	}
}
518843
func Convert_v1_VolumeDevice_To_core_VolumeDevice(in *v1.VolumeDevice, out *core.VolumeDevice, s conversion.Scope) error {
	return autoConvert_v1_VolumeDevice_To_core_VolumeDevice(in, out, s)
}
1134006
func AudioStart(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "audiostart", Listener: listener}
}
185297
func (b *StorageAclBuilder) Build(c *fi.ModelBuilderContext) error {
	serviceAccount, err := b.Cloud.ServiceAccount()
	if err != nil {
		return fmt.Errorf("error fetching ServiceAccount: %v", err)
	}

	if featureflag.GoogleCloudBucketACL.Enabled() {
		clusterPath := b.Cluster.Spec.ConfigBase
		p, err := vfs.Context.BuildVfsPath(clusterPath)
		if err != nil {
			return fmt.Errorf("cannot parse cluster path %q: %v", clusterPath, err)
		}

		switch p := p.(type) {
		case *vfs.GSPath:
			// It's not ideal that we have to do this at the bucket level,
			// but GCS doesn't seem to have a way to do subtrees (like AWS IAM does)
			// Note this permission only lets us list objects, not read them
			c.AddTask(&gcetasks.StorageBucketAcl{
				Name:      s("serviceaccount-statestore-list"),
				Lifecycle: b.Lifecycle,
				Bucket:    s(p.Bucket()),
				Entity:    s("user-" + serviceAccount),
				Role:      s("READER"),
			})
		}
	}

	glog.Warningf("we need to split master / node roles")
	role := kops.InstanceGroupRoleMaster
	writeablePaths, err := iam.WriteableVFSPaths(b.Cluster, role)
	if err != nil {
		return err
	}

	buckets := sets.NewString()
	for _, p := range writeablePaths {
		if gcsPath, ok := p.(*vfs.GSPath); ok {
			bucket := gcsPath.Bucket()
			if buckets.Has(bucket) {
				continue
			}

			glog.Warningf("adding bucket level write ACL to gs://%s to support etcd backup", bucket)

			c.AddTask(&gcetasks.StorageBucketAcl{
				Name:      s("serviceaccount-backup-readwrite-" + bucket),
				Lifecycle: b.Lifecycle,
				Bucket:    s(bucket),
				Entity:    s("user-" + serviceAccount),
				Role:      s("WRITER"),
			})

			buckets.Insert(bucket)
		} else {
			glog.Warningf("unknown path, can't apply IAM policy: %q", p)
		}
	}

	return nil
}
341911
func buildTransport(cv *buildable, k *Kit) (transport.Transport, error) {
	result, err := cv.Build(k)
	if err != nil {
		return nil, err
	}
	return result.(transport.Transport), nil
}
13213
func VideoInit(driverName string) error {
	return errorFromInt(int(
		C.SDL_VideoInit(C.CString(driverName))))
}
960099
func (cv *buildable) Build(args ...interface{}) (interface{}, error) {
	// This function roughly translates to,
	//
	// 	return factory(inputData, args...)

	callArgs := make([]reflect.Value, len(args)+1)
	callArgs[0] = cv.inputData

	for i, v := range args {
		if value, ok := v.(reflect.Value); ok {
			callArgs[i+1] = value
		} else {
			callArgs[i+1] = reflect.ValueOf(v)
		}
	}

	result := cv.factory.Call(callArgs)
	err, _ := result[1].Interface().(error)
	return result[0].Interface(), err
}
1227932
func QueueAudio(dev AudioDeviceID, data []byte) error {
	sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&data))
	_data := unsafe.Pointer(sliceHeader.Data)
	_len := (C.Uint32)(sliceHeader.Len)
	if C.SDL_QueueAudio(dev.c(), _data, _len) != 0 {
		return GetError()
	}
	return nil
}
729803
func (v *VersionInfo) Build() {
	vi := VSVersionInfo{}

	// 0 for binary, 1 for text
	vi.WType = 0x00

	vi.SzKey = padString("VS_VERSION_INFO", 0)

	// Align to 32-bit boundary
	// 6 is for the size of WLength, WValueLength, and WType (each is 1 word or 2 bytes: FF FF)
	soFar := 2
	for (len(vi.SzKey)+6+soFar)%4 != 0 {
		soFar += 2
	}
	vi.Padding1 = padBytes(soFar)
	soFar += len(vi.SzKey)

	vi.Value = buildFixedFileInfo(v)

	// Length of VSFixedFileInfo (always the same)
	vi.WValueLength = 0x34

	// Never needs padding, not included in WLength
	vi.Padding2 = []byte{}

	// Build strings
	vi.Children = buildStringFileInfo(v)

	// Build translation
	vi.Children2 = buildVarFileInfo(v.VarFileInfo)

	// Calculate the total size
	vi.WLength += 6 + uint16(soFar) + vi.WValueLength + vi.Children.WLength + vi.Children2.WLength

	v.Structure = vi
}
1134367
func AudioEnd(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "audioend", Listener: listener}
}
1314103
func (cvt AudioCVT) BufAsSlice() []byte {
	var b []byte
	sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))
	sliceHeader.Len = int(cvt.LenCVT)
	sliceHeader.Cap = int(cvt.Len * cvt.LenMult)
	sliceHeader.Data = uintptr(unsafe.Pointer(cvt.Buf))
	return b
}
519631
func LoadWAVRW(src *RWops, freeSrc bool) ([]byte, *AudioSpec) {
	var _audioBuf *C.Uint8
	var _audioLen C.Uint32
	audioSpec := (*AudioSpec)(unsafe.Pointer(C.SDL_LoadWAV_RW(src.cptr(), C.int(Btoi(freeSrc)), (&AudioSpec{}).cptr(), &_audioBuf, &_audioLen)))

	var b []byte
	sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))
	sliceHeader.Len = (int)(_audioLen)
	sliceHeader.Cap = (int)(_audioLen)
	sliceHeader.Data = uintptr(unsafe.Pointer(_audioBuf))
	return b, audioSpec
}
1173567
func (s *CreatePresetInput) SetAudio(v *AudioParameters) *CreatePresetInput {
	s.Audio = v
	return s
}
625608
func Convert_v1_BuildSpec_To_build_BuildSpec(in *v1.BuildSpec, out *build.BuildSpec, s conversion.Scope) error {
	return autoConvert_v1_BuildSpec_To_build_BuildSpec(in, out, s)
}
10837
func Convert_v1_ImageLabel_To_build_ImageLabel(in *v1.ImageLabel, out *build.ImageLabel, s conversion.Scope) error {
	return autoConvert_v1_ImageLabel_To_build_ImageLabel(in, out, s)
}
47633
func Convert_v1_BuildSource_To_build_BuildSource(in *v1.BuildSource, out *build.BuildSource, s conversion.Scope) error {
	return autoConvert_v1_BuildSource_To_build_BuildSource(in, out, s)
}