Skip to content

Deal with error fields

Uli Schlachter requested to merge psychon/xcbproto:error-fields into master

This fixes #16 (closed) by removing all fields from errors. Instead, these fields are now implicit and are added by the parser.

This change causes the following diff for libxcb (note that the errors in GLX got smaller, because previously they explicitly contained their padding...):

diff --git a/src/damage.h b/src/damage.h
index 213517f..ff99ccb 100644
--- a/src/damage.h
+++ b/src/damage.h
@@ -53,6 +53,9 @@ typedef struct xcb_damage_bad_damage_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_damage_bad_damage_error_t;
 
 /**
diff --git a/src/glx.h b/src/glx.h
index d864bcc..f53d818 100644
--- a/src/glx.h
+++ b/src/glx.h
@@ -147,78 +147,217 @@ typedef struct xcb_glx_generic_error_t {
     uint32_t bad_value;
     uint16_t minor_opcode;
     uint8_t  major_opcode;
-    uint8_t  pad0[21];
 } xcb_glx_generic_error_t;
 
 /** Opcode for xcb_glx_bad_context. */
 #define XCB_GLX_BAD_CONTEXT 0
 
-typedef xcb_glx_generic_error_t xcb_glx_bad_context_error_t;
+/**
+ * @brief xcb_glx_bad_context_error_t
+ **/
+typedef struct xcb_glx_bad_context_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_bad_context_error_t;
 
 /** Opcode for xcb_glx_bad_context_state. */
 #define XCB_GLX_BAD_CONTEXT_STATE 1
 
-typedef xcb_glx_generic_error_t xcb_glx_bad_context_state_error_t;
+/**
+ * @brief xcb_glx_bad_context_state_error_t
+ **/
+typedef struct xcb_glx_bad_context_state_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_bad_context_state_error_t;
 
 /** Opcode for xcb_glx_bad_drawable. */
 #define XCB_GLX_BAD_DRAWABLE 2
 
-typedef xcb_glx_generic_error_t xcb_glx_bad_drawable_error_t;
+/**
+ * @brief xcb_glx_bad_drawable_error_t
+ **/
+typedef struct xcb_glx_bad_drawable_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_bad_drawable_error_t;
 
 /** Opcode for xcb_glx_bad_pixmap. */
 #define XCB_GLX_BAD_PIXMAP 3
 
-typedef xcb_glx_generic_error_t xcb_glx_bad_pixmap_error_t;
+/**
+ * @brief xcb_glx_bad_pixmap_error_t
+ **/
+typedef struct xcb_glx_bad_pixmap_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_bad_pixmap_error_t;
 
 /** Opcode for xcb_glx_bad_context_tag. */
 #define XCB_GLX_BAD_CONTEXT_TAG 4
 
-typedef xcb_glx_generic_error_t xcb_glx_bad_context_tag_error_t;
+/**
+ * @brief xcb_glx_bad_context_tag_error_t
+ **/
+typedef struct xcb_glx_bad_context_tag_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_bad_context_tag_error_t;
 
 /** Opcode for xcb_glx_bad_current_window. */
 #define XCB_GLX_BAD_CURRENT_WINDOW 5
 
-typedef xcb_glx_generic_error_t xcb_glx_bad_current_window_error_t;
+/**
+ * @brief xcb_glx_bad_current_window_error_t
+ **/
+typedef struct xcb_glx_bad_current_window_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_bad_current_window_error_t;
 
 /** Opcode for xcb_glx_bad_render_request. */
 #define XCB_GLX_BAD_RENDER_REQUEST 6
 
-typedef xcb_glx_generic_error_t xcb_glx_bad_render_request_error_t;
+/**
+ * @brief xcb_glx_bad_render_request_error_t
+ **/
+typedef struct xcb_glx_bad_render_request_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_bad_render_request_error_t;
 
 /** Opcode for xcb_glx_bad_large_request. */
 #define XCB_GLX_BAD_LARGE_REQUEST 7
 
