From a820246f64b4c84bd82714551ae46c0e61e5cbe3 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 26 Jun 2023 23:00:39 +0100 Subject: [PATCH] Keep -vet happy --- vendor/fontstash/fontstash.odin | 6 +++--- vendor/nanovg/gl/gl.odin | 8 ++++---- vendor/nanovg/nanovg.odin | 16 ++++++++-------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/vendor/fontstash/fontstash.odin b/vendor/fontstash/fontstash.odin index 7d9926cb1..67b2c781c 100644 --- a/vendor/fontstash/fontstash.odin +++ b/vendor/fontstash/fontstash.odin @@ -146,7 +146,7 @@ Init :: proc(using ctx: ^FontContext, w, h: int, loc: QuadLocation) { } Destroy :: proc(using ctx: ^FontContext) { - for font in &fonts { + for font in fonts { if font.freeLoadedData { delete(font.loadedData) } @@ -166,7 +166,7 @@ Reset :: proc(using ctx: ^FontContext) { __dirtyRectReset(ctx) mem.zero_slice(textureData) - for font in &fonts { + for &font in fonts { __lutReset(&font) } @@ -722,7 +722,7 @@ ResetAtlas :: proc(ctx: ^FontContext, width, height: int, allocator := context.a ctx.dirtyRect[3] = 0 // reset fonts - for font in &ctx.fonts { + for &font in ctx.fonts { clear(&font.glyphs) __lutReset(&font) } diff --git a/vendor/nanovg/gl/gl.odin b/vendor/nanovg/gl/gl.odin index 34b9f99fb..50df6e1b5 100644 --- a/vendor/nanovg/gl/gl.odin +++ b/vendor/nanovg/gl/gl.odin @@ -255,7 +255,7 @@ __blendFuncSeparate :: proc(ctx: ^Context, blend: ^Blend) { } __allocTexture :: proc(ctx: ^Context) -> (tex: ^Texture) { - for texture in &ctx.textures { + for &texture in ctx.textures { if texture.id == 0 { tex = &texture break @@ -275,7 +275,7 @@ __allocTexture :: proc(ctx: ^Context) -> (tex: ^Texture) { } __findTexture :: proc(ctx: ^Context, id: int) -> ^Texture { - for texture in &ctx.textures { + for &texture in ctx.textures { if texture.id == id { return &texture } @@ -285,7 +285,7 @@ __findTexture :: proc(ctx: ^Context, id: int) -> ^Texture { } __deleteTexture :: proc(ctx: ^Context, id: int) -> bool { - for texture, i in &ctx.textures { + for &texture, i in ctx.textures { if texture.id == id { if texture.tex != 0 && (.NO_DELETE not_in texture.flags) { gl.DeleteTextures(1, &texture.tex) @@ -1302,7 +1302,7 @@ __renderDelete :: proc(uptr: rawptr) { gl.DeleteBuffers(1, &ctx.vertBuf) } - for texture in &ctx.textures { + for &texture in ctx.textures { if texture.tex != 0 && (.NO_DELETE not_in texture.flags) { gl.DeleteTextures(1, &texture.tex) } diff --git a/vendor/nanovg/nanovg.odin b/vendor/nanovg/nanovg.odin index f22f9c425..bc0335f6a 100644 --- a/vendor/nanovg/nanovg.odin +++ b/vendor/nanovg/nanovg.odin @@ -326,7 +326,7 @@ DeleteInternal :: proc(ctx: ^Context) { __deletePathCache(ctx.cache) fontstash.Destroy(&ctx.fs) - for image in &ctx.fontImages { + for &image in ctx.fontImages { if image != 0 { DeleteImage(ctx, image) } @@ -1874,7 +1874,7 @@ __calculateJoins :: proc( } // Calculate which joins needs extra vertices to append, and gather vertex count. - for path in &cache.paths { + for &path in cache.paths { pts := cache.points[path.first:] p0 := &pts[path.count-1] p1 := &pts[0] @@ -1968,7 +1968,7 @@ __expandStroke :: proc( // Calculate max vertex usage. cverts := 0 - for path in &cache.paths { + for &path in cache.paths { loop := path.closed // TODO check if f32 calculation necessary? @@ -2097,7 +2097,7 @@ __expandFill :: proc( // Calculate max vertex usage. cverts := 0 - for path in &cache.paths { + for &path in cache.paths { cverts += path.count + path.nbevel + 1 if fringe { @@ -2109,7 +2109,7 @@ __expandFill :: proc( verts := __allocTempVerts(ctx, cverts) dst_index: int - for path in &cache.paths { + for &path in cache.paths { pts := cache.points[path.first:] p0, p1: ^Point rw, lw, woff: f32 @@ -2542,7 +2542,7 @@ Fill :: proc(ctx: ^Context) { ctx.cache.paths[:], ) - for path in &ctx.cache.paths { + for &path in ctx.cache.paths { ctx.fillTriCount += len(path.fill) - 2 ctx.fillTriCount += len(path.stroke) - 2 ctx.drawCallCount += 2 @@ -2588,7 +2588,7 @@ Stroke :: proc(ctx: ^Context) { ctx.cache.paths[:], ) - for path in &ctx.cache.paths { + for &path in ctx.cache.paths { ctx.strokeTriCount += len(path.stroke) - 2 ctx.drawCallCount += 1 } @@ -2597,7 +2597,7 @@ Stroke :: proc(ctx: ^Context) { DebugDumpPathCache :: proc(ctx: ^Context) { fmt.printf("~~~~~~~~~~~~~Dumping %d cached paths\n", len(ctx.cache.paths)) - for path, i in &ctx.cache.paths { + for &path, i in ctx.cache.paths { fmt.printf(" - Path %d\n", i) if len(path.fill) != 0 {