X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/0c382083b6b550c26fad8ac7f59b1ba09663e728..08bb5ee241848b0bd9297274f1e76aaaae3245de:/lwlib/lwlib-utils.c
diff --git a/lwlib/lwlib-utils.c b/lwlib/lwlib-utils.c
index ea765cf5bd..4487d2257a 100644
--- a/lwlib/lwlib-utils.c
+++ b/lwlib/lwlib-utils.c
@@ -1,7 +1,7 @@
/* Defines some widget utility functions.
+
Copyright (C) 1992 Lucid, Inc.
-Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010 Free Software Foundation, Inc.
+Copyright (C) 1994, 2001-2013 Free Software Foundation, Inc.
This file is part of the Lucid Widget Library.
@@ -16,23 +16,12 @@ 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
-
-/* Definitions of these in config.h can cause
- declaration conflicts later on between declarations for index
- and declarations for strchr. This file doesn't use
- index and rindex, so cancel them. */
-#undef index
-#undef rindex
#include
-#include "../src/lisp.h"
+#include
#include
#include
@@ -75,7 +64,7 @@ XtApplyToWidgets (Widget w, XtApplyToWidgetsProc proc, XtPointer arg)
the procedure might add/delete elements, which would lose badly.
*/
int nkids = cw->composite.num_children;
- Widget *kids = (Widget *) malloc (sizeof (Widget) * nkids);
+ Widget *kids = (Widget *) xmalloc (sizeof (Widget) * nkids);
int i;
memcpy ((char *) kids, (char *) cw->composite.children,
sizeof (Widget) * nkids);
@@ -87,7 +76,7 @@ XtApplyToWidgets (Widget w, XtApplyToWidgetsProc proc, XtPointer arg)
XtApplyToWidgets (kids [i], proc, arg);
proc (kids [i], arg);
}
- free (kids);
+ xfree (kids);
}
}
@@ -136,7 +125,7 @@ XtCompositeChildren (Widget widget, unsigned int *number)
return NULL;
}
n = cw->composite.num_children;
- result = (Widget*)XtMalloc (n * sizeof (Widget));
+ result = (Widget*)(void*)XtMalloc (n * sizeof (Widget));
*number = n;
for (i = 0; i < n; i++)
result [i] = cw->composite.children [i];
@@ -148,32 +137,3 @@ XtWidgetBeingDestroyedP (Widget widget)
{
return widget->core.being_destroyed;
}
-
-void
-XtSafelyDestroyWidget (Widget widget)
-{
-#if 0
-
- /* this requires IntrinsicI.h (actually, InitialI.h) */
-
- XtAppContext app = XtWidgetToApplicationContext(widget);
-
- if (app->dispatch_level == 0)
- {
- app->dispatch_level = 1;
- XtDestroyWidget (widget);
- /* generates an event so that the event loop will be called */
- XChangeProperty (XtDisplay (widget), XtWindow (widget),
- XA_STRING, XA_STRING, 32, PropModeAppend, NULL, 0);
- app->dispatch_level = 0;
- }
- else
- XtDestroyWidget (widget);
-
-#else
- abort ();
-#endif
-}
-
-/* arch-tag: f21f0a1f-2a4e-44e1-8715-7f234fe2d159
- (do not change this comment) */