all: apply suggestions from staticcheck.io

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-06-03 12:22:52 +02:00
committed by Elias Naur
parent 11192a5142
commit 916efb4612
13 changed files with 7 additions and 219 deletions
+1 -8
View File
@@ -69,12 +69,6 @@ type strokeState struct {
type StrokeQuads []StrokeQuad
func (qs *StrokeQuads) setContour(n uint32) {
for i := range *qs {
(*qs)[i].Contour = n
}
}
func (qs *StrokeQuads) pen() f32.Point {
return (*qs)[len(*qs)-1].Quad.To
}
@@ -330,8 +324,7 @@ func strokePathNorm(p0, p1, p2 f32.Point, t, d float32) f32.Point {
panic("impossible")
}
func rot90CW(p f32.Point) f32.Point { return f32.Pt(+p.Y, -p.X) }
func rot90CCW(p f32.Point) f32.Point { return f32.Pt(-p.Y, +p.X) }
func rot90CW(p f32.Point) f32.Point { return f32.Pt(+p.Y, -p.X) }
// cosPt returns the cosine of the opening angle between p and q.
func cosPt(p, q f32.Point) float32 {
+1 -1
View File
@@ -1750,7 +1750,7 @@ func AllocateDescriptorSets(d Device, pool DescriptorPool, layout DescriptorSetL
descriptorSetCount: C.uint32_t(count),
pSetLayouts: &layouts[0],
}
sets := make([]DescriptorSet, count, count)
sets := make([]DescriptorSet, count)
if err := vkErr(C.vkAllocateDescriptorSets(funcs.vkAllocateDescriptorSets, d, inf, &sets[0])); err != nil {
return nil, fmt.Errorf("vulkan: vkAllocateDescriptorSets: %w", err)
}