summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWalter Harms <wharms@bfs.de>2019-01-08 21:25:00 +0100
committerWalter Harms <wharms@bfs.de>2019-01-08 21:25:00 +0100
commit102ba41a668568d7e7e506b0ab9f064d1f2c4ec5 (patch)
tree31409fc97f30de33c267f55655e945a9a77f49a9 /src
parent8a25977b7ef3a5e96e57d0d56d597c9436a14871 (diff)
no need to check XFree arguments
Diffstat (limited to 'src')
-rw-r--r--src/TMstate.c5
-rw-r--r--src/VarCreate.c19
-rw-r--r--src/VarGet.c16
3 files changed, 13 insertions, 27 deletions
diff --git a/src/TMstate.c b/src/TMstate.c
index 3d51a1a..fda9a23 100644
--- a/src/TMstate.c
+++ b/src/TMstate.c
@@ -742,8 +742,7 @@ static void FreeContext(
context->numMatches = 0;
else if (*contextPtr)
{
- if ((*contextPtr)->matches)
- XtFree ((char *) ((*contextPtr)->matches));
+ XtFree ((char *) ((*contextPtr)->matches));
XtFree((char *)*contextPtr);
}
@@ -2062,7 +2061,7 @@ static Boolean ComposeTranslations(
dest->core.tm.proc_table =
(XtActionProc *) MakeBindData(newBindings, numNewBindings, bindData);
- if (bindData) XtFree((char *)bindData);
+ XtFree((char *)bindData);
dest->core.tm.translations = newTable;
diff --git a/src/VarCreate.c b/src/VarCreate.c
index 0fba379..4f5058c 100644
--- a/src/VarCreate.c
+++ b/src/VarCreate.c
@@ -79,9 +79,8 @@ _XtVaCreateWidget(
widget = _XtCreateWidget(name, widget_class, parent, (ArgList)NULL,
(Cardinal)0, typed_args, num_args);
- if (typed_args != NULL) {
- XtFree((XtPointer)typed_args);
- }
+
+ XtFree((XtPointer)typed_args);
return widget;
}
@@ -165,9 +164,8 @@ XtVaAppCreateShell(
_XtVaToTypedArgList(var, total_count, &typed_args, &num_args);
widget = _XtAppCreateShell((String)name, (String)class, widget_class,
display, (ArgList)NULL, (Cardinal)0, typed_args, num_args);
- if (typed_args != NULL) {
- XtFree((XtPointer)typed_args);
- }
+
+ XtFree((XtPointer)typed_args);
va_end(var);
UNLOCK_APP(app);
@@ -199,9 +197,8 @@ XtVaCreatePopupShell(
_XtVaToTypedArgList(var, total_count, &typed_args, &num_args);
widget = _XtCreatePopupShell((String)name, widget_class, parent,
(ArgList)NULL, (Cardinal)0, typed_args, num_args);
- if (typed_args != NULL) {
- XtFree((XtPointer)typed_args);
- }
+
+ XtFree((XtPointer)typed_args);
va_end(var);
UNLOCK_APP(app);
@@ -254,9 +251,7 @@ XtVaSetSubvalues(XtPointer base, XtResourceList resources, Cardinal num_resource
XtSetSubvalues(base, resources, num_resources, args, num_args);
- if (num_args != 0) {
- XtFree((XtPointer)args);
- }
+ XtFree((XtPointer)args);
va_end(var);
}
diff --git a/src/VarGet.c b/src/VarGet.c
index 7b4cea6..ccd4d10 100644
--- a/src/VarGet.c
+++ b/src/VarGet.c
@@ -86,9 +86,7 @@ XtVaGetSubresources(
_XtGetSubresources(widget, base, name, class, resources, num_resources,
NULL, 0, args, num_args);
- if (num_args != 0) {
- XtFree((XtPointer)args);
- }
+ XtFree((XtPointer)args);
va_end(var);
UNLOCK_APP(app);
@@ -116,9 +114,7 @@ XtVaGetApplicationResources(Widget widget, XtPointer base, XtResourceList resour
_XtGetApplicationResources(widget, base, resources, num_resources,
NULL, 0, args, num_args);
- if (num_args != 0) {
- XtFree((XtPointer)args);
- }
+ XtFree((XtPointer)args);
va_end(var);
UNLOCK_APP(app);
@@ -273,9 +269,7 @@ XtVaGetValues(Widget widget, ...)
}
va_end(var);
- if (resources != (XtResourceList)NULL) {
- XtFree((XtPointer)resources);
- }
+ XtFree((XtPointer)resources);
if (total_count != typed_count) {
XtGetValues(widget, args, count);
@@ -307,7 +301,5 @@ XtVaGetSubvalues(XtPointer base,XtResourceList resources, Cardinal num_resource
XtGetSubvalues(base, resources, num_resources, args, num_args);
- if (num_args != 0) {
- XtFree((XtPointer)args);
- }
+ XtFree((XtPointer)args);
}