Am Mittwoch, 1. November 2006 17:52 schrieb Troman:
> ----- Original Message -----
> From: "Dennis Schridde" <[EMAIL PROTECTED]>
> To: "Development list" <warzone-dev@gna.org>
> Sent: Wednesday, November 01, 2006 1:00 PM
> Subject: Re: [Warzone-dev] Patches for removing some warnings
>
> >Am Mittwoch, 1. November 2006 12:27 schrieb Gerard Krol:
> >> Hi all,
> >>
> >> Attached are 2 sets of changes to remove some warnings. Those in
> >> warnings_casts.patch cast variables back to what they were before the
> >> binary operations, for example:
> >>
> >> -                sVal.type = (*InstrPointer) & OPCODE_DATAMASK;
> >> +                sVal.type = (INTERP_TYPE)((*InstrPointer) &
> >> OPCODE_DATAMASK);
> >>
> >> I think this is quite harmless.
> >> warnings_changes.patch changes the types of some variables and adds
> >> calls to keyCodeToSDLKey in some assert statements.
> >
> >A quick look-through told me that this looks good. (Especially the
> >explanation
> >helped a lot! Makes a difference if one is just blindly trying to silence
> >the
> >compiler or if he has good reasons to cast in specific places.)
> >Will look at it further and test it later, probably on the WE.
> >
> >--Dennis
>
> Devurandom, since these patches are compatible with TSVN, I can do it if
> that's ok with you.
Sure! Please do it.

> All patches seem to be ok, although i'm not sure if we really need
> keyCodeToSDLKey() or if just casting will suffice. I don't know if
> keyCodeToSDLKey() might do more in the future than just casting.
keyCode is a system-keycode and SDKKey is the SDL name for it? And "code" is a 
system-keycode and KEY_MAXSCAN is the SDL value for the maximum SDLKey?
Then we should use that function as SDL might want to change this in the 
future.
Also: Why do we check that at all? Is there any reason to not rely on SDL to 
give us no keycode above what it can interprete?

> And if I understand the original intention correctly
>
> return((PICKTILE)TRUE);
>
> should probably be chnaged to:
>
> return HALF_FREE_TILE;
If you think this is correct, it doesn't crash and HALF_FREE_TILE is of the 
same value as TRUE, then I see no problems.

--Dennis

Attachment: pgplUIcHikadl.pgp
Description: PGP signature

_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to