Skip to content

Commit

Permalink
fix -vet issues
Browse files Browse the repository at this point in the history
  • Loading branch information
atomicptr committed May 2, 2024
1 parent 13a2895 commit 27dd202
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 19 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize

jobs:
tests:
name: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: laytan/setup-odin@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Test
shell: bash
run: odin test anima -vet
30 changes: 11 additions & 19 deletions anima/anima.odin
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package anima

import "core:fmt"
import "core:strconv"
import "core:strings"

Expand All @@ -22,19 +21,17 @@ new_grid :: proc(
top: uint = 0,
border: uint = 0,
) -> Grid {
return(
{
frame_width,
frame_height,
image_width,
image_height,
left,
top,
image_width / frame_width,
image_height / frame_height,
border,
} \
)
return {
frame_width,
frame_height,
image_width,
image_height,
left,
top,
image_width / frame_width,
image_height / frame_height,
border,
}
}

Interval :: struct {
Expand Down Expand Up @@ -99,11 +96,6 @@ grid_frames :: proc(grid: ^Grid, intervals: ..IntervalT) -> []FrameRect {
column := parse_interval(intervals[i])
row := parse_interval(intervals[i + 1])

c_start := int(column.from)
c_end := int(column.to)
r_start := int(row.from)
r_end := int(row.to)

cond := proc(index: int, interval: Interval) -> bool {
if interval.forward {
return index <= int(interval.to)
Expand Down

0 comments on commit 27dd202

Please sign in to comment.