mirror of https://bitbucket.org/ausocean/av.git
rtmp: remove redundant reconversions
This commit is contained in:
parent
05bed207b3
commit
4fa4dce908
|
@ -2230,9 +2230,9 @@ func memcmp(a, b unsafe.Pointer, size int) int {
|
|||
return 0
|
||||
}
|
||||
|
||||
func memset(ptr *byte, val int, num int) {
|
||||
func memset(ptr *byte, val byte, num int) {
|
||||
for i := 0; i < num; i++ {
|
||||
(*[_Gi]byte)(unsafe.Pointer(ptr))[i] = byte(val)
|
||||
(*[_Gi]byte)(unsafe.Pointer(ptr))[i] = val
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2343,7 +2343,7 @@ func malloc(nOfBytes uintptr) unsafe.Pointer {
|
|||
|
||||
func calloc(val byte, noOfBytes uintptr) unsafe.Pointer {
|
||||
mem := malloc(noOfBytes)
|
||||
memset((*byte)(mem), int(val), int(noOfBytes))
|
||||
memset((*byte)(mem), val, int(noOfBytes))
|
||||
return mem
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue