aboutsummaryrefslogtreecommitdiffstats
path: root/tools/check-c-style.sh
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2011-11-16 22:31:19 +0800
committerXavier Claessens <xclaesse@gmail.com>2011-11-16 22:57:00 +0800
commitba6e07cc5a0bf75118c12fd5ebf05e4453a5dc80 (patch)
tree89cbb281877cd36d71de99af8dbb2a212adc3770 /tools/check-c-style.sh
parent20772a7c205e54e4b5f28d14e279691459efaf1a (diff)
downloadgsoc2013-empathy-ba6e07cc5a0bf75118c12fd5ebf05e4453a5dc80.tar
gsoc2013-empathy-ba6e07cc5a0bf75118c12fd5ebf05e4453a5dc80.tar.gz
gsoc2013-empathy-ba6e07cc5a0bf75118c12fd5ebf05e4453a5dc80.tar.bz2
gsoc2013-empathy-ba6e07cc5a0bf75118c12fd5ebf05e4453a5dc80.tar.lz
gsoc2013-empathy-ba6e07cc5a0bf75118c12fd5ebf05e4453a5dc80.tar.xz
gsoc2013-empathy-ba6e07cc5a0bf75118c12fd5ebf05e4453a5dc80.tar.zst
gsoc2013-empathy-ba6e07cc5a0bf75118c12fd5ebf05e4453a5dc80.zip
Add coding style check for g_hash_table_destroy and g_array_free usage
Diffstat (limited to 'tools/check-c-style.sh')
-rw-r--r--tools/check-c-style.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/check-c-style.sh b/tools/check-c-style.sh
index dd62fb7ba..4330b1479 100644
--- a/tools/check-c-style.sh
+++ b/tools/check-c-style.sh
@@ -44,6 +44,19 @@ if grep -En '^ *(static |const |)* *[[:alnum:]_]+\*+([[:alnum:]_]|;|$)' \
fail=1
fi
+if grep -n 'g_hash_table_destroy' "$@"; then
+ echo "^^^ Our coding style is to use g_hash_table_unref"
+ fail=1
+fi
+
+for p in "" "ptr_" "byte_"; do
+ if grep -En "g_${p}array_free \(([^ ,]+), TRUE\)" "$@"; then
+ echo "^^^ Our coding style is to use g_${p}array_unref in the case "
+ echo " the underlying C array is not used"
+ fail=1
+ fi
+done
+
if test -n "$CHECK_FOR_LONG_LINES"
then
if egrep -n '.{80,}' "$@"