diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-05-10 14:16:38 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-05-13 09:52:06 -0500 |
commit | be17f18b8cd438be7f8f65000c0baecdd5b34634 (patch) | |
tree | b8a060ccb757650300919ea619046fe28e62c421 /include/qom/object.h | |
parent | 793c96b5403233fd9935c94b2af6d557c297a088 (diff) |
qom: pass file/line/function to asserting casts
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368188203-3407-5-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include/qom/object.h')
-rw-r--r-- | include/qom/object.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/qom/object.h b/include/qom/object.h index 41b7068d19..38f674f0ca 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -476,7 +476,8 @@ struct TypeInfo * generated. */ #define OBJECT_CHECK(type, obj, name) \ - ((type *)object_dynamic_cast_assert(OBJECT(obj), (name))) + ((type *)object_dynamic_cast_assert(OBJECT(obj), (name), \ + __FILE__, __LINE__, __func__)) /** * OBJECT_CLASS_CHECK: @@ -489,7 +490,8 @@ struct TypeInfo * specific class type. */ #define OBJECT_CLASS_CHECK(class, obj, name) \ - ((class *)object_class_dynamic_cast_assert(OBJECT_CLASS(obj), (name))) + ((class *)object_class_dynamic_cast_assert(OBJECT_CLASS(obj), (name), \ + __FILE__, __LINE__, __func__)) /** * OBJECT_GET_CLASS: @@ -547,7 +549,8 @@ struct InterfaceClass * Returns: @obj casted to @interface if cast is valid, otherwise raise error. */ #define INTERFACE_CHECK(interface, obj, name) \ - ((interface *)object_dynamic_cast_assert(OBJECT((obj)), (name))) + ((interface *)object_dynamic_cast_assert(OBJECT((obj)), (name), \ + __FILE__, __LINE__, __func__)) /** * object_new: @@ -615,7 +618,8 @@ Object *object_dynamic_cast(Object *obj, const char *typename); * instead of returning #NULL on failure. This function is not meant to be * called directly, but only through the wrapper macro OBJECT_CHECK. */ -Object *object_dynamic_cast_assert(Object *obj, const char *typename); +Object *object_dynamic_cast_assert(Object *obj, const char *typename, + const char *file, int line, const char *func); /** * object_get_class: @@ -667,7 +671,9 @@ Type type_register(const TypeInfo *info); * OBJECT_CLASS_CHECK and INTERFACE_CHECK. */ ObjectClass *object_class_dynamic_cast_assert(ObjectClass *klass, - const char *typename); + const char *typename, + const char *file, int line, + const char *func); /** * object_class_dynamic_cast: |