X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/a3e44e793796153ff1534be9c74fcab50b45de30..66fda7948f7d0b94194d53edcfbf27bec596c019:/lwlib/lwlib-Xm.c
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c
index 60f282e69f..bbb9657d7a 100644
--- a/lwlib/lwlib-Xm.c
+++ b/lwlib/lwlib-Xm.c
@@ -1,8 +1,7 @@
/* The lwlib interface to Motif widgets.
- Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
- Copyright (C) 1992 Lucid, Inc.
+
+Copyright (C) 1994-1997, 1999-2014 Free Software Foundation, Inc.
+Copyright (C) 1992 Lucid, Inc.
This file is part of the Lucid Widget Library.
@@ -17,13 +16,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+along with GNU Emacs. If not, see . */
-#ifdef HAVE_CONFIG_H
#include
-#endif
#include
#include
@@ -35,7 +30,7 @@ Boston, MA 02110-1301, USA. */
#include
#include
-#include "../src/lisp.h"
+#include
#include "lwlib-Xm.h"
#include "lwlib-utils.h"
@@ -174,7 +169,7 @@ make_destroyed_instance (char* name,
Boolean pop_up_p)
{
destroyed_instance* instance =
- (destroyed_instance*)malloc (sizeof (destroyed_instance));
+ (destroyed_instance*) xmalloc (sizeof (destroyed_instance));
instance->name = safe_strdup (name);
instance->type = safe_strdup (type);
instance->widget = widget;
@@ -187,9 +182,9 @@ make_destroyed_instance (char* name,
static void
free_destroyed_instance (destroyed_instance* instance)
{
- free (instance->name);
- free (instance->type);
- free (instance);
+ xfree (instance->name);
+ xfree (instance->type);
+ xfree (instance);
}
/* motif utility functions */
@@ -493,7 +488,6 @@ make_menu_in_widget (widget_instance* instance,
int child_index;
widget_value* cur;
Widget button = 0;
- Widget title = 0;
Widget menu;
Arg al [256];
int ac;
@@ -512,7 +506,7 @@ make_menu_in_widget (widget_instance* instance,
/* Allocate the children array */
for (num_children = 0, cur = val; cur; num_children++, cur = cur->next)
;
- children = (Widget*)XtMalloc (num_children * sizeof (Widget));
+ children = (Widget*)(void*)XtMalloc (num_children * sizeof (Widget));
/* WIDGET should be a RowColumn. */
if (!XmIsRowColumn (widget))
@@ -557,7 +551,7 @@ make_menu_in_widget (widget_instance* instance,
{
ac = 0;
XtSetArg (al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
- title = button = XmCreateLabel (widget, cur->name, al, ac);
+ button = XmCreateLabel (widget, cur->name, al, ac);
}
else if (lw_separator_p (cur->name, &separator, 1))
{
@@ -800,7 +794,7 @@ xm_update_menu (widget_instance* instance,
/* Now replace from scratch all the buttons after the last
place that the top-level structure changed. */
- if (val->contents->change == STRUCTURAL_CHANGE)
+ if (val->contents && val->contents->change == STRUCTURAL_CHANGE)
{
destroy_all_children (widget, num_children_to_keep);
make_menu_in_widget (instance, widget, val->contents,
@@ -929,13 +923,13 @@ xm_update_one_value (widget_instance* instance,
}
else if (class == xmTextWidgetClass)
{
- free (val->value);
+ xfree (val->value);
val->value = XmTextGetString (widget);
val->edited = True;
}
else if (class == xmTextFieldWidgetClass)
{
- free (val->value);
+ xfree (val->value);
val->value = XmTextFieldGetString (widget);
val->edited = True;
}
@@ -960,7 +954,7 @@ xm_update_one_value (widget_instance* instance,
XtVaGetValues (toggle, XmNset, &set, NULL);
if (set)
{
- free (val->value);
+ xfree (val->value);
val->value = safe_strdup (XtName (toggle));
}
}
@@ -1021,10 +1015,10 @@ dialog_key_cb (Widget widget,
{
KeySym sym = 0;
Modifiers modif_ret;
-
+
XtTranslateKeycode (event->xkey.display, event->xkey.keycode, 0,
&modif_ret, &sym);
-
+
if (sym == osfXK_Cancel)
{
Widget w = *((Widget *) closure);
@@ -1056,7 +1050,7 @@ make_dialog (char* name,
Widget row;
Widget icon;
Widget icon_separator;
- Widget message;
+ Widget message_label;
Widget value = 0;
Widget separator;
Widget button = 0;
@@ -1270,7 +1264,7 @@ make_dialog (char* name,
XtSetArg(al[ac], XmNleftWidget, icon); ac++;
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
XtSetArg(al[ac], XmNrightOffset, 13); ac++;
- message = XmCreateLabel (form, "message", al, ac);
+ message_label = XmCreateLabel (form, "message", al, ac);
if (list)
XtManageChild (value);
@@ -1282,7 +1276,7 @@ make_dialog (char* name,
{
children [i] = value; i++;
}
- children [i] = message; i++;
+ children [i] = message_label; i++;
children [i] = icon; i++;
children [i] = icon_separator; i++;
XtManageChildren (children, i);
@@ -1957,4 +1951,3 @@ xm_manage_resizing (Widget w, Boolean flag)
{
XtVaSetValues (w, XtNallowShellResize, flag, NULL);
}
-