Patchwork [3/7] forward declare all QObject subclasses in qobject.h

login
register
mail settings
Submitter Paolo Bonzini
Date Oct. 17, 2009, 7:55 a.m.
Message ID <1255766136-3028-4-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/36292/
State New
Headers show

Comments

Paolo Bonzini - Oct. 17, 2009, 7:55 a.m.
This gives more freedom to define prototypes without dragging in
the whole header files.

Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qobject.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Anthony Liguori - Oct. 17, 2009, 1:02 p.m.
Paolo Bonzini wrote:
> This gives more freedom to define prototypes without dragging in
> the whole header files.
>
> Cc: Luiz Capitulino <lcapitulino@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  qobject.h |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/qobject.h b/qobject.h
> index 200644d..f5c78b2 100644
> --- a/qobject.h
> +++ b/qobject.h
> @@ -44,6 +44,10 @@ typedef enum {
>  } qtype_code;
>  
>  struct QObject;
> +struct QInt;
> +struct QString;
> +struct QDict;
> +struct QList;
>   

This seems like a layering violation to me.

Regards,

Anthony Liguori

Patch

diff --git a/qobject.h b/qobject.h
index 200644d..f5c78b2 100644
--- a/qobject.h
+++ b/qobject.h
@@ -44,6 +44,10 @@  typedef enum {
 } qtype_code;
 
 struct QObject;
+struct QInt;
+struct QString;
+struct QDict;
+struct QList;
 
 typedef struct QType {
     qtype_code code;