summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2011-11-16 14:27:39 (GMT)
committerXavier Claessens <xclaesse@gmail.com>2011-11-16 14:27:39 (GMT)
commit5c991685767cbc34a55b396653344ae87e89dea9 (patch)
tree4bc28d62271ecc9784896efa8aba8fdba1b1dab8
parent008910a80428f2b0b8c9f5c0b55dda9b28b6c66b (diff)
downloadtelepathy-yell-5c991685767cbc34a55b396653344ae87e89dea9.tar.gz
telepathy-yell-5c991685767cbc34a55b396653344ae87e89dea9.tar.xz
Add coding style check for g_hash_table_destroy and g_array_free usage
-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 dd62fb7..4330b14 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,}' "$@"