[Xcb] Handle multiple <enumref> in a <bitcase>

Daniel Martin consume.noise at gmail.com
Mon May 13 14:33:02 PDT 2013


Hi,

after moving and being a bit lazy afterwards it's time to do something
usefull:

With those 2 patches xcbgen and c_client.py can handle multiple
<enumref> in a <bitcase> and thereby adopt the changes Peter added for
the XKB extension.

The xcbgen patch makes xcbgen incompatible to older c_client.pys and
vice versa. So, I think version bumps (and the dependency modification
in libxcb to xcb-proto) should be done when the patches land in the
repository. But, I'm leaving that decision to someone else and didn't
added the appropriate patches.

That's the diff after applying both patches:

--- orig.src/xkb.c	2013-05-13 21:27:31.886350439 +0200
+++ src/xkb.c	2013-05-13 22:18:48.490738908 +0200
@@ -16223,7 +16223,9 @@ xcb_xkb_get_kbd_by_name_replies_serializ
     unsigned int i;
     char *xcb_tmp;
 
-    if(reported & XCB_XKB_GBN_DETAIL_TYPES) {
+    if((reported & XCB_XKB_GBN_DETAIL_TYPES) ||
+       (reported & XCB_XKB_GBN_DETAIL_CLIENT_SYMBOLS) ||
+       (reported & XCB_XKB_GBN_DETAIL_SERVER_SYMBOLS)) {
         /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_type */
         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.getmap_type;
         xcb_block_len += sizeof(uint8_t);
@@ -16587,7 +16589,8 @@ xcb_xkb_get_kbd_by_name_replies_serializ
         xcb_parts_idx++;
         xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t);
     }
-    if(reported & XCB_XKB_GBN_DETAIL_KEY_NAMES) {
+    if((reported & XCB_XKB_GBN_DETAIL_KEY_NAMES) ||
+       (reported & XCB_XKB_GBN_DETAIL_OTHER_NAMES)) {
         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_type */
         xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyname_type;
         xcb_block_len += sizeof(uint8_t);
@@ -16990,7 +16993,9 @@ xcb_xkb_get_kbd_by_name_replies_unpack (
     unsigned int i;
     unsigned int xcb_tmp_len;
 
-    if(reported & XCB_XKB_GBN_DETAIL_TYPES) {
+    if((reported & XCB_XKB_GBN_DETAIL_TYPES) ||
+       (reported & XCB_XKB_GBN_DETAIL_CLIENT_SYMBOLS) ||
+       (reported & XCB_XKB_GBN_DETAIL_SERVER_SYMBOLS)) {
         /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_type */
         _aux->types.getmap_type = *(uint8_t *)xcb_tmp;
         xcb_block_len += sizeof(uint8_t);
@@ -17322,7 +17327,8 @@ xcb_xkb_get_kbd_by_name_replies_unpack (
         xcb_tmp += xcb_block_len;
         xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t);
     }
-    if(reported & XCB_XKB_GBN_DETAIL_KEY_NAMES) {
+    if((reported & XCB_XKB_GBN_DETAIL_KEY_NAMES) ||
+       (reported & XCB_XKB_GBN_DETAIL_OTHER_NAMES)) {
         /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_type */
         _aux->key_names.keyname_type = *(uint8_t *)xcb_tmp;
         xcb_block_len += sizeof(uint8_t);


Cheers,
    Daniel Martin


More information about the Xcb mailing list