* [Qemu-devel] [PATCH] checkpatch.pl: add common glib defines to typelist
@ 2018-04-25 5:40 Peter Xu
2018-04-25 6:08 ` Markus Armbruster
0 siblings, 1 reply; 3+ messages in thread
From: Peter Xu @ 2018-04-25 5:40 UTC (permalink / raw)
To: qemu-devel
Cc: peterx, Paolo Bonzini, Stefan Hajnoczi, Daniel P. Berrangé,
Markus Armbruster, Vladimir Sementsov-Ogievskiy, Fam Zheng
Otherwise it can warn this:
ERROR: space prohibited between function name and open parenthesis '('
When with things like this:
typedef gboolean (*it_tree_iterator)(ITValue start, ITValue end);
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
CC: "Daniel P. Berrangé" <berrange@redhat.com>
CC: Markus Armbruster <armbru@redhat.com>
CC: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
CC: Fam Zheng <famz@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
scripts/checkpatch.pl | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d52207a3cc..6c25449cd3 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -266,6 +266,20 @@ our @typeList = (
qr{target_(?:u)?long},
qr{hwaddr},
qr{xml${Ident}},
+ # Glib definitions
+ qr{gchar},
+ qr{gshort},
+ qr{glong},
+ qr{gint},
+ qr{gboolean},
+ qr{guchar},
+ qr{gushort},
+ qr{gulong},
+ qr{guint},
+ qr{gfloat},
+ qr{gdouble},
+ qr{gpointer},
+ qr{gconstpointer},
);
# This can be modified by sub possible. Since it can be empty, be careful
--
2.14.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Qemu-devel] [PATCH] checkpatch.pl: add common glib defines to typelist
2018-04-25 5:40 [Qemu-devel] [PATCH] checkpatch.pl: add common glib defines to typelist Peter Xu
@ 2018-04-25 6:08 ` Markus Armbruster
2018-04-25 6:57 ` Peter Xu
0 siblings, 1 reply; 3+ messages in thread
From: Markus Armbruster @ 2018-04-25 6:08 UTC (permalink / raw)
To: Peter Xu
Cc: qemu-devel, Vladimir Sementsov-Ogievskiy, Stefan Hajnoczi,
Fam Zheng, Paolo Bonzini
Peter Xu <peterx@redhat.com> writes:
> Otherwise it can warn this:
>
> ERROR: space prohibited between function name and open parenthesis '('
>
> When with things like this:
>
> typedef gboolean (*it_tree_iterator)(ITValue start, ITValue end);
>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> CC: Stefan Hajnoczi <stefanha@redhat.com>
> CC: "Daniel P. Berrangé" <berrange@redhat.com>
> CC: Markus Armbruster <armbru@redhat.com>
> CC: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> CC: Fam Zheng <famz@redhat.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
> scripts/checkpatch.pl | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index d52207a3cc..6c25449cd3 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -266,6 +266,20 @@ our @typeList = (
> qr{target_(?:u)?long},
> qr{hwaddr},
> qr{xml${Ident}},
> + # Glib definitions
> + qr{gchar},
> + qr{gshort},
> + qr{glong},
> + qr{gint},
> + qr{gboolean},
> + qr{guchar},
> + qr{gushort},
> + qr{gulong},
> + qr{guint},
> + qr{gfloat},
> + qr{gdouble},
> + qr{gpointer},
> + qr{gconstpointer},
> );
>
> # This can be modified by sub possible. Since it can be empty, be careful
Personally, I'd kill these with fire, then salt the fields that bore
them.
But as long as we have them in our code, checkpatch needs to cope.
Let's list all types documented in
<https://developer.gnome.org/glib/stable/glib-Basic-Types.html>.
Missing:
gint8
guint8
gint16
guint16
gint32
guint32
gint64
guint64
gsize
gssize
goffset
gintptr
guintptr
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Qemu-devel] [PATCH] checkpatch.pl: add common glib defines to typelist
2018-04-25 6:08 ` Markus Armbruster
@ 2018-04-25 6:57 ` Peter Xu
0 siblings, 0 replies; 3+ messages in thread
From: Peter Xu @ 2018-04-25 6:57 UTC (permalink / raw)
To: Markus Armbruster
Cc: qemu-devel, Vladimir Sementsov-Ogievskiy, Stefan Hajnoczi,
Fam Zheng, Paolo Bonzini
On Wed, Apr 25, 2018 at 08:08:45AM +0200, Markus Armbruster wrote:
> Peter Xu <peterx@redhat.com> writes:
>
> > Otherwise it can warn this:
> >
> > ERROR: space prohibited between function name and open parenthesis '('
> >
> > When with things like this:
> >
> > typedef gboolean (*it_tree_iterator)(ITValue start, ITValue end);
> >
> > CC: Paolo Bonzini <pbonzini@redhat.com>
> > CC: Stefan Hajnoczi <stefanha@redhat.com>
> > CC: "Daniel P. Berrangé" <berrange@redhat.com>
> > CC: Markus Armbruster <armbru@redhat.com>
> > CC: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> > CC: Fam Zheng <famz@redhat.com>
> > Signed-off-by: Peter Xu <peterx@redhat.com>
> > ---
> > scripts/checkpatch.pl | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index d52207a3cc..6c25449cd3 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -266,6 +266,20 @@ our @typeList = (
> > qr{target_(?:u)?long},
> > qr{hwaddr},
> > qr{xml${Ident}},
> > + # Glib definitions
> > + qr{gchar},
> > + qr{gshort},
> > + qr{glong},
> > + qr{gint},
> > + qr{gboolean},
> > + qr{guchar},
> > + qr{gushort},
> > + qr{gulong},
> > + qr{guint},
> > + qr{gfloat},
> > + qr{gdouble},
> > + qr{gpointer},
> > + qr{gconstpointer},
> > );
> >
> > # This can be modified by sub possible. Since it can be empty, be careful
>
> Personally, I'd kill these with fire, then salt the fields that bore
> them.
>
> But as long as we have them in our code, checkpatch needs to cope.
> Let's list all types documented in
> <https://developer.gnome.org/glib/stable/glib-Basic-Types.html>.
> Missing:
>
> gint8
> guint8
> gint16
> guint16
> gint32
> guint32
> gint64
> guint64
> gsize
> gssize
> goffset
> gintptr
> guintptr
I got the old list from the header file (glib/gtypes.h) directly, so I
should go for the document next time! It's strange that I can hardly
find where is, e.g. gint8, defined. Anyway, I'm posting a new one.
Thanks!
--
Peter Xu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-25 6:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-25 5:40 [Qemu-devel] [PATCH] checkpatch.pl: add common glib defines to typelist Peter Xu
2018-04-25 6:08 ` Markus Armbruster
2018-04-25 6:57 ` Peter Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).