diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2014-05-30 17:22:29 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2014-05-30 17:22:29 +0400 |
commit | a084532342d401455a818a1132d4aa1bc58a0d69 (patch) | |
tree | 7ae86c40d7c47ef7165d99efabb97135f527df11 /lwlib/lwlib-Xm.c | |
parent | e50e034033a3ec5eae90a7fbcb6d2da0b5111787 (diff) | |
download | emacs-a084532342d401455a818a1132d4aa1bc58a0d69.tar.gz |
Use common string allocation and freeing functions where applicable.
* lwlib.h (safe_strdup): Remove prototype.
* lwlib.c (safe_strdup, safe_free_str): Remove.
(copy_widget_value_tree, allocate_widget_info, free_widget_info):
(merge_widget_value): Prefer xstrdup, xfree and dupstring.
* lwlib-Xm.c (make_destroyed_instance, xm_update_one_value): Ditto.
Diffstat (limited to 'lwlib/lwlib-Xm.c')
-rw-r--r-- | lwlib/lwlib-Xm.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c index bbb9657d7a1..1026dd478af 100644 --- a/lwlib/lwlib-Xm.c +++ b/lwlib/lwlib-Xm.c @@ -170,8 +170,8 @@ make_destroyed_instance (char* name, { destroyed_instance* instance = (destroyed_instance*) xmalloc (sizeof (destroyed_instance)); - instance->name = safe_strdup (name); - instance->type = safe_strdup (type); + instance->name = xstrdup (name); + instance->type = xstrdup (type); instance->widget = widget; instance->parent = parent; instance->pop_up_p = pop_up_p; @@ -953,10 +953,7 @@ xm_update_one_value (widget_instance* instance, XtVaGetValues (toggle, XmNset, &set, NULL); if (set) - { - xfree (val->value); - val->value = safe_strdup (XtName (toggle)); - } + dupstring (&val->value, XtName (toggle)); } val->edited = True; } @@ -979,7 +976,7 @@ xm_update_one_value (widget_instance* instance, if (pos_list [j] == i) { cur->selected = True; - val->value = safe_strdup (cur->name); + val->value = xstrdup (cur->name); } } val->edited = 1; |