]> git.0d.be Git - empathy.git/blobdiff - tools/check-c-style.sh
Updated Spanish Translation
[empathy.git] / tools / check-c-style.sh
index dd62fb7ba3ff4323e01dc71bbcb75bf73abf109d..55834207aa816768ef16de3325facf88f7c57b89 100644 (file)
@@ -3,13 +3,6 @@ fail=0
 
 ( . "${tools_dir}"/check-misc.sh ) || fail=$?
 
-if grep -n '^ *GError *\*[[:alpha:]_][[:alnum:]_]* *;' "$@"
-then
-  echo "^^^ The above files contain uninitialized GError*s - they should be"
-  echo "    initialized to NULL"
-  fail=1
-fi
-
 # The first regex finds function calls like foo() (as opposed to foo ()).
 #   It attempts to ignore string constants (may cause false negatives).
 # The second and third ignore block comments (gtkdoc uses foo() as markup).
@@ -44,6 +37,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,}' "$@"