On Thu, 14 Feb 2013 15:10:36 +0900
Tomoki Sekiyama <tomoki.sekiyama...@hitachi.com> wrote:

> Rename 'class' member in class_info of PciDeviceInfo to 'dev_class', and
> add some casts to avoid errors from c++ compiler.

[...]

>  #
>  # @class_info.desc: #optional a string description of the device's class
>  #
> -# @class_info.class: the class code of the device
> +# @class_info.dev_class: the class code of the device
>  #
>  # @id.device: the PCI device id
>  #
> @@ -1171,7 +1171,7 @@
>  ##
>  { 'type': 'PciDeviceInfo',
>    'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
> -           'class_info': {'*desc': 'str', 'class': 'int'},
> +           'class_info': {'*desc': 'str', 'dev_class': 'int'},
>             'id': {'device': 'int', 'vendor': 'int'},
>             '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
>             'regions': ['PciMemoryRegion']} }

The right way of doing this is to add 'class' to the set of reserved
words in scripts/qapi.py:c_var(). Then you'll have to adapt the code to
use the 'q_' prefix.

Now, is using C++ required? Why can't you use plain C?

Reply via email to