Skip to contentSkip to conversation

qapi: fix qapi_dealloc_type_size parameter type

PATCH In review Bruce Rogers 4 participants 4 messages Nov 27, 2012 – Nov 29, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qapi: fix qapi_dealloc_type_size parameter type

The second parameter to qapi_dealloc_type_size should be a uint64_t *, not a size_t *. This was causing our 32 bit x86 build to fail, since warnings are treated as errors.

---
 qapi/qapi-dealloc-visitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
qapi/qapi-dealloc-visitor.c +1 -1
index a07b171..75214e7 100644
@@ -132,7 +132,7 @@ static void qapi_dealloc_type_number(Visitor *v, double *obj, const char *name,
 {
 }
 
-static void qapi_dealloc_type_size(Visitor *v, size_t *obj, const char *name,
+static void qapi_dealloc_type_size(Visitor *v, uint64_t *obj, const char *name,
                                    Error **errp)
 {
 }
Signature · 1 line
1.7.7
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Bruce Rogers

The second parameter to qapi_dealloc_type_size should be a uint64_t *, not a size_t *. This was causing our 32 bit x86 build to fail, since warnings are treated as errors.

Doh, I should've caught this in review. Yes, qapi's type generator uses uint64_t as the underlying type for 'size', and the visitor interface calls for uint64_t*, so that's what the implementation should use.

Quoted 20 lines
---
 qapi/qapi-dealloc-visitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
qapi/qapi-dealloc-visitor.c +1 -1
index a07b171..75214e7 100644
@@ -132,7 +132,7 @@ static void qapi_dealloc_type_number(Visitor *v, double *obj, const char *name,
 {
 }
 
-static void qapi_dealloc_type_size(Visitor *v, size_t *obj, const char *name,
+static void qapi_dealloc_type_size(Visitor *v, uint64_t *obj, const char *name,
                                    Error **errp)
 {
 }
Signature · 1 line
1.7.7
Reviewed-by
#2 lore raw

Am 27.11.2012 21:54, schrieb mdroth:

Quoted 11 lines · Bruce Rogers
Quoted 5 lines

The second parameter to qapi_dealloc_type_size should be a uint64_t *, not a size_t *. This was causing our 32 bit x86 build to fail, since warnings are treated as errors.

Doh, I should've caught this in review. Yes, qapi's type generator uses uint64_t as the underlying type for 'size', and the visitor interface calls for uint64_t*, so that's what the implementation should use.

I have sent a similar patch this morning but just noticed that I forgot to cc qemu-devel. Only Stefan H. and Anthony got it :-(

Anthony, as Bruce' patch was already reviewed, please commit this one instead of my patch.

Quoted 20 lines
Quoted 20 lines
---
  qapi/qapi-dealloc-visitor.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
qapi/qapi-dealloc-visitor.c +1 -1
index a07b171..75214e7 100644
@@ -132,7 +132,7 @@ static void qapi_dealloc_type_number(Visitor *v, double *obj, const char *name,
  {
  }
 
-static void qapi_dealloc_type_size(Visitor *v, size_t *obj, const char *name,
+static void qapi_dealloc_type_size(Visitor *v, uint64_t *obj, const char *name,
                                     Error **errp)
  {
  }
Signature · 1 line
1.7.7
Reviewed-by on v1 1/1
#3 lore raw
In reply to Bruce Rogers
Quoted 8 lines · Bruce Rogers

The second parameter to qapi_dealloc_type_size should be a uint64_t *, not a size_t *. This was causing our 32 bit x86 build to fail, since warnings are treated as errors.

---
 qapi/qapi-dealloc-visitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Sorry for the broken build.