HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* xterm.c (handle_one_xevent): Revert part of 2013-09-17 change
[bpt/emacs.git]
/
lwlib
/
lwlib.c
diff --git
a/lwlib/lwlib.c
b/lwlib/lwlib.c
index
290ce09
..
7d9920e
100644
(file)
--- a/
lwlib/lwlib.c
+++ b/
lwlib/lwlib.c
@@
-1,7
+1,7
@@
/* A general interface to the widgets of different toolkits.
Copyright (C) 1992, 1993 Lucid, Inc.
/* A general interface to the widgets of different toolkits.
Copyright (C) 1992, 1993 Lucid, Inc.
-Copyright (C) 1994-1996, 1999-201
1
Free Software Foundation, Inc.
+Copyright (C) 1994-1996, 1999-201
3
Free Software Foundation, Inc.
This file is part of the Lucid Widget Library.
This file is part of the Lucid Widget Library.
@@
-16,20
+16,16
@@
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
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 <http://www.gnu.org/licenses/>. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
#include <config.h>
-#endif
#include <setjmp.h>
#include <lisp.h>
#include <setjmp.h>
#include <lisp.h>
+#include <c-strcase.h>
#include <sys/types.h>
#include <stdio.h>
#include <sys/types.h>
#include <stdio.h>
-#include <ctype.h>
#include "lwlib-int.h"
#include "lwlib-utils.h"
#include <X11/StringDefs.h>
#include "lwlib-int.h"
#include "lwlib-utils.h"
#include <X11/StringDefs.h>
@@
-75,7
+71,6
@@
static widget_value *merge_widget_value (widget_value *,
widget_value *,
int, int *);
static void instantiate_widget_instance (widget_instance *);
widget_value *,
int, int *);
static void instantiate_widget_instance (widget_instance *);
-static int my_strcasecmp (const char *, const char *);
static void safe_free_str (char *);
static void free_widget_value_tree (widget_value *);
static widget_value *copy_widget_value_tree (widget_value *,
static void safe_free_str (char *);
static void free_widget_value_tree (widget_value *);
static widget_value *copy_widget_value_tree (widget_value *,
@@
-115,30
+110,10
@@
safe_strdup (const char *s)
return result;
}
return result;
}
-/* Like strcmp but ignore differences in case. */
-
-static int
-my_strcasecmp (const char *s1, const char *s2)
-{
- while (1)
- {
- int c1 = *s1++;
- int c2 = *s2++;
- if (isupper (c1))
- c1 = tolower (c1);
- if (isupper (c2))
- c2 = tolower (c2);
- if (c1 != c2)
- return (c1 > c2 ? 1 : -1);
- if (c1 == 0)
- return 0;
- }
-}
-
static void
safe_free_str (char *s)
{
static void
safe_free_str (char *s)
{
- free (s);
+
x
free (s);
}
static widget_value *widget_value_free_list = 0;
}
static widget_value *widget_value_free_list = 0;
@@
-176,7
+151,7
@@
free_widget_value (widget_value *wv)
{
/* When the number of already allocated cells is too big,
We free it. */
{
/* When the number of already allocated cells is too big,
We free it. */
- free (wv);
+
x
free (wv);
malloc_cpt--;
}
else
malloc_cpt--;
}
else
@@
-192,9
+167,9
@@
free_widget_value_tree (widget_value *wv)
if (!wv)
return;
if (!wv)
return;
- free (wv->name);
- free (wv->value);
- free (wv->key);
+
x
free (wv->name);
+
x
free (wv->value);
+
x
free (wv->key);
wv->name = wv->value = wv->key = (char *) 0xDEADBEEF;
wv->name = wv->value = wv->key = (char *) 0xDEADBEEF;
@@
-281,7
+256,7
@@
free_widget_info (widget_info *info)
safe_free_str (info->name);
free_widget_value_tree (info->val);
memset ((void*)info, 0xDEADBEEF, sizeof (widget_info));
safe_free_str (info->name);
free_widget_value_tree (info->val);
memset ((void*)info, 0xDEADBEEF, sizeof (widget_info));
- free (info);
+
x
free (info);
}
static void
}
static void
@@
-317,7
+292,7
@@
static void
free_widget_instance (widget_instance *instance)
{
memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance));
free_widget_instance (widget_instance *instance)
{
memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance));
- free (instance);
+
x
free (instance);
}
static widget_info *
}
static widget_info *
@@
-422,7
+397,7
@@
safe_strcmp (const char *s1, const char *s2)
(nc == STRUCTURAL_CHANGE ? "structural" : "???")))), \
nc, desc, a1, a2)
#else
(nc == STRUCTURAL_CHANGE ? "structural" : "???")))), \
nc, desc, a1, a2)
#else
-# define EXPLAIN(name, oc, nc, desc, a1, a2)
+# define EXPLAIN(name, oc, nc, desc, a1, a2)
((void) 0)
#endif
#endif
@@
-602,7
+577,7
@@
name_to_widget (widget_instance *instance, const char *name)
widget = XtNameToWidget (instance->widget, real_name);
widget = XtNameToWidget (instance->widget, real_name);
- free (real_name);
+
x
free (real_name);
}
return widget;
}
}
return widget;
}
@@
-731,7
+706,7
@@
find_in_table (const char *type, const widget_creation_entry *table)
{
const widget_creation_entry* cur;
for (cur = table; cur->type; cur++)
{
const widget_creation_entry* cur;
for (cur = table; cur->type; cur++)
- if (!
my
_strcasecmp (type, cur->type))
+ if (!
c
_strcasecmp (type, cur->type))
return cur->function;
return NULL;
}
return cur->function;
return NULL;
}
@@
-912,8
+887,9
@@
destroy_one_instance (widget_instance *instance)
xaw_destroy_instance (instance);
else
#endif
xaw_destroy_instance (instance);
else
#endif
- /* do not remove the empty statement */
- ;
+ {
+ /* Empty compound statement to terminate if-then-else chain. */
+ }
}
free_widget_instance (instance);
}
free_widget_instance (instance);
@@
-978,7
+954,7
@@
lw_destroy_all_pop_ups (void)
}
#ifdef USE_MOTIF
}
#ifdef USE_MOTIF
-extern Widget first_child (
/* Widget */);
/* garbage */
+extern Widget first_child (
Widget);
/* garbage */
#endif
Widget
#endif
Widget
@@
-1155,9
+1131,9
@@
lw_get_widget_value_for_widget (widget_instance *instance, Widget w)
/* To forbid recursive calls */
static Boolean lwlib_updating;
/* To forbid recursive calls */
static Boolean lwlib_updating;
-/* This function can be used as a
a
n XtCallback for the widgets that get
- modified to update other instances of the widgets. Closure should be the
- widget_instance. */
+/* This function can be used as an XtCallback for the widgets that get
+
modified to update other instances of the widgets. Closure should be the
+
widget_instance. */
void
lw_internal_update_other_instances (Widget widget,
XtPointer closure,
void
lw_internal_update_other_instances (Widget widget,
XtPointer closure,