diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2016-07-29 00:44:38 +0200 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-10 22:52:29 +0200 |
commit | 687d44b6eaa3c64a12af9bbd557b401419b208eb (patch) | |
tree | 55c30ba6b0ae6a2618395fae92922ea4402d52f6 /nx-X11/lib/X11/VisUtil.c | |
parent | ea24f0b0eb7b82ad879810c8e84292d6bf810bea (diff) | |
download | nx-libs-687d44b6eaa3c64a12af9bbd557b401419b208eb.tar.gz nx-libs-687d44b6eaa3c64a12af9bbd557b401419b208eb.tar.bz2 nx-libs-687d44b6eaa3c64a12af9bbd557b401419b208eb.zip |
update src files *[ch] to libX11 1.3.4
Diffstat (limited to 'nx-X11/lib/X11/VisUtil.c')
-rw-r--r-- | nx-X11/lib/X11/VisUtil.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/nx-X11/lib/X11/VisUtil.c b/nx-X11/lib/X11/VisUtil.c index 70f3d999a..3434c0161 100644 --- a/nx-X11/lib/X11/VisUtil.c +++ b/nx-X11/lib/X11/VisUtil.c @@ -32,7 +32,7 @@ in this Software without prior written authorization from The Open Group. #include <stdio.h> /* * This procedure returns a list of visual information structures - * that match the specified attributes given in the visual information + * that match the specified attributes given in the visual information * template. * * If no visuals exist that match the specified attributes, a NULL is @@ -53,12 +53,11 @@ in this Software without prior written authorization from The Open Group. * VisualAllMask */ -XVisualInfo *XGetVisualInfo( dpy, visual_info_mask, - visual_info_template, nitems) -Display *dpy; -register long visual_info_mask; -register XVisualInfo *visual_info_template; -int *nitems; /* RETURN */ +XVisualInfo *XGetVisualInfo( + Display *dpy, + register long visual_info_mask, + register XVisualInfo *visual_info_template, + int *nitems) /* RETURN */ { register Visual *vp; @@ -76,7 +75,7 @@ int *nitems; /* RETURN */ count = 0; total = 10; - if (! (vip_base = vip = (XVisualInfo *) + if (! (vip_base = vip = (XVisualInfo *) Xmalloc((unsigned) (sizeof(XVisualInfo) * total)))) { UnlockDisplay(dpy); return (XVisualInfo *) NULL; @@ -128,13 +127,13 @@ int *nitems; /* RETURN */ (vp->bits_per_rgb != visual_info_template->bits_per_rgb)) continue; /* YEA!!! WE FOUND A GOOD ONE */ - + if (count+1 > total) { XVisualInfo *old_vip_base = vip_base; total += 10; if (! (vip_base = (XVisualInfo *) - Xrealloc((char *) vip_base, + Xrealloc((char *) vip_base, (unsigned) (sizeof(XVisualInfo) * total)))) { Xfree((char *) old_vip_base); UnlockDisplay(dpy); @@ -160,7 +159,7 @@ int *nitems; /* RETURN */ } /* END OF LOOP ON VISUALS */ } /* END OF IF THERE ARE ANY VISUALS AT THIS DEPTH */ - + } /* END OF LOOP ON DEPTHS */ } /* END OF LOOP ON SCREENS */ @@ -180,21 +179,21 @@ int *nitems; /* RETURN */ /* - * This procedure will return the visual information for a visual - * that matches the specified depth and class for a screen. Since - * multiple visuals may exist that match the specified depth and + * This procedure will return the visual information for a visual + * that matches the specified depth and class for a screen. Since + * multiple visuals may exist that match the specified depth and * class, which visual chosen is undefined. * * If a visual is found, True is returned as the function value, * otherwise False is returned. */ -Status XMatchVisualInfo( dpy, screen, depth, class, visual_info) - Display *dpy; - int screen; - int depth; - int class; - XVisualInfo *visual_info; /* RETURNED */ +Status XMatchVisualInfo( + Display *dpy, + int screen, + int depth, + int class, + XVisualInfo *visual_info) /* RETURNED */ { Visual *vp; @@ -225,7 +224,7 @@ Status XMatchVisualInfo( dpy, screen, depth, class, visual_info) /* if nvisuals == 0 then vp will be NULL */ for (jj=0; jj<dp->nvisuals; jj++) { - if (vp->class == class) + if (vp->class == class) { visual_info->visual = _XVIDtoVisual(dpy, vp->visualid); visual_info->visualid = vp->visualid; |