Skip to content

Commit a414b20

Browse files
committed
tools: added reformatting style and script
uses astyle, see https://astyle.sourceforge.net/astyle.html
1 parent decd279 commit a414b20

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tools/CodeStyle/am32-astyle.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
# script for recormatting C code
3+
# see https://astyle.sourceforge.net/astyle.html
4+
5+
if [ -z "$1" ]; then
6+
printf "\nArguments missing, Usage: '$0 <files to style>'\n\n"
7+
exit 1
8+
fi
9+
10+
if [ $(uname) = "Darwin" ]; then
11+
DIR=$(dirname $(greadlink -f $0))
12+
else
13+
DIR=$(dirname $(readlink -f $0))
14+
fi
15+
16+
astyle --options="${DIR}"/astylerc $*

tools/CodeStyle/astylerc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
style=linux
2+
keep-one-line-statements
3+
add-braces
4+
indent=spaces=2
5+
indent-col1-comments
6+
min-conditional-indent=0
7+
suffix=none
8+
lineend=linux
9+
pad-header

0 commit comments

Comments
 (0)