|
GNU indent yields weird output when using the Linux kernel coding
style as in the below examples, which affects code readability.
- Too long lines cause unexpected indentation:
if (!
(priv->flags &
GNUTLS_PKCS11_OBJ_FLAG_RETRIEVE_DISTRUSTED)
&& (priv->flags & GNUTLS_PKCS11_OBJ_FLAG_OVERWRITE_TRUSTMOD_EXT)
&& data.size > 0) {
- Unary operators (`-` and `+`) after a type cast are not recognized
properly: `(time_t)-1` becomes `(time-t) - 1`
- Long conditionals are wrapped before binary operators, such as `&&`
or `||`. This is not mandatory in the style, but all the occurrences
are replaced with that style
This switches to using clang-format instead, with the configuration
used in the Linux kernel as of commit
596ff4a09b8981790e15572e8e7bc904df5835e7:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/.clang-format
Signed-off-by: Daiki Ueno <ueno@gnu.org>
|