Keep -vet happy

This commit is contained in:
gingerBill
2023-06-26 23:00:39 +01:00
parent 1bf4c8c9ba
commit a820246f64
3 changed files with 15 additions and 15 deletions
+3 -3
View File
@@ -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)
}
+4 -4
View File
@@ -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)
}
+8 -8
View File
@@ -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 {