Obfuscated code in xserver/os/io.c ?

Matt Turner mattst88 at gmail.com
Tue Sep 21 12:12:41 PDT 2010


On Tue, Sep 21, 2010 at 3:09 PM, Jesse Adkins <jesserayadkins at gmail.com> wrote:
> Syntax-wise, they're the same thing. There's nothing technically wrong
> with it, since it goes if -> if -> statement.
>
> The first if sees everything in the second if as a single statement,
> so no braces are required.
>
> To my knowledge, this sort of construct is only a problem if there's
> an else in there. Most compilers will apply the else to the proper
> branch, but some won't.
>
> I think the second one is more readable though, and consistent with
> the rest of the file's coding.

The thing is, the indentation is wrong, so it's unclear whether it's
supposed to have braces or not. I think this is what he's asking
about--someone please confirm that the code is correct as is.

Matt


More information about the xorg-devel mailing list