diff options
Diffstat (limited to 'app/xwd/multiVis.c')
-rw-r--r-- | app/xwd/multiVis.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/app/xwd/multiVis.c b/app/xwd/multiVis.c index 7ac57807a..a4451296a 100644 --- a/app/xwd/multiVis.c +++ b/app/xwd/multiVis.c @@ -38,6 +38,7 @@ from The Open Group. #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/X.h> +#include <X11/Intrinsic.h> #include <stdio.h> #include "list.h" #include "wsutils.h" @@ -385,25 +386,11 @@ ReadRegionsInList(Display *disp, Visual *fakeVis, int depth, int format, XImage *reg_image,*ximage ; int srcRect_x,srcRect_y,srcRect_width,srcRect_height ; - int rem ; int bytes_per_line; int bitmap_unit; bitmap_unit = sizeof (long); - if (format == ZPixmap) - bytes_per_line = width*depth/8; - else - bytes_per_line = width/8; - - /* Find out how many more bytes are required for padding so that - ** bytes per scan line will be multiples of bitmap_unit bits */ - if (format == ZPixmap) { - rem = (bytes_per_line*8)%bitmap_unit; - if (rem) - bytes_per_line += (rem/8 + 1); - } - ximage = XCreateImage(disp,fakeVis,depth,format,0,NULL,width,height, 8,0) ; bytes_per_line = ximage->bytes_per_line; @@ -1088,10 +1075,10 @@ int GetXVisualInfo(/* Which X server (aka "display"). */ * do-while loop makes sure we get the entire list from the X server. */ bytesAfter = 0; - numLongs = sizeof(OverlayVisualPropertyRec) / 4; + numLongs = sizeof(OverlayVisualPropertyRec) / sizeof(long); do { - numLongs += bytesAfter * 4; + numLongs += bytesAfter * sizeof(long); XGetWindowProperty(display, RootWindow(display, screen), overlayVisualsAtom, 0, numLongs, False, overlayVisualsAtom, &actualType, &actualFormat, @@ -1100,7 +1087,7 @@ int GetXVisualInfo(/* Which X server (aka "display"). */ /* Calculate the number of overlay visuals in the list. */ - *numOverlayVisuals = numLongs / (sizeof(OverlayVisualPropertyRec) / 4); + *numOverlayVisuals = numLongs / (sizeof(OverlayVisualPropertyRec) / sizeof(long)); } else { |