Re: [xkbcommon] Make C++ happy.

2013-09-26 Thread Wander Lairson Costa
2013/9/26 Bill Spitzak : > Wander Lairson Costa wrote: > >> /** Flags for keymap compilation. */ >> enum xkb_keymap_compile_flags { >> +/** Do not apply any flag. */ >> +XKB_MAP_COMPILE_NO_FLAG = 0, >> /** Apparently you can't have empty enums. What a drag. */ >> XKB_MAP_COMPIL

Re: [xkbcommon] Make C++ happy.

2013-09-26 Thread Bill Spitzak
Wander Lairson Costa wrote: /** Flags for keymap compilation. */ enum xkb_keymap_compile_flags { +/** Do not apply any flag. */ +XKB_MAP_COMPILE_NO_FLAG = 0, /** Apparently you can't have empty enums. What a drag. */ XKB_MAP_COMPILE_PLACEHOLDER = 0 }; I think you can remo

Re: [xkbcommon] Make C++ happy.

2013-09-26 Thread Wander Lairson Costa
2013/9/26 Ran Benita : > On Thu, Sep 26, 2013 at 09:35:33AM -0300, Wander Lairson Costa wrote: >> For most functions taking an enum flags parameter, we use 0 value to >> indicate that no flags should be applied. >> >> C++ has a stronger type system than C and will not implicitly convert >> int's to

Re: [xkbcommon] Make C++ happy.

2013-09-26 Thread Ran Benita
On Thu, Sep 26, 2013 at 09:35:33AM -0300, Wander Lairson Costa wrote: > For most functions taking an enum flags parameter, we use 0 value to > indicate that no flags should be applied. > > C++ has a stronger type system than C and will not implicitly convert > int's to enum's. Thus, we create vali

[xkbcommon] Make C++ happy.

2013-09-26 Thread Wander Lairson Costa
For most functions taking an enum flags parameter, we use 0 value to indicate that no flags should be applied. C++ has a stronger type system than C and will not implicitly convert int's to enum's. Thus, we create valid 0 enum values for enum types where it makes sense. Signed-off-by: Wander Lair

Re: [xkbcommon] Make C++ happy.

2013-09-25 Thread Ran Benita
On Tue, Sep 24, 2013 at 08:26:27PM -0300, Wander Lairson Costa wrote: > C++ has a stronger type system than C and will not implicitly convert > int's to enum's. If we do not want to give any flags to xkb_context_new, > we must pass 0 as its argument. > > Therefore, we create a valid xkb_context_fl

[xkbcommon] Make C++ happy.

2013-09-24 Thread Wander Lairson Costa
C++ has a stronger type system than C and will not implicitly convert int's to enum's. If we do not want to give any flags to xkb_context_new, we must pass 0 as its argument. Therefore, we create a valid xkb_context_flags enum 0 value to avoid ugly casts in C++. Signed-off-by: Wander Lairson Cost