aboutsummaryrefslogtreecommitdiff
path: root/libX11/src
diff options
context:
space:
mode:
Diffstat (limited to 'libX11/src')
-rw-r--r--libX11/src/GetFProp.c27
-rw-r--r--libX11/src/OpenDis.c4
-rw-r--r--libX11/src/PropAlloc.c7
-rw-r--r--libX11/src/udcInf.c8
4 files changed, 20 insertions, 26 deletions
diff --git a/libX11/src/GetFProp.c b/libX11/src/GetFProp.c
index 27ec98b72..1e0cd3285 100644
--- a/libX11/src/GetFProp.c
+++ b/libX11/src/GetFProp.c
@@ -29,27 +29,24 @@ in this Software without prior written authorization from The Open Group.
#endif
#include "Xlibint.h"
-Bool XGetFontProperty (
+Bool
+XGetFontProperty(
XFontStruct *fs,
register Atom name,
unsigned long *valuePtr)
{
/* XXX this is a simple linear search for now. If the
- protocol is changed to sort the property list, this should
- become a binary search. */
+ protocol is changed to sort the property list, this should
+ become a binary search. */
register XFontProp *prop = fs->properties;
register XFontProp *last = prop + fs->n_properties;
+
while (prop != last) {
- if (prop->name == name) {
- *valuePtr = prop->card32;
- return (1);
- }
- prop++;
- }
- return (0);
+ if (prop->name == name) {
+ *valuePtr = prop->card32;
+ return (1);
+ }
+ prop++;
}
-
-
-
-
-
+ return (0);
+}
diff --git a/libX11/src/OpenDis.c b/libX11/src/OpenDis.c
index 2e5181811..87a3fc430 100644
--- a/libX11/src/OpenDis.c
+++ b/libX11/src/OpenDis.c
@@ -500,6 +500,9 @@ XOpenDisplay (
return(NULL);
}
+/*
+ * get availability of large requests
+ */
dpy->bigreq_size = xcb_get_maximum_request_length(dpy->xcb->connection);
if(dpy->bigreq_size <= dpy->max_request_size)
dpy->bigreq_size = 0;
@@ -526,7 +529,6 @@ XOpenDisplay (
(void) XSynchronize(dpy, _Xdebug);
/*
- * get availability of large requests, and
* get the resource manager database off the root window.
*/
LockDisplay(dpy);
diff --git a/libX11/src/PropAlloc.c b/libX11/src/PropAlloc.c
index bad768153..516283080 100644
--- a/libX11/src/PropAlloc.c
+++ b/libX11/src/PropAlloc.c
@@ -58,12 +58,7 @@ XWMHints *XAllocWMHints (void)
XClassHint *XAllocClassHint (void)
{
- register XClassHint *h;
-
- if ((h = (XClassHint *) Xcalloc (1, (unsigned) sizeof (XClassHint))))
- h->res_name = h->res_class = NULL;
-
- return h;
+ return Xcalloc (1, sizeof (XClassHint));
}
diff --git a/libX11/src/udcInf.c b/libX11/src/udcInf.c
index db7ad10f3..b7577ac96 100644
--- a/libX11/src/udcInf.c
+++ b/libX11/src/udcInf.c
@@ -702,14 +702,14 @@ int *num_gi;
_XlcCloseConverter(conv);
_XlcDestroyLC(lcd);
- *gi = (_XUDCGIInf *)Xmalloc(sizeof(_XUDCGIInf));
- (*gi)->charset_str = (char *)Xmalloc(strlen(charsetname)+1);
- strcpy((*gi)->charset_str,charsetname);
- (*gi)->glyph_index = glyph;
+ *gi = Xmalloc(sizeof(_XUDCGIInf));
if(*gi == NULL){
_xudc_utyerrno = 0x03 ;
return(_XUDC_ERROR);
}
+ (*gi)->charset_str = Xmalloc(strlen(charsetname)+1);
+ strcpy((*gi)->charset_str,charsetname);
+ (*gi)->glyph_index = glyph;
*num_gi = 1;
return(0);
}