[Xcb] [Socket handoff] Waiting forever...

Julien Cristau jcristau at debian.org
Wed Jul 1 09:15:16 PDT 2009


On Wed, Jul  1, 2009 at 11:52:21 -0400, Clemens Eisserer wrote:

> int fillRect(Picture dst, char* data) {
>         unsigned int* req_i = (unsigned int*) data;
>         unsigned short* req_s = (unsigned short*) data;
>         unsigned char* req_b = (unsigned char*) data;
>         
> 	/*Compiler's nightmare ;) */
>         req_b[0] = RENDER;
>         req_b[1] = 26; //FillRectangles-Opcode
>         req_s[1] = 9;  //Request-length
> 
>         req_b[4] = 3; //Over
>         
>         req_i[2] = dst; 
> 
>         req_s[6] = 0xffff; //green
>         req_s[7] = 0xffff; //Red
>         req_s[8] = 0;      //Blue
>         req_s[9] = 0xffff; //A
> 
>         req_s[10] = 100;
>         req_s[11] = 100;
>         req_s[12] = 20;
>         req_s[13] = 20;
> 
>         req_s[14] = 120;
>         req_s[15] = 120;
>         req_s[16] = 10;
>         req_s[17] = 10;
> 
>         return 36;
> }

Why are you using such unreadable horrible code, instead of just filling
an xRenderFillRectanglesReq and two xRectangle structures?

Cheers,
Julien


More information about the Xcb mailing list