diff --git a/msvc/unicorn/qapi/qapi-builtin-types.c b/msvc/unicorn/qapi/qapi-builtin-types.c index 380b6c45..a6521af6 100644 --- a/msvc/unicorn/qapi/qapi-builtin-types.c +++ b/msvc/unicorn/qapi/qapi-builtin-types.c @@ -12,8 +12,8 @@ #include "qemu/osdep.h" #include "qapi/dealloc-visitor.h" -#include "qapi-builtin-types.h" -#include "qapi-builtin-visit.h" +#include "qapi/qapi-builtin-types.h" +#include "qapi/qapi-builtin-visit.h" void qapi_free_strList(strList *obj) { @@ -220,3 +220,6 @@ const char *const QType_lookup[] = { "qbool", NULL, }; + +/* Dummy declaration to prevent empty .o file */ +char dummy_qapi_builtin_types_c; diff --git a/msvc/unicorn/qapi/qapi-builtin-types.h b/msvc/unicorn/qapi/qapi-builtin-types.h index de60985e..0ee39d77 100644 --- a/msvc/unicorn/qapi/qapi-builtin-types.h +++ b/msvc/unicorn/qapi/qapi-builtin-types.h @@ -46,14 +46,14 @@ typedef struct anyList anyList; typedef struct nullList nullList; typedef enum QType { - QTYPE_NONE = 0, - QTYPE_QNULL = 1, - QTYPE_QNUM = 2, - QTYPE_QSTRING = 3, - QTYPE_QDICT = 4, - QTYPE_QLIST = 5, - QTYPE_QBOOL = 6, - QTYPE__MAX = 7, + QTYPE_NONE, + QTYPE_QNULL, + QTYPE_QNUM, + QTYPE_QSTRING, + QTYPE_QDICT, + QTYPE_QLIST, + QTYPE_QBOOL, + QTYPE__MAX, } QType; extern const char *const QType_lookup[]; diff --git a/msvc/unicorn/qapi/qapi-builtin-visit.c b/msvc/unicorn/qapi/qapi-builtin-visit.c index 6801bb97..e869c022 100644 --- a/msvc/unicorn/qapi/qapi-builtin-visit.c +++ b/msvc/unicorn/qapi/qapi-builtin-visit.c @@ -13,7 +13,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "qapi/error.h" -#include "qapi-builtin-visit.h" +#include "qapi/qapi-builtin-visit.h" void visit_type_strList(Visitor *v, const char *name, strList **obj, Error **errp) { @@ -486,3 +486,6 @@ void visit_type_QType(Visitor *v, const char *name, QType *obj, Error **errp) visit_type_enum(v, name, &value, QType_lookup, errp); *obj = value; } + +/* Dummy declaration to prevent empty .o file */ +char dummy_qapi_builtin_visit_c; diff --git a/msvc/unicorn/qapi/qapi-builtin-visit.h b/msvc/unicorn/qapi/qapi-builtin-visit.h index d9402e67..a40c01da 100644 --- a/msvc/unicorn/qapi/qapi-builtin-visit.h +++ b/msvc/unicorn/qapi/qapi-builtin-visit.h @@ -14,7 +14,7 @@ #define QAPI_BUILTIN_VISIT_H #include "qapi/visitor.h" -#include "qapi-builtin-types.h" +#include "qapi/qapi-builtin-types.h" void visit_type_strList(Visitor *v, const char *name, strList **obj, Error **errp); void visit_type_numberList(Visitor *v, const char *name, numberList **obj, Error **errp); diff --git a/msvc/unicorn/qapi/qapi-types-common.c b/msvc/unicorn/qapi/qapi-types-common.c index 0b2dfaa2..4f2bfd75 100644 --- a/msvc/unicorn/qapi/qapi-types-common.c +++ b/msvc/unicorn/qapi/qapi-types-common.c @@ -12,8 +12,8 @@ #include "qemu/osdep.h" #include "qapi/dealloc-visitor.h" -#include "qapi-types.h" -#include "qapi-visit.h" +#include "qapi-types-common.h" +#include "qapi-visit-common.h" const char *const QapiErrorClass_lookup[] = { "GenericError", @@ -24,5 +24,6 @@ const char *const QapiErrorClass_lookup[] = { "KVMMissingCap", NULL, }; + /* Dummy declaration to prevent empty .o file */ -char dummy_qapi_qapi_types_common_c; +char dummy_qapi_types_common_c; diff --git a/msvc/unicorn/qapi/qapi-types-common.h b/msvc/unicorn/qapi/qapi-types-common.h index 696db356..a4ec6d2d 100644 --- a/msvc/unicorn/qapi/qapi-types-common.h +++ b/msvc/unicorn/qapi/qapi-types-common.h @@ -10,21 +10,21 @@ * See the COPYING.LIB file in the top-level directory. */ -#ifndef QAPI_QAPI_TYPES_COMMON_H -#define QAPI_QAPI_TYPES_COMMON_H +#ifndef QAPI_TYPES_COMMON_H +#define QAPI_TYPES_COMMON_H -#include "qapi-builtin-types.h" +#include "qapi/qapi-builtin-types.h" typedef enum QapiErrorClass { - QAPI_ERROR_CLASS_GENERICERROR = 0, - QAPI_ERROR_CLASS_COMMANDNOTFOUND = 1, - QAPI_ERROR_CLASS_DEVICEENCRYPTED = 2, - QAPI_ERROR_CLASS_DEVICENOTACTIVE = 3, - QAPI_ERROR_CLASS_DEVICENOTFOUND = 4, - QAPI_ERROR_CLASS_KVMMISSINGCAP = 5, - QAPI_ERROR_CLASS__MAX = 6, + QAPI_ERROR_CLASS_GENERICERROR, + QAPI_ERROR_CLASS_COMMANDNOTFOUND, + QAPI_ERROR_CLASS_DEVICEENCRYPTED, + QAPI_ERROR_CLASS_DEVICENOTACTIVE, + QAPI_ERROR_CLASS_DEVICENOTFOUND, + QAPI_ERROR_CLASS_KVMMISSINGCAP, + QAPI_ERROR_CLASS__MAX, } QapiErrorClass; extern const char *const QapiErrorClass_lookup[]; -#endif /* QAPI_QAPI_TYPES_COMMON_H */ +#endif /* QAPI_TYPES_COMMON_H */ diff --git a/msvc/unicorn/qapi/qapi-types-misc.c b/msvc/unicorn/qapi/qapi-types-misc.c index 52a0d06a..e751d968 100644 --- a/msvc/unicorn/qapi/qapi-types-misc.c +++ b/msvc/unicorn/qapi/qapi-types-misc.c @@ -12,8 +12,8 @@ #include "qemu/osdep.h" #include "qapi/dealloc-visitor.h" -#include "qapi/qapi-types-misc.h" -#include "qapi/qapi-visit-misc.h" +#include "qapi-types-misc.h" +#include "qapi-visit-misc.h" const char *const X86CPURegister32_lookup[] = { "EAX", @@ -65,5 +65,6 @@ void qapi_free_DummyForceArrays(DummyForceArrays *obj) visit_type_DummyForceArrays(v, NULL, &obj, NULL); visit_free(v); } + /* Dummy declaration to prevent empty .o file */ -char dummy_qapi_qapi_types_misc_c; +char dummy_qapi_types_misc_c; diff --git a/msvc/unicorn/qapi/qapi-types-misc.h b/msvc/unicorn/qapi/qapi-types-misc.h index 3b3e178f..1049ec70 100644 --- a/msvc/unicorn/qapi/qapi-types-misc.h +++ b/msvc/unicorn/qapi/qapi-types-misc.h @@ -10,21 +10,21 @@ * See the COPYING.LIB file in the top-level directory. */ -#ifndef QAPI_QAPI_TYPES_MISC_H -#define QAPI_QAPI_TYPES_MISC_H +#ifndef QAPI_TYPES_MISC_H +#define QAPI_TYPES_MISC_H -#include "qapi-builtin-types.h" +#include "qapi/qapi-builtin-types.h" typedef enum X86CPURegister32 { - X86_CPU_REGISTER32_EAX = 0, - X86_CPU_REGISTER32_EBX = 1, - X86_CPU_REGISTER32_ECX = 2, - X86_CPU_REGISTER32_EDX = 3, - X86_CPU_REGISTER32_ESP = 4, - X86_CPU_REGISTER32_EBP = 5, - X86_CPU_REGISTER32_ESI = 6, - X86_CPU_REGISTER32_EDI = 7, - X86_CPU_REGISTER32__MAX = 8, + X86_CPU_REGISTER32_EAX, + X86_CPU_REGISTER32_EBX, + X86_CPU_REGISTER32_ECX, + X86_CPU_REGISTER32_EDX, + X86_CPU_REGISTER32_ESP, + X86_CPU_REGISTER32_EBP, + X86_CPU_REGISTER32_ESI, + X86_CPU_REGISTER32_EDI, + X86_CPU_REGISTER32__MAX, } X86CPURegister32; extern const char *const X86CPURegister32_lookup[]; @@ -58,4 +58,4 @@ struct DummyForceArrays { void qapi_free_DummyForceArrays(DummyForceArrays *obj); -#endif /* QAPI_QAPI_TYPES_MISC_H */ +#endif /* QAPI_TYPES_MISC_H */ diff --git a/msvc/unicorn/qapi/qapi-types.c b/msvc/unicorn/qapi/qapi-types.c index 05fccd92..a5e81690 100644 --- a/msvc/unicorn/qapi/qapi-types.c +++ b/msvc/unicorn/qapi/qapi-types.c @@ -15,63 +15,5 @@ #include "qapi-types.h" #include "qapi-visit.h" -const char *const QapiErrorClass_lookup[] = { - "GenericError", - "CommandNotFound", - "DeviceEncrypted", - "DeviceNotActive", - "DeviceNotFound", - "KVMMissingCap", - NULL, -}; - -const char *const X86CPURegister32_lookup[] = { - "EAX", - "EBX", - "ECX", - "EDX", - "ESP", - "EBP", - "ESI", - "EDI", - NULL, -}; - -void qapi_free_X86CPUFeatureWordInfo(X86CPUFeatureWordInfo *obj) -{ - Visitor *v; - - if (!obj) { - return; - } - - v = qapi_dealloc_visitor_new(); - visit_type_X86CPUFeatureWordInfo(v, NULL, &obj, NULL); - visit_free(v); -} - -void qapi_free_X86CPUFeatureWordInfoList(X86CPUFeatureWordInfoList *obj) -{ - Visitor *v; - - if (!obj) { - return; - } - - v = qapi_dealloc_visitor_new(); - visit_type_X86CPUFeatureWordInfoList(v, NULL, &obj, NULL); - visit_free(v); -} - -void qapi_free_DummyForceArrays(DummyForceArrays *obj) -{ - Visitor *v; - - if (!obj) { - return; - } - - v = qapi_dealloc_visitor_new(); - visit_type_DummyForceArrays(v, NULL, &obj, NULL); - visit_free(v); -} +/* Dummy declaration to prevent empty .o file */ +char dummy_qapi_types_c; diff --git a/msvc/unicorn/qapi/qapi-types.h b/msvc/unicorn/qapi/qapi-types.h index dfab1b92..5b9f3bed 100644 --- a/msvc/unicorn/qapi/qapi-types.h +++ b/msvc/unicorn/qapi/qapi-types.h @@ -13,61 +13,8 @@ #ifndef QAPI_TYPES_H #define QAPI_TYPES_H -#include "qapi-builtin-types.h" - -typedef enum QapiErrorClass { - QAPI_ERROR_CLASS_GENERICERROR = 0, - QAPI_ERROR_CLASS_COMMANDNOTFOUND = 1, - QAPI_ERROR_CLASS_DEVICEENCRYPTED = 2, - QAPI_ERROR_CLASS_DEVICENOTACTIVE = 3, - QAPI_ERROR_CLASS_DEVICENOTFOUND = 4, - QAPI_ERROR_CLASS_KVMMISSINGCAP = 5, - QAPI_ERROR_CLASS__MAX = 6, -} QapiErrorClass; - -extern const char *const QapiErrorClass_lookup[]; - -typedef enum X86CPURegister32 { - X86_CPU_REGISTER32_EAX = 0, - X86_CPU_REGISTER32_EBX = 1, - X86_CPU_REGISTER32_ECX = 2, - X86_CPU_REGISTER32_EDX = 3, - X86_CPU_REGISTER32_ESP = 4, - X86_CPU_REGISTER32_EBP = 5, - X86_CPU_REGISTER32_ESI = 6, - X86_CPU_REGISTER32_EDI = 7, - X86_CPU_REGISTER32__MAX = 8, -} X86CPURegister32; - -extern const char *const X86CPURegister32_lookup[]; - -typedef struct X86CPUFeatureWordInfo X86CPUFeatureWordInfo; - -typedef struct X86CPUFeatureWordInfoList X86CPUFeatureWordInfoList; - -typedef struct DummyForceArrays DummyForceArrays; - -struct X86CPUFeatureWordInfo { - int64_t cpuid_input_eax; - bool has_cpuid_input_ecx; - int64_t cpuid_input_ecx; - X86CPURegister32 cpuid_register; - int64_t features; -}; - -void qapi_free_X86CPUFeatureWordInfo(X86CPUFeatureWordInfo *obj); - -struct X86CPUFeatureWordInfoList { - X86CPUFeatureWordInfoList *next; - X86CPUFeatureWordInfo *value; -}; - -void qapi_free_X86CPUFeatureWordInfoList(X86CPUFeatureWordInfoList *obj); - -struct DummyForceArrays { - X86CPUFeatureWordInfoList *unused; -}; - -void qapi_free_DummyForceArrays(DummyForceArrays *obj); +#include "qapi/qapi-builtin-types.h" +#include "qapi-types-common.h" +#include "qapi-types-misc.h" #endif /* QAPI_TYPES_H */ diff --git a/msvc/unicorn/qapi/qapi-visit-common.c b/msvc/unicorn/qapi/qapi-visit-common.c index c3fb07a5..353da0da 100644 --- a/msvc/unicorn/qapi/qapi-visit-common.c +++ b/msvc/unicorn/qapi/qapi-visit-common.c @@ -14,7 +14,7 @@ #include "qemu-common.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" -#include "qapi-visit.h" +#include "qapi-visit-common.h" void visit_type_QapiErrorClass(Visitor *v, const char *name, QapiErrorClass *obj, Error **errp) { @@ -22,5 +22,6 @@ void visit_type_QapiErrorClass(Visitor *v, const char *name, QapiErrorClass *obj visit_type_enum(v, name, &value, QapiErrorClass_lookup, errp); *obj = value; } + /* Dummy declaration to prevent empty .o file */ -char dummy_qapi_qapi_visit_common_c; +char dummy_qapi_visit_common_c; diff --git a/msvc/unicorn/qapi/qapi-visit-common.h b/msvc/unicorn/qapi/qapi-visit-common.h index 525cde7c..d8873ff0 100644 --- a/msvc/unicorn/qapi/qapi-visit-common.h +++ b/msvc/unicorn/qapi/qapi-visit-common.h @@ -10,12 +10,12 @@ * See the COPYING.LIB file in the top-level directory. */ -#ifndef QAPI_QAPI_VISIT_COMMON_H -#define QAPI_QAPI_VISIT_COMMON_H +#ifndef QAPI_VISIT_COMMON_H +#define QAPI_VISIT_COMMON_H -#include "qapi-builtin-visit.h" -#include "qapi-types.h" +#include "qapi/qapi-builtin-visit.h" +#include "qapi-types-common.h" void visit_type_QapiErrorClass(Visitor *v, const char *name, QapiErrorClass *obj, Error **errp); -#endif /* QAPI_QAPI_VISIT_COMMON_H */ +#endif /* QAPI_VISIT_COMMON_H */ diff --git a/msvc/unicorn/qapi/qapi-visit-misc.c b/msvc/unicorn/qapi/qapi-visit-misc.c index e7c71c97..bc10cef6 100644 --- a/msvc/unicorn/qapi/qapi-visit-misc.c +++ b/msvc/unicorn/qapi/qapi-visit-misc.c @@ -14,7 +14,7 @@ #include "qemu-common.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" -#include "qapi/qapi-visit-misc.h" +#include "qapi-visit-misc.h" void visit_type_X86CPURegister32(Visitor *v, const char *name, X86CPURegister32 *obj, Error **errp) { @@ -145,5 +145,6 @@ out_obj: out: error_propagate(errp, err); } + /* Dummy declaration to prevent empty .o file */ -char dummy_qapi_qapi_visit_misc_c; +char dummy_qapi_visit_misc_c; diff --git a/msvc/unicorn/qapi/qapi-visit-misc.h b/msvc/unicorn/qapi/qapi-visit-misc.h index ab4f58ed..e1e0ef81 100644 --- a/msvc/unicorn/qapi/qapi-visit-misc.h +++ b/msvc/unicorn/qapi/qapi-visit-misc.h @@ -10,11 +10,11 @@ * See the COPYING.LIB file in the top-level directory. */ -#ifndef QAPI_QAPI_VISIT_MISC_H -#define QAPI_QAPI_VISIT_MISC_H +#ifndef QAPI_VISIT_MISC_H +#define QAPI_VISIT_MISC_H -#include "qapi-builtin-visit.h" -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-builtin-visit.h" +#include "qapi-types-misc.h" void visit_type_X86CPURegister32(Visitor *v, const char *name, X86CPURegister32 *obj, Error **errp); @@ -25,4 +25,4 @@ void visit_type_X86CPUFeatureWordInfoList(Visitor *v, const char *name, X86CPUFe void visit_type_DummyForceArrays_members(Visitor *v, DummyForceArrays *obj, Error **errp); void visit_type_DummyForceArrays(Visitor *v, const char *name, DummyForceArrays **obj, Error **errp); -#endif /* QAPI_QAPI_VISIT_MISC_H */ +#endif /* QAPI_VISIT_MISC_H */ diff --git a/msvc/unicorn/qapi/qapi-visit.c b/msvc/unicorn/qapi/qapi-visit.c index c602828e..f1ba4faa 100644 --- a/msvc/unicorn/qapi/qapi-visit.c +++ b/msvc/unicorn/qapi/qapi-visit.c @@ -16,139 +16,5 @@ #include "qapi/qmp/qerror.h" #include "qapi-visit.h" -void visit_type_QapiErrorClass(Visitor *v, const char *name, QapiErrorClass *obj, Error **errp) -{ - int value = *obj; - visit_type_enum(v, name, &value, QapiErrorClass_lookup, errp); - *obj = value; -} - -void visit_type_X86CPURegister32(Visitor *v, const char *name, X86CPURegister32 *obj, Error **errp) -{ - int value = *obj; - visit_type_enum(v, name, &value, X86CPURegister32_lookup, errp); - *obj = value; -} - -void visit_type_X86CPUFeatureWordInfo_members(Visitor *v, X86CPUFeatureWordInfo *obj, Error **errp) -{ - Error *err = NULL; - - visit_type_int(v, "cpuid-input-eax", &obj->cpuid_input_eax, &err); - if (err) { - goto out; - } - if (visit_optional(v, "cpuid-input-ecx", &obj->has_cpuid_input_ecx)) { - visit_type_int(v, "cpuid-input-ecx", &obj->cpuid_input_ecx, &err); - if (err) { - goto out; - } - } - visit_type_X86CPURegister32(v, "cpuid-register", &obj->cpuid_register, &err); - if (err) { - goto out; - } - visit_type_int(v, "features", &obj->features, &err); - if (err) { - goto out; - } - -out: - error_propagate(errp, err); -} - -void visit_type_X86CPUFeatureWordInfo(Visitor *v, const char *name, X86CPUFeatureWordInfo **obj, Error **errp) -{ - Error *err = NULL; - - visit_start_struct(v, name, (void **)obj, sizeof(X86CPUFeatureWordInfo), &err); - if (err) { - goto out; - } - if (!*obj) { - goto out_obj; - } - visit_type_X86CPUFeatureWordInfo_members(v, *obj, &err); - if (err) { - goto out_obj; - } - visit_check_struct(v, &err); -out_obj: - visit_end_struct(v, (void **)obj); - if (err && visit_is_input(v)) { - qapi_free_X86CPUFeatureWordInfo(*obj); - *obj = NULL; - } -out: - error_propagate(errp, err); -} - -void visit_type_X86CPUFeatureWordInfoList(Visitor *v, const char *name, X86CPUFeatureWordInfoList **obj, Error **errp) -{ - Error *err = NULL; - X86CPUFeatureWordInfoList *tail; - size_t size = sizeof(**obj); - - visit_start_list(v, name, (GenericList **)obj, size, &err); - if (err) { - goto out; - } - - for (tail = *obj; tail; - tail = (X86CPUFeatureWordInfoList *)visit_next_list(v, (GenericList *)tail, size)) { - visit_type_X86CPUFeatureWordInfo(v, NULL, &tail->value, &err); - if (err) { - break; - } - } - - if (!err) { - visit_check_list(v, &err); - } - visit_end_list(v, (void **)obj); - if (err && visit_is_input(v)) { - qapi_free_X86CPUFeatureWordInfoList(*obj); - *obj = NULL; - } -out: - error_propagate(errp, err); -} - -void visit_type_DummyForceArrays_members(Visitor *v, DummyForceArrays *obj, Error **errp) -{ - Error *err = NULL; - - visit_type_X86CPUFeatureWordInfoList(v, "unused", &obj->unused, &err); - if (err) { - goto out; - } - -out: - error_propagate(errp, err); -} - -void visit_type_DummyForceArrays(Visitor *v, const char *name, DummyForceArrays **obj, Error **errp) -{ - Error *err = NULL; - - visit_start_struct(v, name, (void **)obj, sizeof(DummyForceArrays), &err); - if (err) { - goto out; - } - if (!*obj) { - goto out_obj; - } - visit_type_DummyForceArrays_members(v, *obj, &err); - if (err) { - goto out_obj; - } - visit_check_struct(v, &err); -out_obj: - visit_end_struct(v, (void **)obj); - if (err && visit_is_input(v)) { - qapi_free_DummyForceArrays(*obj); - *obj = NULL; - } -out: - error_propagate(errp, err); -} +/* Dummy declaration to prevent empty .o file */ +char dummy_qapi_visit_c; diff --git a/msvc/unicorn/qapi/qapi-visit.h b/msvc/unicorn/qapi/qapi-visit.h index 146055d5..873e3f04 100644 --- a/msvc/unicorn/qapi/qapi-visit.h +++ b/msvc/unicorn/qapi/qapi-visit.h @@ -13,17 +13,10 @@ #ifndef QAPI_VISIT_H #define QAPI_VISIT_H -#include "qapi-builtin-visit.h" +#include "qapi/qapi-builtin-visit.h" #include "qapi-types.h" -void visit_type_QapiErrorClass(Visitor *v, const char *name, QapiErrorClass *obj, Error **errp); -void visit_type_X86CPURegister32(Visitor *v, const char *name, X86CPURegister32 *obj, Error **errp); - -void visit_type_X86CPUFeatureWordInfo_members(Visitor *v, X86CPUFeatureWordInfo *obj, Error **errp); -void visit_type_X86CPUFeatureWordInfo(Visitor *v, const char *name, X86CPUFeatureWordInfo **obj, Error **errp); -void visit_type_X86CPUFeatureWordInfoList(Visitor *v, const char *name, X86CPUFeatureWordInfoList **obj, Error **errp); - -void visit_type_DummyForceArrays_members(Visitor *v, DummyForceArrays *obj, Error **errp); -void visit_type_DummyForceArrays(Visitor *v, const char *name, DummyForceArrays **obj, Error **errp); +#include "qapi-visit-common.h" +#include "qapi-visit-misc.h" #endif /* QAPI_VISIT_H */