From 8c43a6f05d5ef3c9484bd2be9d4e818d58e62016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 10 Jan 2013 16:19:07 +0100 Subject: Make all static TypeInfos const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all types natively through QEMU Object Model), TypeInfo as used in the common, non-iterative pattern is no longer amended with information and should therefore be const. Fix the documented QOM examples: sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h Since frequently the wrong examples are being copied by contributors of new devices, fix all types in the tree: sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c This also avoids to piggy-back these changes onto real functional changes or other refactorings. Signed-off-by: Andreas Färber Signed-off-by: Anthony Liguori --- include/qom/object.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/qom/object.h b/include/qom/object.h index abe9691cb7..d43b289a40 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -65,7 +65,7 @@ typedef struct InterfaceInfo InterfaceInfo; * int reg0, reg1, reg2; * } MyDevice; * - * static TypeInfo my_device_info = { + * static const TypeInfo my_device_info = { * .name = TYPE_MY_DEVICE, * .parent = TYPE_DEVICE, * .instance_size = sizeof(MyDevice), @@ -138,7 +138,7 @@ typedef struct InterfaceInfo InterfaceInfo; * dc->reset = my_device_reset; * } * - * static TypeInfo my_device_info = { + * static const TypeInfo my_device_info = { * .name = TYPE_MY_DEVICE, * .parent = TYPE_DEVICE, * .instance_size = sizeof(MyDevice), @@ -163,7 +163,7 @@ typedef struct InterfaceInfo InterfaceInfo; * void (*frobnicate) (MyDevice *obj); * } MyDeviceClass; * - * static TypeInfo my_device_info = { + * static const TypeInfo my_device_info = { * .name = TYPE_MY_DEVICE, * .parent = TYPE_DEVICE, * .instance_size = sizeof(MyDevice), -- cgit v1.2.3