[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: kdelibs/kdecore/kconfig_compiler
From:       Reinhold Kainhofer <reinhold () kainhofer ! com>
Date:       2004-06-26 8:47:30
Message-ID: 200406261047.30792.reinhold () kainhofer ! com
[Download RAW message or body]

Am Samstag, 26. Juni 2004 04:42 schrieb Maks Orlovich:
> The type Foo has the logical size of 2 bits in C++, even though it may take
> a lot more in memory. This means that if you try to assign 7 to it, it'll
> do something unexpected, like truncate it or such. So adding values outside 
> the current range can sometimes cause problems[1]. A solution is to put in
> something like MaxVal = 0xFFFF to the enum to reserve plenty of bits.

Yes, that's what I had in mind, but it seems I mixed two things up ;-((
This might be done by something along the lines
h<< enumName()+"MaxVal = 0xFFFF";

I'd still like to add this, in particular since Zack's KConfigXT tutorial 
(http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html) 
says:
"Enum - This indicates an enumeration. The possible enum values should be 
provided via the <choices> tag. Enum values are accessed as integers by the 
application but stored as string in the configuration file. This makes it 
possible to add more values at a later date without breaking compatibility. "


> -However- I fail to see how the original code addressed that.

Yes, ther was a knot in my brain. There were COUNT elements appended already 
to some enums, so I didn't think too much about it and just followed the 
masses...

Thanks,
Reinhold
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic