[CF-Devel] Patch: some warning cleaning under Win32

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Thu Dec 11 11:53:36 CST 2003


Hum, i have troubles determining the correct type to use for 'char' in 
play_sound_player_only's definition.

x & y are chars, ok, and are sent using SockList_AddChar, which takes a 'char'!
This char is added to the socket's buffer, which is... unsigned char.
Except x & y, since they are relative positions of sound from player, can be 
negative!

So at some point, the signed char will be converted to unsigned (arguably there 
is no information loss, though, so it isn't too bad).
Is it better to fix (x, y) as uint8, and SockList_AddChar too (since 'char' is 
signed or unsigned depending on platforms, potentially)?
Or do i leave x, y as sint8, SockList_AddChar as it is, and let explicit 
conversions take care of the rest?

Nicolas 'Ryo'


_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list