qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH 1/2] Emulated CCID card: QOMify


From: Cao jin
Subject: Re: [Qemu-trivial] [PATCH 1/2] Emulated CCID card: QOMify
Date: Tue, 2 Feb 2016 17:00:43 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0



On 02/02/2016 04:30 PM, Michael Tokarev wrote:
02.02.2016 11:25, Cao jin wrote:
On 02/02/2016 04:15 PM, Michael Tokarev wrote:
Why did you move the type definition from .c to .h file?
It is only referenced in .c, no?
[]
Yes, that type definition is referred only in .c for now, but we are not sure 
about it in the future, for better flexibility, I think put it into .h is 
better. http://wiki.qemu.org/QOMConventions also says:

DO use TYPE_FOO constants, defined in a header if used in other parts of code

The last words in this sentense makes sense, I think:
"if used in other parts of the code".

So I read it as 2-part suggestion:

1) use TYPE_foo constants instead of "literals", and
2) define them in a header file if used elsewhere too.

The "future flexibility" is, in my opinion, questionable.
If we'll use them in the future, we can always move the
#define to the header file.  For now, there's no need
to clutter the heade more, but there's a good reason
to use the #define in the "home" .c file where this
device is implemented, in all places where the device
name is referenced.

At least that's how I read this (somewhat ambiguous)
suggestion in the wiki.

Thanks,

/mjt


leave it where it was is also fine by me, it is not late to move it to header file when it is certainly to be used in other parts. I will update it:)

--
Yours Sincerely,

Cao jin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]