use space consistently in function and function-like macro invocations
(This is a reimplementation from scratch of libnbd commit
b5101fbc59cb,
"use space consistently in function and function-like macro invocations",
2023-02-22.)
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, 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.
While at it, touch up the following space-related warts:
- The parameter / argument lists of the STUB() and OPTIONAL_STUB() macros,
used in VDDK code, lack spaces after the commas; supply them.
- There is a single backslash in the definition of each of the
ACQUIRE_LOCK_FOR_CURRENT_SCOPE(), ACQUIRE_WRLOCK_FOR_CURRENT_SCOPE(),
ACQUIRE_RDLOCK_FOR_CURRENT_SCOPE(), and GET_HANDLE_FOR_CURRENT_SCOPE()
macros. Each backslash is preceded by many spaces, even though there are
no multiple backslashes that should be aligned. Squeeze the space
characters.
I collected the locations possibly missing spaces with:
git grep -EHn '\<[a-zA-Z0-9_]+\(' -- '*.c' '*.h'
and then manually updated each as necessary (this time using negative
look-behind regexes in xnedit, for excluding "#define MACRO(...)"
matches).
I didn't change occurrences in comments (no comment seemed to indicate
copying and pasting an expression into new code).
"git show -w" outputs nothing for this patch.
The test suite passes.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <
20230303075145.177338-5-lersek@redhat.com>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
Acked-by: Eric Blake <eblake@redhat.com>