Re: [g-a-devel] RFC: AtkText simplification (take 2)



On 06/24/2013 01:51 PM, Trevor Saunders wrote:
  b) Add the generic boundary now. The enum would be something like:
    typedef enum {
      ATK_TEXT_BOUNDARY_CHAR,
      ATK_TEXT_BOUNDARY_WORD_START,
      ATK_TEXT_BOUNDARY_WORD_END,
      ATK_TEXT_BOUNDARY_SENTENCE_START,
      ATK_TEXT_BOUNDARY_SENTENCE_END,
      ATK_TEXT_BOUNDARY_LINE_START,
      ATK_TEXT_BOUNDARY_LINE_END
      ATK_TEXT_BOUNDARY_WORD,
      ATK_TEXT_BOUNDARY_SENTENCE,
      ATK_TEXT_BOUNDARY_LINE
    } AtkTextBoundary;
why not define the enum like this

     typedef enum {
       ATK_TEXT_BOUNDARY_CHAR,
       ATK_TEXT_BOUNDARY_WORD_START,
       ATK_TEXT_BOUNDARY_WORD_END,
       ATK_TEXT_BOUNDARY_SENTENCE_START,
       ATK_TEXT_BOUNDARY_SENTENCE_END,
       ATK_TEXT_BOUNDARY_LINE_START,
       ATK_TEXT_BOUNDARY_LINE_END
       ATK_TEXT_BOUNDARY_WORD = ATK_TEXT_BOUNDARY_WORD_START,
       ATK_TEXT_BOUNDARY_SENTENCE = ATK_TEXT_BOUNDARY_SENTENCE_START,
       ATK_TEXT_BOUNDARY_LINE = ATK_TEXT_BOUNDARY_LINE_START
     } AtkTextBoundary;

Since the start and generic constants have the same meaning I don't see
a reason they can't have the same value and that way you never need to
break ABI just source code compatability.

Yes probably it is a good idea to do something like that if possible. In
any case, my main concern was about having two macro enums with the same
meaning (so the need of the aliases). But probably I was being too
clear-code-zealot here.

BR

-- 
Alejandro Piñeiro Iglesias



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