Commit b5101fbc authored by Laszlo Ersek's avatar Laszlo Ersek
Browse files

use space consistently in function and function-like macro invocations



We intend to place a space character between the function designator and
the opening parenthesis in a function call. We've been executing on that
mostly consistently; fix the few exceptions now.

The same convention should be applied to the invocations of function-like
macros, and to instances of "__attribute__ ((attr))". (The latter is
exemplified, although not consistently, by the GCC manual.) Implement
this, by inserting the necessary spaces.

Furthermore, some compiler attributes take multiple parameters, such as
"nonnull". The GCC manual clearly shows that arguments passed to such
attributes may be separated with ", " as well, not just ",". Use the
former, as it's more readable.

Finally, the C standard calls "defined" -- as in "#if defined identifier"
and (equivalently) "#if defined (identifier)" -- a unary preprocessing
operator. We can spell the parenthesized form as "defined (identifier)"
rather than "defined(identifier)", so choose the former.

I collected the locations possibly missing spaces with:

  git grep -EHn '\<[a-zA-Z0-9_]+\(' -- '*.c' '*.h'

and then manually updated each as necessary.

I didn't change occurrences in comments, except where the comment clearly
indicated copying and pasting an expression into new code.

"git show -w" outputs nothing for this patch.

The test suite passes.

Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
Message-Id: <20230215141158.2426855-2-lersek@redhat.com>
Reviewed-by: Eric Blake's avatarEric Blake <eblake@redhat.com>
Reviewed-by: default avatarRichard W.M. Jones <rjones@redhat.com>
parent 5a02c7d2
Pipeline #785487102 failed with stage
in 11 minutes and 25 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment