all: fix some issues spotted by static analysis

First, vet was upset by two incorrect fmt verbs. One was an extra %x,
when there was just one argument, so remove it. Another was a %p with a
non-pointer. It's a struct, so for now simply use %#v.

Second, staticcheck found some unused or unnecessary bits of code;
remove the obvious ones.

Finally, staticcheck also complained about some error strings which were
capitalized or had periods. Adjust those, which also makes all error
messages more consistent.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
This commit is contained in:
Daniel Martí
2019-08-25 16:26:59 +01:00
committed by Elias Naur
parent 9136c72425
commit 2542c55e9d
7 changed files with 9 additions and 11 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ func (c *context) Present() error {
c.srgbFBO.Blit()
}
if !eglSwapBuffers(c.eglCtx.disp, c.eglSurf) {
return fmt.Errorf("eglSwapBuffers failed (%x%x)", eglGetError())
return fmt.Errorf("eglSwapBuffers failed (%x)", eglGetError())
}
if c.srgbFBO != nil {
c.srgbFBO.AfterPresent()