-typedef xcb_glx_generic_error_t xcb_glx_bad_large_request_error_t;
+/**
+ * @brief xcb_glx_bad_large_request_error_t
+ **/
+typedef struct xcb_glx_bad_large_request_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_bad_large_request_error_t;
 
 /** Opcode for xcb_glx_unsupported_private_request. */
 #define XCB_GLX_UNSUPPORTED_PRIVATE_REQUEST 8
 
-typedef xcb_glx_generic_error_t xcb_glx_unsupported_private_request_error_t;
+/**
+ * @brief xcb_glx_unsupported_private_request_error_t
+ **/
+typedef struct xcb_glx_unsupported_private_request_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_unsupported_private_request_error_t;
 
 /** Opcode for xcb_glx_bad_fb_config. */
 #define XCB_GLX_BAD_FB_CONFIG 9
 
-typedef xcb_glx_generic_error_t xcb_glx_bad_fb_config_error_t;
+/**
+ * @brief xcb_glx_bad_fb_config_error_t
+ **/
+typedef struct xcb_glx_bad_fb_config_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_bad_fb_config_error_t;
 
 /** Opcode for xcb_glx_bad_pbuffer. */
 #define XCB_GLX_BAD_PBUFFER 10
 
-typedef xcb_glx_generic_error_t xcb_glx_bad_pbuffer_error_t;
+/**
+ * @brief xcb_glx_bad_pbuffer_error_t
+ **/
+typedef struct xcb_glx_bad_pbuffer_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_bad_pbuffer_error_t;
 
 /** Opcode for xcb_glx_bad_current_drawable. */
 #define XCB_GLX_BAD_CURRENT_DRAWABLE 11
 
-typedef xcb_glx_generic_error_t xcb_glx_bad_current_drawable_error_t;
+/**
+ * @brief xcb_glx_bad_current_drawable_error_t
+ **/
+typedef struct xcb_glx_bad_current_drawable_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_bad_current_drawable_error_t;
 
 /** Opcode for xcb_glx_bad_window. */
 #define XCB_GLX_BAD_WINDOW 12
 
-typedef xcb_glx_generic_error_t xcb_glx_bad_window_error_t;
+/**
+ * @brief xcb_glx_bad_window_error_t
+ **/
+typedef struct xcb_glx_bad_window_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_bad_window_error_t;
 
 /** Opcode for xcb_glx_glx_bad_profile_arb. */
 #define XCB_GLX_GLX_BAD_PROFILE_ARB 13
 
-typedef xcb_glx_generic_error_t xcb_glx_glx_bad_profile_arb_error_t;
+/**
+ * @brief xcb_glx_glx_bad_profile_arb_error_t
+ **/
+typedef struct xcb_glx_glx_bad_profile_arb_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_glx_glx_bad_profile_arb_error_t;
 
 /** Opcode for xcb_glx_pbuffer_clobber. */
 #define XCB_GLX_PBUFFER_CLOBBER 0
diff --git a/src/randr.h b/src/randr.h
index 6235638..f59726b 100644
--- a/src/randr.h
+++ b/src/randr.h
@@ -90,6 +90,9 @@ typedef struct xcb_randr_bad_output_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_randr_bad_output_error_t;
 
 /** Opcode for xcb_randr_bad_crtc. */
@@ -102,6 +105,9 @@ typedef struct xcb_randr_bad_crtc_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_randr_bad_crtc_error_t;
 
 /** Opcode for xcb_randr_bad_mode. */
@@ -114,6 +120,9 @@ typedef struct xcb_randr_bad_mode_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_randr_bad_mode_error_t;
 
 /** Opcode for xcb_randr_bad_provider. */
