all: apply go-fix for Windows and Linux

This commit is contained in:
Hajime Hoshi
2026-04-20 22:42:10 +09:00
parent ecbff36e41
commit 844a0c4c28
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -239,7 +239,7 @@ func (g *nativeGamepadsDesktop) detectConnection(gamepads *gamepads) error {
if g.xinput != 0 {
const xuserMaxCount = 4
for i := 0; i < xuserMaxCount; i++ {
for i := range xuserMaxCount {
if gamepads.find(func(g *Gamepad) bool {
n := g.native.(*nativeGamepadDesktop)
return n.dinputDevice == nil && n.xinputIndex == i
+1 -1
View File
@@ -377,7 +377,7 @@ func (g *nativeGamepadImpl) update(gamepad *gamepads) error {
}
func (g *nativeGamepadImpl) pollAbsState() error {
for code := 0; code < _ABS_CNT; code++ {
for code := range _ABS_CNT {
if g.absMap[code] < 0 {
continue
}
@@ -329,7 +329,7 @@ func (g *graphics12) initializeMembers() (ferr error) {
}()
// Create command allocators.
for i := 0; i < frameCount; i++ {
for i := range frameCount {
dca, err := g.device.CreateCommandAllocator(_D3D12_COMMAND_LIST_TYPE_DIRECT)
if err != nil {
return err
@@ -518,7 +518,7 @@ func (g *graphics12) initSwapChainXbox(width, height int) (ferr error) {
return err
}
for i := 0; i < frameCount; i++ {
for i := range frameCount {
r, err := g.device.CreateCommittedResource(&_D3D12_HEAP_PROPERTIES{
Type: _D3D12_HEAP_TYPE_DEFAULT,
CPUPageProperty: _D3D12_CPU_PAGE_PROPERTY_UNKNOWN,
@@ -592,7 +592,7 @@ func (g *graphics12) createRenderTargetViewsDesktop() (ferr error) {
if err != nil {
return err
}
for i := 0; i < frameCount; i++ {
for i := range frameCount {
r, err := g.graphicsInfra.getBuffer(uint32(i), &_IID_ID3D12Resource)
if err != nil {
return err
@@ -91,7 +91,7 @@ func NewGraphics() (graphicsdriver.Graphics, error) {
env = os.Getenv("EBITEN_DIRECTX")
}
for _, t := range strings.Split(env, ",") {
for t := range strings.SplitSeq(env, ",") {
t := strings.TrimSpace(t)
switch {
case t == "warp":