Page MenuHomePhabricator

eina: add new range Data type
ClosedPublic

Authored by ali.alzyod on Jan 20 2020, 1:51 AM.

Details

Summary

Introduce new data type (Eina.Range) which represent range (part of series)

eina_range_max_get
eina_range_intersect
eina_range_union
eina_range_contains
eina_range_equal

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ali.alzyod requested review of this revision.Jan 20 2020, 1:51 AM
ali.alzyod created this revision.
ali.alzyod edited the summary of this revision. (Show Details)Jan 20 2020, 1:53 AM
ali.alzyod updated this revision to Diff 28294.Jan 20 2020, 1:59 AM

update document

ali.alzyod updated this revision to Diff 28296.Jan 20 2020, 4:16 AM

rename eina_range_max_get into eina_range_end

cedric accepted this revision.Jan 20 2020, 8:14 AM

Maybe we might want all this function to be inline, other than that it looks good to me.

This revision is now accepted and ready to land.Jan 20 2020, 8:14 AM

Maybe we might want all this function to be inline, other than that it looks good to me.

Does not compiler already do this ? I mean assign function as inline without guidance from developer it if it sees it is necessary.

The compiler can only inline function in files it sees directly when compiling a unit. That is why wine has so many eina_inline*.x files.

The compiler can only inline function in files it sees directly when compiling a unit. That is why wine has so many eina_inline*.x files.

do I need to add inline in .h file or in the .c files ?

In the h files and the c files become the x file basically.

vtorri added a subscriber: vtorri.Jan 20 2020, 10:25 AM

and include the .x file in the .h file

  • use inline functions
cedric requested changes to this revision.Jan 20 2020, 1:17 PM
cedric added inline comments.
src/lib/eina/eina_inline_range.x
23

eina_cpu.h does already provide those if they are not available. You might want to just include it at the top of this file.

37

It would be nice to use EINA_RANGE_INIT for initialization.

59

Wouldn't returning EINA_RANGE_EMPTY work here?

62

In efl we tend to declare symbol at the beginning of a function.

67

Wouldn't EINA_RANGE(min. (max -min)) work here?

This revision now requires changes to proceed.Jan 20 2020, 1:17 PM
ali.alzyod updated this revision to Diff 28304.Jan 20 2020, 2:10 PM
ali.alzyod marked 5 inline comments as done.
  • update
cedric added inline comments.Jan 20 2020, 3:12 PM
src/tests/eina/eina_suite.c
60

Oops, I missed that C&P mistake.

ali.alzyod updated this revision to Diff 28309.Jan 20 2020, 6:29 PM
  • fic typo
ali.alzyod marked an inline comment as done.Jan 20 2020, 6:29 PM

@cedric any more requests ?

woohyun accepted this revision.Jan 22 2020, 1:50 PM

I think this patch is achieved all the requests in the comments now.
So, accepted :)

This revision was not accepted when it landed; it landed in state Needs Review.Jan 22 2020, 2:07 PM
Closed by commit rEFL5137f6d143c6: eina: add new range Data type (authored by ali.alzyod, committed by woohyun). · Explain Why
This revision was automatically updated to reflect the committed changes.