@@ -1426,10 +1426,10 @@ static const TypeInfo ac97_info = {
{ },
},
};
+TYPE_INFO(ac97_info)
static void ac97_register_types (void)
{
- type_register_static (&ac97_info);
deprecated_register_soundhw("ac97", "Intel 82801AA AC97 Audio",
0, TYPE_AC97);
}
@@ -318,10 +318,10 @@ static const TypeInfo adlib_info = {
.instance_size = sizeof (AdlibState),
.class_init = adlib_class_initfn,
};
+TYPE_INFO(adlib_info)
static void adlib_register_types (void)
{
- type_register_static (&adlib_info);
deprecated_register_soundhw("adlib", ADLIB_DESC, 1, TYPE_ADLIB);
}
@@ -710,10 +710,10 @@ static const TypeInfo cs4231a_info = {
.instance_init = cs4231a_initfn,
.class_init = cs4231a_class_initfn,
};
+TYPE_INFO(cs4231a_info)
static void cs4231a_register_types (void)
{
- type_register_static (&cs4231a_info);
deprecated_register_soundhw("cs4231a", "CS4231A", 1, TYPE_CS4231A);
}
@@ -918,10 +918,10 @@ static const TypeInfo es1370_info = {
{ },
},
};
+TYPE_INFO(es1370_info)
static void es1370_register_types (void)
{
- type_register_static (&es1370_info);
deprecated_register_soundhw("es1370", "ENSONIQ AudioPCI ES1370",
0, TYPE_ES1370);
}
@@ -312,10 +312,10 @@ static const TypeInfo gus_info = {
.instance_size = sizeof (GUSState),
.class_init = gus_class_initfn,
};
+TYPE_INFO(gus_info)
static void gus_register_types (void)
{
- type_register_static (&gus_info);
deprecated_register_soundhw("gus", "Gravis Ultrasound GF1", 1, TYPE_GUS);
}
@@ -1443,10 +1443,10 @@ static const TypeInfo sb16_info = {
.instance_init = sb16_initfn,
.class_init = sb16_class_initfn,
};
+TYPE_INFO(sb16_info)
static void sb16_register_types (void)
{
- type_register_static (&sb16_info);
deprecated_register_soundhw("sb16", "Creative Sound Blaster 16",
1, TYPE_SB16);
}
@@ -539,10 +539,6 @@ static const TypeInfo ipmi_bmc_extern_type = {
.instance_finalize = ipmi_bmc_extern_finalize,
.class_init = ipmi_bmc_extern_class_init,
};
+TYPE_INFO(ipmi_bmc_extern_type)
-static void ipmi_bmc_extern_register_types(void)
-{
- type_register_static(&ipmi_bmc_extern_type);
-}
-type_init(ipmi_bmc_extern_register_types)
@@ -311,6 +311,7 @@ static const TypeInfo milkymist_memcard_info = {
.instance_init = milkymist_memcard_init,
.class_init = milkymist_memcard_class_init,
};
+TYPE_INFO(milkymist_memcard_info)
static void milkymist_sdbus_class_init(ObjectClass *klass, void *data)
{
@@ -326,11 +327,6 @@ static const TypeInfo milkymist_sdbus_info = {
.instance_size = sizeof(SDBus),
.class_init = milkymist_sdbus_class_init,
};
+TYPE_INFO(milkymist_sdbus_info)
-static void milkymist_memcard_register_types(void)
-{
- type_register_static(&milkymist_memcard_info);
- type_register_static(&milkymist_sdbus_info);
-}
-type_init(milkymist_memcard_register_types)
@@ -526,6 +526,7 @@ static const TypeInfo pl181_info = {
.instance_init = pl181_init,
.class_init = pl181_class_init,
};
+TYPE_INFO(pl181_info)
static void pl181_bus_class_init(ObjectClass *klass, void *data)
{
@@ -541,11 +542,6 @@ static const TypeInfo pl181_bus_info = {
.instance_size = sizeof(SDBus),
.class_init = pl181_bus_class_init,
};
+TYPE_INFO(pl181_bus_info)
-static void pl181_register_types(void)
-{
- type_register_static(&pl181_info);
- type_register_static(&pl181_bus_info);
-}
-type_init(pl181_register_types)
Generated using: $ ./scripts/codeconverter/converter.py -i --passes=2 \ --pattern=TypeRegisterCall,TypeInitMacro $(git grep -l TypeInfo -- '*.[ch]') One notable difference is that files declaring multiple types will now have multiple separate __construtor__ functions declared, instead of one for all types. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- Changes series v2 -> v3: this is a new patch added in series v3 Script was re-run after the rebase, and after being changed to accept spaces in "type_init (...)" and "type_register_static (...)" lines. This is being submitted as a separate patch to make review easier, but it can be squashed into the previous patch once it gets reviewed. --- Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Corey Minyard <minyard@acm.org> Cc: Michael Walle <michael@walle.cc> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org --- hw/audio/ac97.c | 2 +- hw/audio/adlib.c | 2 +- hw/audio/cs4231a.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/gus.c | 2 +- hw/audio/sb16.c | 2 +- hw/ipmi/ipmi_bmc_extern.c | 6 +----- hw/sd/milkymist-memcard.c | 8 ++------ hw/sd/pl181.c | 8 ++------ 9 files changed, 11 insertions(+), 23 deletions(-)