Re: [OxLUG] Logical operator precedence in C

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: chris@chriswareham.net
Date:  
To: Oxfordshire Linux User Group Discussion List
Subject: Re: [OxLUG] Logical operator precedence in C
On 28 August 2015 at 13:28 Carsten Agger <> wrote:
>
> Hi
>
> You're quite right! This is how I'd do it:
>
> if(
>      exposed->line_exposed[cursrow] ||
>       (
>        ((cursor & LIGHTCURSOR) && exposed->line_exposed[cursrow + 1]) ||
>        (cursrow > 0 && exposed->line_exposed[cursrow - 1])
>      )
> )
>
> Best
> C
>


Many thanks Carsten! This code is so deep down in a massive function that
writing a test for it would be a nightmare, so it's good to get a sanity
check from someone else :-)

Chris