diff options
Diffstat (limited to 'nx-X11/lib/X11/GetHints.c')
-rw-r--r-- | nx-X11/lib/X11/GetHints.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/nx-X11/lib/X11/GetHints.c b/nx-X11/lib/X11/GetHints.c index 1b522c8ef..7bfd35358 100644 --- a/nx-X11/lib/X11/GetHints.c +++ b/nx-X11/lib/X11/GetHints.c @@ -75,7 +75,7 @@ Status XGetSizeHints ( if ((actual_type != XA_WM_SIZE_HINTS) || (nitems < OldNumPropSizeElements) || (actual_format != 32)) { - if (prop != NULL) Xfree ((char *)prop); + Xfree (prop); return(0); } hints->flags = (prop->flags & (USPosition|USSize|PAllHints)); @@ -93,7 +93,7 @@ Status XGetSizeHints ( hints->min_aspect.y = cvtINT32toInt (prop->minAspectY); hints->max_aspect.x = cvtINT32toInt (prop->maxAspectX); hints->max_aspect.y = cvtINT32toInt (prop->maxAspectY); - Xfree((char *)prop); + Xfree(prop); return(1); } @@ -124,11 +124,11 @@ XWMHints *XGetWMHints ( if ((actual_type != XA_WM_HINTS) || (nitems < (NumPropWMHintsElements - 1)) || (actual_format != 32)) { - if (prop != NULL) Xfree ((char *)prop); + Xfree (prop); return(NULL); } /* static copies not allowed in library, due to reentrancy constraint*/ - if ((hints = (XWMHints *) Xcalloc (1, (unsigned) sizeof(XWMHints)))) { + if ((hints = Xcalloc (1, sizeof(XWMHints)))) { hints->flags = prop->flags; hints->input = (prop->input ? True : False); hints->initial_state = cvtINT32toInt (prop->initialState); @@ -142,7 +142,7 @@ XWMHints *XGetWMHints ( else hints->window_group = 0; } - Xfree ((char *)prop); + Xfree (prop); return(hints); } @@ -196,16 +196,15 @@ Status XGetIconSizes ( (nitems < NumPropIconSizeElements) || (nitems % NumPropIconSizeElements != 0) || (actual_format != 32)) { - if (prop != NULL) Xfree ((char *)prop); + Xfree (prop); return(0); } /* static copies not allowed in library, due to reentrancy constraint*/ nitems /= NumPropIconSizeElements; - if (! (hp = hints = (XIconSize *) - Xcalloc ((unsigned) nitems, (unsigned) sizeof(XIconSize)))) { - if (prop) Xfree ((char *) prop); + if (! (hp = hints = Xcalloc (nitems, sizeof(XIconSize)))) { + Xfree (prop); return 0; } @@ -222,7 +221,7 @@ Status XGetIconSizes ( } *count = nitems; *size_list = hints; - Xfree ((char *)prop); + Xfree (prop); return(1); } @@ -240,7 +239,7 @@ Status XGetCommand ( if (!XGetTextProperty (dpy, w, &tp, XA_WM_COMMAND)) return 0; if (tp.encoding != XA_STRING || tp.format != 8) { - if (tp.value) Xfree ((char *) tp.value); + Xfree (tp.value); return 0; } @@ -255,11 +254,11 @@ Status XGetCommand ( * create a string list and return if successful */ if (!XTextPropertyToStringList (&tp, &argv, &argc)) { - if (tp.value) Xfree ((char *) tp.value); + Xfree (tp.value); return (0); } - if (tp.value) Xfree ((char *) tp.value); + Xfree (tp.value); *argvp = argv; *argcp = argc; return 1; @@ -292,7 +291,7 @@ XGetTransientForHint( return (1); } *propWindow = None; - if (data) Xfree( (char *) data); + Xfree( (char *) data); return(0); } @@ -317,23 +316,23 @@ XGetClassHint( if ( (actual_type == XA_STRING) && (actual_format == 8) ) { len_name = strlen((char *) data); - if (! (classhint->res_name = Xmalloc((unsigned) (len_name+1)))) { - Xfree((char *) data); + if (! (classhint->res_name = Xmalloc(len_name + 1))) { + Xfree(data); return (0); } strcpy(classhint->res_name, (char *) data); if (len_name == nitems) len_name--; len_class = strlen((char *) (data+len_name+1)); - if (! (classhint->res_class = Xmalloc((unsigned) (len_class+1)))) { + if (! (classhint->res_class = Xmalloc(len_class + 1))) { Xfree(classhint->res_name); classhint->res_name = (char *) NULL; - Xfree((char *) data); + Xfree(data); return (0); } strcpy(classhint->res_class, (char *) (data+len_name+1)); Xfree( (char *) data); return(1); } - if (data) Xfree( (char *) data); + Xfree( (char *) data); return(0); } |