diff options
Diffstat (limited to 'libX11/src')
-rw-r--r-- | libX11/src/GetFProp.c | 27 | ||||
-rw-r--r-- | libX11/src/PropAlloc.c | 7 | ||||
-rw-r--r-- | libX11/src/udcInf.c | 8 |
3 files changed, 17 insertions, 25 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/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); } |