On Sunday 05 December 2004 20:44, Cedric Pradalier wrote: > >> + pmu_blink_led_activated = newact?1:0; > > > >pmu_blink_led_activated = (newact != 0); > >is enough and more nice imho. > > I wanted to have either 1 or 0 in this boolean, not whatever int sent in > the buffer.
Hi, (newact != 0) returns either: 0: false - newact is zero. 1: true - newact is not zero. ie, obviously, it's a true/false comparison. So, that means pmu_blink_led_activated will be either 1 or 0, not whatever value newact contains, surely? David -- -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GCS d- s-: a-- C++ UL++++ P L+++ E--- W++ N+ o+ K- w--- O M V- PS+ PE+ Y+ PGP t 5- X+ R- tv+ b+ DI++ D+ G+ e++ h--- r++ y++ ------END GEEK CODE BLOCK------