[Xcb] A simple question on XCBGCFunction [SOLVED]

Barton C Massey bart at cs.pdx.edu
Mon Jun 12 20:23:06 PDT 2006


In message <20060611213926.GT4245 at id.minilop.net> you wrote:
> I suppose I could see using varargs for "name"/value pairs:
> 
> fill(&mask, &array,
> 	XCBGCForeground, screen->white_pixel,
> 	XCBGCFunction, XCBGXxor,
> 	0);

Yes, this was the kind of thing I had in mind.

> Implementing this would require sorting the arguments, however, while
> Ian's (and Xlib's) structure-based approach ensures that the values are
> kept in the right order by the compiler.

A lot of times, the efficiency doesn't matter, and the user
really doesn't want to keep track of what goes where.

> > BTW, is auto array initialization legal old ANSI C?
> 
> GCC in C89 mode issues a warning for non-constant array initializer
> elements, but if all the elements are computable at load time then it is
> warning-free. In C99 mode it is warning-free no matter what. In either
> case GCC generates correct code, but I suppose this behavior should not
> be relied on in portable code.

OK, that was my vague memory of the situation---thanks much
for confirming.

    Bart


More information about the Xcb mailing list