diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2008-12-15 11:48:32 +0000 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2008-12-15 11:48:32 +0000 |
commit | 262bc5989f43357dc6411d60e1937054d04a8132 (patch) | |
tree | 300f6a85fcd509d3a07af89a2d3c4f196b7d9551 | |
parent | 4d22af397553bbe2ea4210ff2cacc5c4df3e0d03 (diff) | |
download | telepathy-salut-262bc5989f43357dc6411d60e1937054d04a8132.tar.gz |
ugprade tools/check-c-style.sh using the one in Gabble master
-rw-r--r-- | tools/check-c-style.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/check-c-style.sh b/tools/check-c-style.sh index 357fdb36..dd62fb7b 100644 --- a/tools/check-c-style.sh +++ b/tools/check-c-style.sh @@ -24,6 +24,26 @@ then fail=1 fi +if grep -En '[(][[:alnum:]_]+ ?\*[)][(]?[[:alpha:]_]' "$@"; then + echo "^^^ Our coding style is to have a space between a cast and the " + echo " thing being cast" + fail=1 +fi + +# this only spots casts +if grep -En '[(][[:alnum:]_]+\*+[)]' "$@"; then + echo "^^^ Our coding style is to have a space before the * of pointer types" + echo " (regex 1)" + fail=1 +fi +# ... and this only spots variable declarations and function return types +if grep -En '^ *(static |const |)* *[[:alnum:]_]+\*+([[:alnum:]_]|;|$)' \ + "$@"; then + echo "^^^ Our coding style is to have a space before the * of pointer types" + echo " (regex 2)" + fail=1 +fi + if test -n "$CHECK_FOR_LONG_LINES" then if egrep -n '.{80,}' "$@" |