drawings ops structures

2 messages, 2 authors, 2002-08-22 · open the first message on its own page

drawings ops structures

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2002-08-19 19:25:04

If I look at these definitions in <linux/fb.h>:

| struct fb_copyarea {
|         __u32 sx;       /* screen-relative */
|         __u32 sy;
|         __u32 width;
|         __u32 height;
|         __u32 dx;
|         __u32 dy;
| };
| 
| struct fb_fillrect {
|         __u32 dx;       /* screen-relative */
|         __u32 dy;
|         __u32 width;
|         __u32 height;
|         __u32 color;
|         __u32 rop;
| };
| 
| struct fb_image {
|         __u32 width;    /* Size of image */
|         __u32 height;
|         __u16 dx;       /* Where to place image */
|         __u16 dy;
|         __u32 fg_color; /* Only used when a mono bitmap */
|         __u32 bg_color;
|         __u8  depth;    /* Dpeth of the image */
|         char  *data;    /* Pointer to image data */
| };

Then I start to wonder ...
  - why are dx and dy in struct fb_image of type __u16, while they are of type
   __u32 in struct fb_copyarea and struct fb_fillrect?
  - why is the order of the fields different for each structure?
    Wouldn't it be better to always use the same order for the common fields,
    e.g.

	__u32 dx;
	__u32 dy;
	__u32 width;
	__u32 height;

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

Re: drawings ops structures

From: James Simmons <hidden>
Date: 2002-08-22 17:45:09

Then I start to wonder ...
  - why are dx and dy in struct fb_image of type __u16, while they are of type
   __u32 in struct fb_copyarea and struct fb_fillrect?
  - why is the order of the fields different for each structure?
    Wouldn't it be better to always use the same order for the common fields,
    e.g.

	__u32 dx;
	__u32 dy;
	__u32 width;
	__u32 height;
I cleaned it up. We have now:

struct fb_copyarea {
        __u32 sx;       /* screen-relative */
        __u32 sy;
        __u32 dx;
        __u32 dy;
        __u32 width;
        __u32 height;
};

struct fb_fillrect {
        __u32 dx;       /* screen-relative */
        __u32 dy;
        __u32 width;
        __u32 height;
        __u32 color;
        __u32 rop;
};

struct fb_image {
        __u32 dx;       /* Where to place image */
        __u32 dy;
        __u32 width;    /* Size of image */
        __u32 height;
        __u32 fg_color; /* Only used when a mono bitmap */
        __u32 bg_color;
        __u8  depth;    /* Dpeth of the image */
        char  *data;    /* Pointer to image data */
};



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help