Small cleanup (#877)

* Remove unused variables and constants
* Remove redundant return statement
* Change flock.NewFlock to flock.New
This commit is contained in:
Acid147 2019-05-26 11:06:43 +02:00 committed by Hajime Hoshi
parent f9cec31bf6
commit 21abd85a63
5 changed files with 1 additions and 13 deletions

View File

@ -71,7 +71,6 @@ type decoder interface {
type decoded struct { type decoded struct {
totalBytes int totalBytes int
readBytes int
posInBytes int posInBytes int
source io.Closer source io.Closer
decoder decoder decoder decoder

View File

@ -151,11 +151,6 @@ var (
zeroProgram program zeroProgram program
) )
const (
maxTriangles = graphics.IndicesNum / 3
maxQuads = maxTriangles / 2
)
// reset resets or initializes the OpenGL state. // reset resets or initializes the OpenGL state.
func (s *openGLState) reset(context *context) error { func (s *openGLState) reset(context *context) error {
if err := context.reset(); err != nil { if err := context.reset(); err != nil {

View File

@ -432,11 +432,6 @@ func TestRestoreRecursive(t *testing.T) {
} }
func TestReplacePixels(t *testing.T) { func TestReplacePixels(t *testing.T) {
const (
w = 17
h = 31
)
img := NewImage(17, 31) img := NewImage(17, 31)
defer img.Dispose() defer img.Dispose()

View File

@ -468,7 +468,6 @@ func (i *Image) allocate(shareable bool) {
i.backend = b i.backend = b
i.node = n i.node = n
runtime.SetFinalizer(i, (*Image).Dispose) runtime.SetFinalizer(i, (*Image).Dispose)
return
} }
func (i *Image) MakeVolatile() { func (i *Image) MakeVolatile() {

View File

@ -28,7 +28,7 @@ import (
"github.com/gofrs/flock" "github.com/gofrs/flock"
) )
var theLock = flock.NewFlock(filepath.Join(os.TempDir(), "ebitentest")) var theLock = flock.New(filepath.Join(os.TempDir(), "ebitentest"))
func Lock() { func Lock() {
if err := theLock.Lock(); err != nil { if err := theLock.Lock(); err != nil {