lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1387196287-25972-1-git-send-email-ospite@studenti.unina.it>
Date:	Mon, 16 Dec 2013 13:18:07 +0100
From:	Antonio Ospite <ospite@...denti.unina.it>
To:	linux-kernel@...r.kernel.org
Cc:	Antonio Ospite <ospite@...denti.unina.it>,
	"J . R . Mauro" <jrm8005@...il.com>
Subject: [PATCH] scripts/Lindent: fix formatting primitive types

Make Lindent recognize and format properly at least the commonly used
primitive types.

Something like this has been suggested before by J.R. Mauro:
https://lkml.org/lkml/2008/10/14/233

Signed-off-by: Antonio Ospite <ospite@...denti.unina.it>
---

Hi,

I had this local change and I felt like sharing it.

Another way of doing this kind of setup would be to put options into an
indent.pro file and make the INDENT_PROFILE env variable point to it.

BTW, I realize this kind of changes could easily go out of control, I was
almost going to generate the list of types (and qualifier) by parsing header
files, so I'll understand if you just drop it.

Ciao,
   Antonio

 scripts/Lindent | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/scripts/Lindent b/scripts/Lindent
index 9c4b3e2..7531d7c 100755
--- a/scripts/Lindent
+++ b/scripts/Lindent
@@ -1,5 +1,14 @@
 #!/bin/sh
 PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1"
+TYPES="-T size_t \
+ -T s8 -T s16 -T s32 -T s64 \
+ -T __s8 -T __s16 -T __s32 -T __s64 \
+ -T u8 -T u16 -T u32 -T u64 \
+ -T __u8 -T __u16 -T __u32 -T __u64 \
+ -T __be16 -T __be32 -T __be64 \
+ -T __le16 -T __le32 -T __le64 \
+ -T int8_t -T int16_t -T int32_t -T int64_t \
+ -T u_int8_t -T u_int16_t -T u_int32_t -T u_int64_t"
 RES=`indent --version`
 V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1`
 V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2`
@@ -15,4 +24,4 @@ elif [ $V1 -eq 2 ]; then
     fi
   fi
 fi
-indent $PARAM "$@"
+indent $PARAM $TYPES "$@"
-- 
1.8.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