mirror of https://bitbucket.org/ausocean/av.git
rtmp: remove unused memset
This commit is contained in:
parent
f25661ec2d
commit
43b3c8631d
|
@ -1683,12 +1683,6 @@ func memmove(to, from unsafe.Pointer, n uintptr) {
|
|||
}
|
||||
}
|
||||
|
||||
func memset(ptr *byte, val byte, num int) {
|
||||
for i := 0; i < num; i++ {
|
||||
(*[_Gi]byte)(unsafe.Pointer(ptr))[i] = val
|
||||
}
|
||||
}
|
||||
|
||||
// Creates a new C style string from a go string
|
||||
func goStrToCStr(str string) *byte {
|
||||
l := len(str)
|
||||
|
|
|
@ -53,22 +53,6 @@ var (
|
|||
errMsg = "Obtained: %v, but wanted: %v"
|
||||
)
|
||||
|
||||
func TestMemset(t *testing.T) {
|
||||
size := 10
|
||||
setNum := 5
|
||||
testVal := byte('A')
|
||||
mem := make([]byte, size)
|
||||
memset(&mem[0], testVal, setNum)
|
||||
for i := 0; i < size; i++ {
|
||||
if i > setNum-1 {
|
||||
testVal = byte(0)
|
||||
}
|
||||
if mem[i] != testVal {
|
||||
t.Errorf("mem doesn't match expected values at: %v", i)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestGoStrToCStr(t *testing.T) {
|
||||
goStr := "string\000"
|
||||
bStr := goStrToCStr(goStr)
|
||||
|
|
Loading…
Reference in New Issue