소스 검색

Merge pull request #208 from oflebbe/master

simple cast enough to convert
Daniel Salvadori 4 년 전
부모
커밋
9c2abe60be
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      math32/array.go

+ 2 - 2
math32/array.go

@@ -209,7 +209,7 @@ func (a ArrayF32) SetColor4(pos int, v *Color4) {
 // ToFloat32 converts this array to an array of float32
 func (a ArrayF32) ToFloat32() []float32 {
 
-	return (*[1 << 27]float32)(unsafe.Pointer(&a[0]))[:len(a)]
+	return a
 }
 
 // ArrayU32 is a slice of uint32 with additional convenience methods
@@ -249,5 +249,5 @@ func (a *ArrayU32) Append(v ...uint32) {
 // ToUint32 converts this array to an array of uint32
 func (a ArrayU32) ToUint32() []uint32 {
 
-	return (*[1 << 27]uint32)(unsafe.Pointer(&a[0]))[:len(a)]
+	return a
 }