summaryrefslogtreecommitdiff
path: root/lwlib
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1996-02-19 07:38:02 +0000
committerKarl Heuer <kwzh@gnu.org>1996-02-19 07:38:02 +0000
commit27a24abf3f9d0fbf54bf7fea0b7932d255d4b44c (patch)
tree70a43218938f870fcc1a9b35adf30c1dca5e09b8 /lwlib
parent2c62c8f1a5368237f1813e5b1d8f343b774a3e67 (diff)
downloademacs-27a24abf3f9d0fbf54bf7fea0b7932d255d4b44c.tar.gz
(lw_internal_update_other_instances): Move static var
outside the function, and rename it to lwlib_updating.
Diffstat (limited to 'lwlib')
-rw-r--r--lwlib/lwlib.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index 9076418ee6a..a1e4ecc7304 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -1202,6 +1202,10 @@ lw_get_widget_value_for_widget (instance, w)
}
/* update other instances value when one thing changed */
+
+/* To forbid recursive calls */
+static Boolean lwlib_updating;
+
/* This function can be used as a an XtCallback for the widgets that get
modified to update other instances of the widgets. Closure should be the
widget_instance. */
@@ -1211,17 +1215,14 @@ lw_internal_update_other_instances (widget, closure, call_data)
XtPointer closure;
XtPointer call_data;
{
- /* To forbid recursive calls */
- static Boolean updating;
-
widget_instance* instance = (widget_instance*)closure;
char* name = XtName (widget);
widget_info* info;
widget_instance* cur;
widget_value* val;
- /* never recurse as this could cause infinite recursions. */
- if (updating)
+ /* Avoid possibly infinite recursion. */
+ if (lwlib_updating)
return;
/* protect against the widget being destroyed */
@@ -1233,7 +1234,7 @@ lw_internal_update_other_instances (widget, closure, call_data)
if (!info->instances->next)
return;
- updating = True;
+ lwlib_updating = True;
for (val = info->val; val && strcmp (val->name, name); val = val->next);
@@ -1242,7 +1243,7 @@ lw_internal_update_other_instances (widget, closure, call_data)
if (cur != instance)
set_one_value (cur, val, True);
- updating = False;
+ lwlib_updating = False;
}