[Xcb] [PATCH] c_client.py: Add padding after full_sequence for certain XGE events.

Keith Packard keithp at keithp.com
Mon Dec 30 17:27:41 PST 2013


Keith Packard <keithp at keithp.com> writes:

> I wrote this by hand, just to check to see if it worked (only tested on
> 32-bit, I'm afraid):

Here's another idea; avoids the endian issues by using memcpy, and also
eliminates the macros in preference for inline functions:

#include <string.h>

typedef uint32_t xcb_uint64_t[2];

static inline uint64_t _xcb_uint64(xcb_uint64_t u) {
    uint64_t        result;
    memcpy(&result, u, sizeof (uint64_t));
    return result;
}

#define xcb_uint64(x)   _xcb_uint64(x)

static inline void xcb_uint64_store(xcb_uint64_t u, uint64_t v) {
     memcpy(u, &v, sizeof (uint64_t));
}

/**
 * @brief xcb_present_complete_notify_event_t
 **/
typedef struct xcb_present_complete_notify_event_t {
    uint8_t             response_type; /**<  */
    uint8_t             extension; /**<  */
    uint16_t            sequence; /**<  */
    uint32_t            length; /**<  */
    uint16_t            event_type; /**<  */
    uint8_t             kind; /**<  */
    uint8_t             mode; /**<  */
    xcb_present_event_t event; /**<  */
    xcb_window_t        window; /**<  */
    uint32_t            serial; /**<  */
    xcb_uint64_t        ust; /**<  */
    uint32_t            full_sequence; /**<  */
    xcb_uint64_t        msc; /**<  */
} xcb_present_complete_notify_event_t;

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20131230/ff90d2f4/attachment.pgp>


More information about the Xcb mailing list