Patchwork [3/3] checkpatch: Keep out the GLib silliness we just purged

login
register
mail settings
Submitter Markus Armbruster
Date Jan. 18, 2013, 4:04 p.m.
Message ID <1358525049-31163-4-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/213653/
State New
Headers show

Comments

Markus Armbruster - Jan. 18, 2013, 4:04 p.m.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/checkpatch.pl | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index ec0aa4c..3490946 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2876,6 +2876,35 @@  sub process {
 		if ($rawline =~ /\b(?:Qemu|QEmu)\b/) {
 			WARN("use QEMU instead of Qemu or QEmu\n" . $herecurr);
 		}
+
+                if ($line =~ /\b(gboolean|gpointer|gconstpointer|gchar|guchar
+                                |gint|G_MININT|G_MAXINT|guint|G_MAXUINT|gshort
+                                |G_MINSHORT|G_MAXSHORT|gushort|G_MAXUSHORT
+                                |glong|G_MINLONG|G_MAXLONG|gulong|G_MAXULONG
+                                |gint8|G_MININT8|G_MAXINT8|guint8|G_MAXUINT8
+                                |gint16|G_MININT16|G_MAXINT16|G_GINT16_MODIFIER
+                                |G_GINT16_FORMAT|guint16|G_MAXUINT16
+                                |G_GUINT16_FORMAT|gint32|G_MININT32|G_MAXINT32
+                                |G_GINT32_MODIFIER|G_GINT32_FORMAT|guint32
+                                |G_MAXUINT32|G_GUINT32_FORMAT|gint64|G_MININT64
+                                |G_MAXINT64|G_GINT64_MODIFIER|G_GINT64_FORMAT
+                                |G_GINT64_CONSTANT|guint64|G_MAXUINT64
+                                |G_GUINT64_FORMAT|G_GUINT64_CONSTANT|gfloat
+                                |G_MINFLOAT|G_MAXFLOAT|gdouble|G_MINDOUBLE
+                                |G_MAXDOUBLE|gsize|G_MAXSIZE|G_GSIZE_MODIFIER
+                                |G_GSIZE_FORMAT|gssize|G_MINSSIZE|G_MAXSSIZE
+                                |G_GSSIZE_FORMAT|goffset|G_MINOFFSET
+                                |G_MAXOFFSET|G_GOFFSET_MODIFIER
+                                |G_GOFFSET_FORMAT|G_GOFFSET_CONSTANT|gintptr
+                                |G_GINTPTR_MODIFIER|G_GINTPTR_FORMAT|guintptr
+                                |G_GUINTPTR_FORMAT|G_STRUCT_MEMBER
+                                |G_STRUCT_MEMBER_P|G_STRUCT_OFFSET
+                                |G_CONST_RETURN|G_N_ELEMENTS|GINT_TO_POINTER
+                                |GPOINTER_TO_INT|GUINT_TO_POINTER
+                                |GPOINTER_TO_UINT|GSIZE_TO_POINTER
+                                |GPOINTER_TO_SIZE)\b/x) {
+			WARN("Please use standard C names instead of glib aliases like $1\n" . $herecurr);
+                }
 	}
 
 	# If we have no input at all, then there is nothing to report on