On Mon, Dec 30, 2013 at 6:58 PM, Tom Hacohen <[email protected]> wrote:
> On 30/12/13 09:03, Cedric BAIL wrote:
>> On Fri, Dec 27, 2013 at 10:20 PM, Tom Hacohen <[email protected]> 
>> wrote:
>>> That's not a nice solution at all. :| It would be much better to have a
>>> typedef so the type will remain the same, and just change the typedef
>>> according to GNU detected or not. Having enums there has the nice
>>> advantage of being able to print the value in gdb and get the enum
>>> string instead of the int value.
>>
>> I would say meh here. Nobody is going to look with gdb over a rb tree.
>> I don't like the idea of duplicating the code path for a use case that
>> will never happen.
>>
>
> It's not the codepath, it's a typedef. :)
> Anyhow, I also suggested:
> enum _Eina_Rbtree_Color;
>
> typedef usigned int Eina_Rbtree_Color;

I still don't see the benefit of such a typedef. You are now removing
the Eina_Rbtree_Color enum to become an unsigned int, making it a
weaker type and not exposing anyway a more stronger type anywhere.
Instead you increase the indirection to one level that is useless.
Before we did have an indirection to the enum directly. Now we have an
unsigned int that at least expose one useful information, the type
size in memory. With your proposal we would have an indirection to an
unsigned int that is linked to nothing obvious. Except if you start to
look randomly around in the the header or if the documentation
explicitly link to it at that level (In which case we could have done
that directly from the documentation of the structure instead of going
to that next level of indirection).

So where is the benefit here ?

> Yes, this case is less important/obvious, but I'm arguing here because:
> 1. That's the example that popped into existence.
> 2. It's important in many other cases, and we need to use the same
> patterns everywhere, and not randomly do things different across our
> code-base.

So basically you are arguing for the sake of arguing and out of context. :-)
-- 
Cedric BAIL

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to