mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-27 05:22:07 +00:00
Fix division and modulo for very large negative numbers (#1790)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
def fzero equs "startof(\"test\")"
|
||||
section "test", rom0
|
||||
ld a, $8000_0000 / (fzero - 1)
|
||||
ld a, $8000_0000 / (fzero - 2)
|
||||
ld a, 1 << (fzero - 1)
|
||||
ld a, 1 << (fzero + 32)
|
||||
ld a, (fzero - 1) >> 1
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
warning: Shifting right by large amount 32 [-Wshift-amount]
|
||||
at patch-diagnostics.asm(11)
|
||||
warning: Shifting right by negative amount -1 [-Wshift-amount]
|
||||
at patch-diagnostics.asm(10)
|
||||
warning: Shifting right by negative amount -1 [-Wshift-amount]
|
||||
at patch-diagnostics.asm(9)
|
||||
warning: Shifting right by large amount 32 [-Wshift-amount]
|
||||
at patch-diagnostics.asm(8)
|
||||
at patch-diagnostics.asm(9)
|
||||
warning: Shifting right by negative amount -1 [-Wshift-amount]
|
||||
at patch-diagnostics.asm(7)
|
||||
at patch-diagnostics.asm(8)
|
||||
warning: Shifting right negative value -1 [-Wshift]
|
||||
at patch-diagnostics.asm(6)
|
||||
at patch-diagnostics.asm(7)
|
||||
warning: Shifting left by large amount 32 [-Wshift-amount]
|
||||
at patch-diagnostics.asm(5)
|
||||
at patch-diagnostics.asm(6)
|
||||
warning: Shifting left by negative amount -1 [-Wshift-amount]
|
||||
at patch-diagnostics.asm(5)
|
||||
warning: Value $40000000 is not 8-bit [-Wtruncation]
|
||||
at patch-diagnostics.asm(4)
|
||||
warning: Division of -2147483648 by -1 yields -2147483648 [-Wdiv]
|
||||
at patch-diagnostics.asm(3)
|
||||
|
||||
Reference in New Issue
Block a user