On Jan 25, 2008 1:37 PM, Andy Green <[EMAIL PROTECTED]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Somebody in the thread at some point said: > > >> change my patch to make it less clear what is going on. I'm not sure > >> why you're fighting this, the patched version is more clear, is > >> correct, and has absolutely no penalty. > > Let me turn it around -- what you're patching with that bit of it isn't > broken... it works and the language C specifies it will always work. > There's no need to cast it except that you feel it makes the fact of > what the compiler must do "clearer" to you personally. Here's what > we're talking about: > > + int32_t res = ((int32_t)(adc_adcin1 - adc_batvolt) * 2400);
Portability. > The cast does nothing and IMO clarifies nothing. In terms of correctness > > + int32_t a = (int32_t)(int32_t)(int32_t)(int32_t)5; > > is "correct" but it's just as pointless. > > I'm just helping out reviewing your patch, Werner maintains that code. > I said my comments and I'll sleep well whether that bit goes in or out: > I'm grateful for the rest of your patch anyway and think you did a nice > job identifying the other problems and stepping up to provide fixes :-) > - -Andy > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (GNU/Linux) > Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org > > iD8DBQFHmjplOjLpvpq7dMoRAleFAJ0bPFItzg1FV6/g0l6G4Tu6wLG/UACbBkSX > PIFLZqLTdsZu027FE8FVpGw= > =PQcE > -----END PGP SIGNATURE----- >