@@ -126,6 +135,9 @@ typedef struct xcb_randr_bad_provider_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_randr_bad_provider_error_t;
 
 typedef enum xcb_randr_rotation_t {
diff --git a/src/record.h b/src/record.h
index 34c41c1..cfd33f3 100644
--- a/src/record.h
+++ b/src/record.h
@@ -171,6 +171,8 @@ typedef struct xcb_record_bad_context_error_t {
     uint8_t  error_code;
     uint16_t sequence;
     uint32_t invalid_record;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_record_bad_context_error_t;
 
 /**
diff --git a/src/render.h b/src/render.h
index 795c76d..d6f84d5 100644
--- a/src/render.h
+++ b/src/render.h
@@ -196,6 +196,9 @@ typedef struct xcb_render_pict_format_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_render_pict_format_error_t;
 
 /** Opcode for xcb_render_picture. */
@@ -208,6 +211,9 @@ typedef struct xcb_render_picture_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_render_picture_error_t;
 
 /** Opcode for xcb_render_pict_op. */
@@ -220,6 +226,9 @@ typedef struct xcb_render_pict_op_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_render_pict_op_error_t;
 
 /** Opcode for xcb_render_glyph_set. */
@@ -232,6 +241,9 @@ typedef struct xcb_render_glyph_set_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_render_glyph_set_error_t;
 
 /** Opcode for xcb_render_glyph. */
@@ -244,6 +256,9 @@ typedef struct xcb_render_glyph_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_render_glyph_error_t;
 
 /**
diff --git a/src/shm.h b/src/shm.h
index eba7002..e14f176 100644
--- a/src/shm.h
+++ b/src/shm.h
@@ -56,7 +56,17 @@ typedef struct xcb_shm_completion_event_t {
 /** Opcode for xcb_shm_bad_seg. */
 #define XCB_SHM_BAD_SEG 0
 
-typedef xcb_value_error_t xcb_shm_bad_seg_error_t;
+/**
+ * @brief xcb_shm_bad_seg_error_t
+ **/
+typedef struct xcb_shm_bad_seg_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_shm_bad_seg_error_t;
 
 /**
  * @brief xcb_shm_query_version_cookie_t
diff --git a/src/xfixes.h b/src/xfixes.h
index 358bdb5..6af8fb6 100644
--- a/src/xfixes.h
+++ b/src/xfixes.h
@@ -234,6 +234,9 @@ typedef struct xcb_xfixes_bad_region_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_xfixes_bad_region_error_t;
 
 typedef enum xcb_xfixes_region_enum_t {
diff --git a/src/xinput.h b/src/xinput.h
index 0a06d71..d0fea01 100644
--- a/src/xinput.h
+++ b/src/xinput.h
@@ -4093,6 +4093,9 @@ typedef struct xcb_input_device_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_input_device_error_t;
 
 /** Opcode for xcb_input_event. */
@@ -4105,6 +4108,9 @@ typedef struct xcb_input_event_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_input_event_error_t;
 
 /** Opcode for xcb_input_mode. */
@@ -4117,6 +4123,9 @@ typedef struct xcb_input_mode_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_input_mode_error_t;
 
 /** Opcode for xcb_input_device_busy. */
@@ -4129,6 +4138,9 @@ typedef struct xcb_input_device_busy_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_input_device_busy_error_t;
 
 /** Opcode for xcb_input_class. */
@@ -4141,6 +4153,9 @@ typedef struct xcb_input_class_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_input_class_error_t;
 
 /**
diff --git a/src/xkb.h b/src/xkb.h
index 056585b..94f40ba 100644
--- a/src/xkb.h
+++ b/src/xkb.h
@@ -1015,9 +1015,8 @@ typedef struct xcb_xkb_keyboard_error_t {
     uint8_t  error_code;
     uint16_t sequence;
     uint32_t value;
-    uint16_t minorOpcode;
-    uint8_t  majorOpcode;
-    uint8_t  pad0[21];
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_xkb_keyboard_error_t;
 
 typedef enum xcb_xkb_sa_t {
diff --git a/src/xprint.h b/src/xprint.h
index 2763dd0..0825bbc 100644
--- a/src/xprint.h
+++ b/src/xprint.h
@@ -699,6 +699,9 @@ typedef struct xcb_x_print_bad_context_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_x_print_bad_context_error_t;
 
 /** Opcode for xcb_x_print_bad_sequence. */
@@ -711,6 +714,9 @@ typedef struct xcb_x_print_bad_sequence_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_x_print_bad_sequence_error_t;
 
 /**
diff --git a/src/xproto.h b/src/xproto.h
index 64ec3fc..b417f0c 100644
--- a/src/xproto.h
+++ b/src/xproto.h
@@ -1251,7 +1251,6 @@ typedef struct xcb_request_error_t {
     uint32_t bad_value;
     uint16_t minor_opcode;
     uint8_t  major_opcode;
-    uint8_t  pad0;
 } xcb_request_error_t;
 
 /** Opcode for xcb_value. */
@@ -1267,83 +1266,232 @@ typedef struct xcb_value_error_t {
     uint32_t bad_value;
     uint16_t minor_opcode;
     uint8_t  major_opcode;
-    uint8_t  pad0;
 } xcb_value_error_t;
 
 /** Opcode for xcb_window. */
 #define XCB_WINDOW 3
 
-typedef xcb_value_error_t xcb_window_error_t;
+/**
+ * @brief xcb_window_error_t
+ **/
+typedef struct xcb_window_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_window_error_t;
 
 /** Opcode for xcb_pixmap. */
 #define XCB_PIXMAP 4
 
-typedef xcb_value_error_t xcb_pixmap_error_t;
+/**
+ * @brief xcb_pixmap_error_t
+ **/
+typedef struct xcb_pixmap_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_pixmap_error_t;
 
 /** Opcode for xcb_atom. */
 #define XCB_ATOM 5
 
-typedef xcb_value_error_t xcb_atom_error_t;
+/**
+ * @brief xcb_atom_error_t
+ **/
+typedef struct xcb_atom_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_atom_error_t;
 
 /** Opcode for xcb_cursor. */
 #define XCB_CURSOR 6
 
-typedef xcb_value_error_t xcb_cursor_error_t;
+/**
+ * @brief xcb_cursor_error_t
+ **/
+typedef struct xcb_cursor_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_cursor_error_t;
 
 /** Opcode for xcb_font. */
 #define XCB_FONT 7
 
-typedef xcb_value_error_t xcb_font_error_t;
+/**
+ * @brief xcb_font_error_t
+ **/
+typedef struct xcb_font_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_font_error_t;
 
 /** Opcode for xcb_match. */
 #define XCB_MATCH 8
 
-typedef xcb_request_error_t xcb_match_error_t;
+/**
+ * @brief xcb_match_error_t
+ **/
+typedef struct xcb_match_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_match_error_t;
 
 /** Opcode for xcb_drawable. */
 #define XCB_DRAWABLE 9
 
-typedef xcb_value_error_t xcb_drawable_error_t;
+/**
+ * @brief xcb_drawable_error_t
+ **/
+typedef struct xcb_drawable_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_drawable_error_t;
 
 /** Opcode for xcb_access. */
 #define XCB_ACCESS 10
 
-typedef xcb_request_error_t xcb_access_error_t;
+/**
+ * @brief xcb_access_error_t
+ **/
+typedef struct xcb_access_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_access_error_t;
 
 /** Opcode for xcb_alloc. */
 #define XCB_ALLOC 11
 
-typedef xcb_request_error_t xcb_alloc_error_t;
+/**
+ * @brief xcb_alloc_error_t
+ **/
+typedef struct xcb_alloc_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_alloc_error_t;
 
 /** Opcode for xcb_colormap. */
 #define XCB_COLORMAP 12
 
-typedef xcb_value_error_t xcb_colormap_error_t;
+/**
+ * @brief xcb_colormap_error_t
+ **/
+typedef struct xcb_colormap_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_colormap_error_t;
 
 /** Opcode for xcb_g_context. */
 #define XCB_G_CONTEXT 13
 
-typedef xcb_value_error_t xcb_g_context_error_t;
+/**
+ * @brief xcb_g_context_error_t
+ **/
+typedef struct xcb_g_context_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_g_context_error_t;
 
 /** Opcode for xcb_id_choice. */
 #define XCB_ID_CHOICE 14
 
-typedef xcb_value_error_t xcb_id_choice_error_t;
+/**
+ * @brief xcb_id_choice_error_t
+ **/
+typedef struct xcb_id_choice_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_id_choice_error_t;
 
 /** Opcode for xcb_name. */
 #define XCB_NAME 15
 
-typedef xcb_request_error_t xcb_name_error_t;
+/**
+ * @brief xcb_name_error_t
+ **/
+typedef struct xcb_name_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_name_error_t;
 
 /** Opcode for xcb_length. */
 #define XCB_LENGTH 16
 
-typedef xcb_request_error_t xcb_length_error_t;
+/**
+ * @brief xcb_length_error_t
+ **/
+typedef struct xcb_length_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_length_error_t;
 
 /** Opcode for xcb_implementation. */
 #define XCB_IMPLEMENTATION 17
 
-typedef xcb_request_error_t xcb_implementation_error_t;
+/**
+ * @brief xcb_implementation_error_t
+ **/
+typedef struct xcb_implementation_error_t {
+    uint8_t  response_type;
+    uint8_t  error_code;
+    uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
+} xcb_implementation_error_t;
 
 typedef enum xcb_window_class_t {
     XCB_WINDOW_CLASS_COPY_FROM_PARENT = 0,
diff --git a/src/xv.h b/src/xv.h
index c0bcfe8..9e50008 100644
--- a/src/xv.h
+++ b/src/xv.h
@@ -260,6 +260,9 @@ typedef struct xcb_xv_bad_port_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_xv_bad_port_error_t;
 
 /** Opcode for xcb_xv_bad_encoding. */
@@ -272,6 +275,9 @@ typedef struct xcb_xv_bad_encoding_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_xv_bad_encoding_error_t;
 
 /** Opcode for xcb_xv_bad_control. */
@@ -284,6 +290,9 @@ typedef struct xcb_xv_bad_control_error_t {
     uint8_t  response_type;
     uint8_t  error_code;
     uint16_t sequence;
+    uint32_t bad_value;
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_xv_bad_control_error_t;
 
 /** Opcode for xcb_xv_video_notify. */

API Breakage

Why can xkb never be easy? :-(

diff --git a/src/xkb.h b/src/xkb.h
index 056585b..94f40ba 100644
--- a/src/xkb.h
+++ b/src/xkb.h
@@ -1015,9 +1015,8 @@ typedef struct xcb_xkb_keyboard_error_t {
     uint8_t  error_code;
     uint16_t sequence;
     uint32_t value;
-    uint16_t minorOpcode;
-    uint8_t  majorOpcode;
-    uint8_t  pad0[21];
+    uint16_t minor_opcode;
+    uint8_t  major_opcode;
 } xcb_xkb_keyboard_error_t;
 
 typedef enum xcb_xkb_sa_t {

Possible approaches:

  • Ignore this
  • Deal with this by adding more attributes to the XML

Also, previously there was a pad0 in xproto's errors. I do not know why:

diff --git a/src/xproto.h b/src/xproto.h
index 64ec3fc..b417f0c 100644
--- a/src/xproto.h
+++ b/src/xproto.h
@@ -1251,7 +1251,6 @@ typedef struct xcb_request_error_t {
     uint32_t bad_value;
     uint16_t minor_opcode;
     uint8_t  major_opcode;
-    uint8_t  pad0;
 } xcb_request_error_t;
 
 /** Opcode for xcb_value. */
@@ -1267,83 +1266,232 @@ typedef struct xcb_value_error_t {
     uint32_t bad_value;
     uint16_t minor_opcode;
     uint8_t  major_opcode;
-    uint8_t  pad0;
 } xcb_value_error_t;

Merge request reports

Loading