Jaehwan Kim <[email protected]> writes:
> 2014년 9월 19일 금요일, Kosyrev Serge<[email protected]>님이 작성한 메시지:
>
>> Tom Hacohen <[email protected] <javascript:;>> writes:
>> > On 19/09/14 05:48, Jaehwan Kim wrote:
>> >>   #define ELM_RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh) (((x) < ((xx)
>> + (ww))) && ((y) < ((yy) + (hh))) && (((x) + (w)) > (xx)) && (((y) + (h)) >
>> (yy)))
>> >>   #define ELM_PI 3.14159265358979323846
>> >> +#define ELM_SCALE_SIZE(x) x / elm_app_base_scale_get() *
>> elm_config_scale_get()
>> >
>> >
>> > This is bad... Very bad...
>> >
>> > Should be:
>> > #define ELM_SCALE_SIZE(x) ((x) / (elm_app_base_scale_get() *
>> > elm_config_scale_get()))
>>
>> Why even allow such complex things to be macros?
>>
>> Static inlines allow better type checking and are much less of a
>> hair-tearing experience in general..
>>
> I think it's not complex like that.
> It is just for convenience of application.

1. Macros arguments are not type-checked
2. It's much easier to make a mistake writing a macro
3. Macro definitions are harder to read
4. Macro usage is harder to debug

--> Macros shouldn't be used, when a static inline function will
    serve equally well

> I think there's no need new inline API.

Macros are members of API as well.

-- 
respectfully,
Серёга Косырев

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to