qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 00/16] arm: A9MPCore+A15MPCore QOM'ification


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH v2 00/16] arm: A9MPCore+A15MPCore QOM'ification
Date: Tue, 23 Jul 2013 23:36:23 +0200


Am 23.07.2013 um 23:16 schrieb Peter Maydell <address@hidden>:

> On 23 July 2013 20:15, Peter Maydell <address@hidden> wrote:
>> On 23 July 2013 03:43, Andreas Färber <address@hidden> wrote:
>>> v2 improves internal vs. "public" header separation for GIC.
>>> As before, no feedback was received to address PMM's QOM concerns,
>>> so this is what we have as design patterns for the moment.
>> 
>> I had a thought about this. Suppose we have our class header
>> files do something like this:
>> 
>> #ifdef MYCLASS_IMPLEMENTATION
>> #define PRIVATE
>> #else
>> #ifdef __GNUC__
>> #define PRIVATE __attribute__((deprecated("this is a private field")))
>> #else
>> #define PRIVATE
>> #endif
>> 
>> typedef struct MyObject {
>>   int publicfield;
>>   int privatefield PRIVATE;
>> } MyObject;
> 
> Forgot to say, but if people don't think this is an
> intrinsically terrible idea I'll put together a patch that
> does this sometime this week.

I like the idea, but could we make this slightly less upper case? Something like

  __private int privatefield;

feels more readable imho. Or maybe

struct MyObject {
  PUBLIC_FIELDS
  __field int publicfield;
  PRIVATE_FIELDS
  __field int privatefield;
}

We already have comments indicating the sections, so replacing them by valid 
macros feels sensible.
  

Alex




reply via email to

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