]> git.0d.be Git - empathy.git/blobdiff - tools/check-c-style.sh
Add coding style check for g_hash_table_destroy and g_array_free usage
[empathy.git] / tools / check-c-style.sh
index dd62fb7ba3ff4323e01dc71bbcb75bf73abf109d..4330b1479f6154ef4752787ea86e7f3a5129f16f 100644 (file)
@@ -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,}' "$@"