int line, pixelsize = bpp/8;
unsigned int line; int pixelsize = bpp/8;
void copy_image(XImage *dest, int x, int y, unsigned int w, unsigned int h) {	/* default (w=0, h=0) is the fill the entire XImage */	if (w < 1)  {		w = dest->width;	}	if (h < 1)  {		h = dest->height;	}	if (use_snapfb && snap_fb && dest != snaprect) {		char *src, *dst;		int line, pixelsize = bpp/8;		src = snap->data + snap->bytes_per_line*y + pixelsize*x;		dst = dest->data;		for (line = 0; line < h; line++) {			memcpy(dst, src, w * pixelsize);			src += snap->bytes_per_line;			dst += dest->bytes_per_line;		}	} else if (raw_fb) {		copy_raw_fb(dest, x, y, w, h);	} else if (using_shm && w == dest->width && h == dest->height) {		XShmGetImage_wr(dpy, window, dest, x, y, AllPlanes);	} else {		XGetSubImage_wr(dpy, window, x, y, w, h, AllPlanes,		    ZPixmap, dest, 0, 0);	}}