[Xcb] Structure pointers

Jamey Sharp jamey at minilop.net
Thu Oct 12 11:14:04 PDT 2006


Hi Russell,

Jeremy's right that we'll be copying your structure anyway, but you're
right that there's no need to copy it twice.

Josh and others: should we transform request/field tags with a type
declared by a struct or union tag into a pointer to the appropriate
type?

--Jamey

(We may present a new API someday, or adjust the implementation of the
current one, so it doesn't copy your data at all. But I haven't figured
out how to make it work in standard C yet.)

On Fri, Oct 13, 2006 at 02:44:32AM +1000, Russell Shaw wrote:
> Hi,
> In this prototype (render.c):
> 
> xcb_void_cookie_t
> xcb_render_fill_rectangles (xcb_connection_t      *c,
>                             uint8_t                op,
>                             xcb_render_picture_t   dst,
>                             xcb_render_color_t     color,
>                             uint32_t               rects_len,
>                             const xcb_rectangle_t *rects)
> 
> the parameter: "xcb_render_color_t color" is passing a whole structure
> by value instead of as a pointer. Wouldn't this be more C-like and
> efficient?:
> 
> xcb_void_cookie_t
> xcb_render_fill_rectangles (xcb_connection_t      *c,
>                             uint8_t                op,
>                             xcb_render_picture_t   dst,
>                             xcb_render_color_t     *color,     /* pointer */
>                             uint32_t               rects_len,
>                             const xcb_rectangle_t *rects)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20061012/e78e9927/attachment-0001.pgp


More information about the Xcb mailing list