Internal Types - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15) +---- Thread: Internal Types (/showthread.php?tid=194) |
Internal Types - britlion - 03-31-2010 This issues a warning: "Test.bas:22: warning: Redundant operation ABS for unsigned value" Surely if a Byte is signed, then (Byte-Byte) is signed as well? Is this an internal issue, or is it me doing something wrong, and I should be casting, here? (I know poking the routine with fspDataStart is a bad idea - I needed label to be able to make this compile on its own to demonstrate the query - I'm not really writing horrifically wrong self-modifying code!) Code: fspDataStart: Re: Internal Types - boriel - 04-01-2010 britlion Wrote:This issues a warning: "Test.bas:22: warning: Redundant operation ABS for unsigned value"The compiler is right. At line 22, you have: Code: ... ABS (yCoords(i) < yCoords(j)) <2 THEN Re: Internal Types - britlion - 04-01-2010 Sheesh. And I swear I tried it without the second argument. Weird when you can't see what you typed sometimes. I stared at that for about an hour. I blame coding after midnight and my old failing eyesight. Have you changed some of the error messages? They seem to be getting more helpful... Re: Internal Types - boriel - 04-01-2010 britlion Wrote:Sheesh.Nope, just divided the line into two lines, using the line continuation "_" character: Code: if ABS (xCoords(i)-xCoords(j)) < 2 AND _ This way you can make your code more readable and the warning/error is reported more accurately. BASIC is line-oriented => you can't break the line in the middle of a single sentence, but the _ terminator (written AT THE VERY END of the line) allows line wrapping. |