The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Internal Types
#1
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: SUB fspCollisionCheck() dim sprite as uInteger dim xCoords(3) as Byte dim yCoords(3) as Byte dim i,j as uByte let sprite=@fspDataStart for i=0 to 3 if (PEEK sprite) mod 2 =1 then: let xCoords(i)=PEEK (sprite+2) let yCoords(i)=PEEK (sprite+2) poke sprite,1 end if let sprite=sprite+43 next i let sprite=@fspDataStart for i=0 to 2 for j=i+1 to 3 if ABS (xCoords(i)-xCoords(j)) < 2 AND ABS (yCoords(i)<yCoords(j)) <2 THEN poke (sprite+43*i), PEEK (sprite+43*i) + ((1 SHL i) SHL (j-i)) : END IF next j next i END SUB
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)