rtmp: remove unused memset

This commit is contained in:
Dan Kortschak 2018-09-19 16:22:09 +09:30
parent f25661ec2d
commit 43b3c8631d
2 changed files with 0 additions and 22 deletions

View File

@ -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)

View File

@ -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)