diff options
| author | Karl Heuer | 1996-02-19 07:38:02 +0000 |
|---|---|---|
| committer | Karl Heuer | 1996-02-19 07:38:02 +0000 |
| commit | bd2c5b53f3b8880e98650fa6412a9b2159f805c2 (patch) | |
| tree | b155495056ec21480352bbcd063d6e60c4e55599 | |
| parent | 82142eb074ed5c545f4329a82dec711fd93a0691 (diff) | |
| download | emacs-bd2c5b53f3b8880e98650fa6412a9b2159f805c2.tar.gz emacs-bd2c5b53f3b8880e98650fa6412a9b2159f805c2.zip | |
(lw_internal_update_other_instances): Move static var
outside the function, and rename it to lwlib_updating.
| -rw-r--r-- | lwlib/lwlib.c | 15 |
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) | |||
| 1202 | } | 1202 | } |
| 1203 | 1203 | ||
| 1204 | /* update other instances value when one thing changed */ | 1204 | /* update other instances value when one thing changed */ |
| 1205 | |||
| 1206 | /* To forbid recursive calls */ | ||
| 1207 | static Boolean lwlib_updating; | ||
| 1208 | |||
| 1205 | /* This function can be used as a an XtCallback for the widgets that get | 1209 | /* This function can be used as a an XtCallback for the widgets that get |
| 1206 | modified to update other instances of the widgets. Closure should be the | 1210 | modified to update other instances of the widgets. Closure should be the |
| 1207 | widget_instance. */ | 1211 | widget_instance. */ |
| @@ -1211,17 +1215,14 @@ lw_internal_update_other_instances (widget, closure, call_data) | |||
| 1211 | XtPointer closure; | 1215 | XtPointer closure; |
| 1212 | XtPointer call_data; | 1216 | XtPointer call_data; |
| 1213 | { | 1217 | { |
| 1214 | /* To forbid recursive calls */ | ||
| 1215 | static Boolean updating; | ||
| 1216 | |||
| 1217 | widget_instance* instance = (widget_instance*)closure; | 1218 | widget_instance* instance = (widget_instance*)closure; |
| 1218 | char* name = XtName (widget); | 1219 | char* name = XtName (widget); |
| 1219 | widget_info* info; | 1220 | widget_info* info; |
| 1220 | widget_instance* cur; | 1221 | widget_instance* cur; |
| 1221 | widget_value* val; | 1222 | widget_value* val; |
| 1222 | 1223 | ||
| 1223 | /* never recurse as this could cause infinite recursions. */ | 1224 | /* Avoid possibly infinite recursion. */ |
| 1224 | if (updating) | 1225 | if (lwlib_updating) |
| 1225 | return; | 1226 | return; |
| 1226 | 1227 | ||
| 1227 | /* protect against the widget being destroyed */ | 1228 | /* protect against the widget being destroyed */ |
| @@ -1233,7 +1234,7 @@ lw_internal_update_other_instances (widget, closure, call_data) | |||
| 1233 | if (!info->instances->next) | 1234 | if (!info->instances->next) |
| 1234 | return; | 1235 | return; |
| 1235 | 1236 | ||
| 1236 | updating = True; | 1237 | lwlib_updating = True; |
| 1237 | 1238 | ||
| 1238 | for (val = info->val; val && strcmp (val->name, name); val = val->next); | 1239 | for (val = info->val; val && strcmp (val->name, name); val = val->next); |
| 1239 | 1240 | ||
| @@ -1242,7 +1243,7 @@ lw_internal_update_other_instances (widget, closure, call_data) | |||
| 1242 | if (cur != instance) | 1243 | if (cur != instance) |
| 1243 | set_one_value (cur, val, True); | 1244 | set_one_value (cur, val, True); |
| 1244 | 1245 | ||
| 1245 | updating = False; | 1246 | lwlib_updating = False; |
| 1246 | } | 1247 | } |
| 1247 | 1248 | ||
| 1248 | 1249 | ||