Skip to content
  • Laszlo Ersek's avatar
    use space consistently in function and function-like macro invocations · b5101fbc
    Laszlo Ersek authored
    
    
    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>
    b5101fbc