Mercurial > emacs
comparison lwlib/lwlib.c @ 109171:d8a16c4fa9b1
Remove alternative K&R declarations.
* lwlib/lwlib.c (allocate_widget_instance, get_widget_info)
(get_widget_instance, find_instance, set_one_value)
(update_one_widget_instance, update_all_widget_values)
(lw_modify_all_widgets, lw_get_widget, lw_make_widget)
(lw_create_widget, lw_pop_all_widgets, lw_show_busy)
(lw_refigure_widget, lw_allow_resizing): Remove alternative K&R
declarations.
* lwlib/lwlib-Xlw.c (xlw_update_one_widget):
(xlw_pop_instance): Likewise.
* lwlib/lwlib-Xaw.c (xaw_update_one_widget, xaw_pop_instance):
Likewise.
* lwlib/lwlib-Xm.c (P_): Remove.
* src/xdisp.c (store_mode_line_noprop_char): Remove K&R alternative declaration.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Wed, 07 Jul 2010 22:42:59 -0700 |
parents | 750db9f3e6d8 |
children | 33021b778d4d |
comparison
equal
deleted
inserted
replaced
109170:76e072dbe342 | 109171:d8a16c4fa9b1 |
---|---|
296 /* be very conservative */ | 296 /* be very conservative */ |
297 if (instance->widget == widget) | 297 if (instance->widget == widget) |
298 instance->widget = NULL; | 298 instance->widget = NULL; |
299 } | 299 } |
300 | 300 |
301 /* The messy #ifdef PROTOTYPES here and elsewhere are prompted by a | |
302 flood of warnings about argument promotion from proprietary ISO C | |
303 compilers. (etags still only makes one entry for each function.) */ | |
304 static widget_instance * | 301 static widget_instance * |
305 #ifdef PROTOTYPES | |
306 allocate_widget_instance (widget_info* info, Widget parent, Boolean pop_up_p) | 302 allocate_widget_instance (widget_info* info, Widget parent, Boolean pop_up_p) |
307 #else | |
308 allocate_widget_instance (info, parent, pop_up_p) | |
309 widget_info* info; | |
310 Widget parent; | |
311 Boolean pop_up_p; | |
312 #endif | |
313 { | 303 { |
314 widget_instance* instance = | 304 widget_instance* instance = |
315 (widget_instance*)malloc (sizeof (widget_instance)); | 305 (widget_instance*)malloc (sizeof (widget_instance)); |
316 memset (instance, 0, sizeof *instance); | 306 memset (instance, 0, sizeof *instance); |
317 instance->parent = parent; | 307 instance->parent = parent; |
333 memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance)); | 323 memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance)); |
334 free (instance); | 324 free (instance); |
335 } | 325 } |
336 | 326 |
337 static widget_info * | 327 static widget_info * |
338 #ifdef PROTOTYPES | |
339 get_widget_info (LWLIB_ID id, Boolean remove_p) | 328 get_widget_info (LWLIB_ID id, Boolean remove_p) |
340 #else | |
341 get_widget_info (id, remove_p) | |
342 LWLIB_ID id; | |
343 Boolean remove_p; | |
344 #endif | |
345 { | 329 { |
346 widget_info* info; | 330 widget_info* info; |
347 widget_info* prev; | 331 widget_info* prev; |
348 for (prev = NULL, info = all_widget_info; | 332 for (prev = NULL, info = all_widget_info; |
349 info; | 333 info; |
369 { | 353 { |
370 return get_widget_info (id, 0); | 354 return get_widget_info (id, 0); |
371 } | 355 } |
372 | 356 |
373 static widget_instance * | 357 static widget_instance * |
374 #ifdef PROTOTYPES | |
375 get_widget_instance (Widget widget, Boolean remove_p) | 358 get_widget_instance (Widget widget, Boolean remove_p) |
376 #else | |
377 get_widget_instance (widget, remove_p) | |
378 Widget widget; | |
379 Boolean remove_p; | |
380 #endif | |
381 { | 359 { |
382 widget_info* info; | 360 widget_info* info; |
383 widget_instance* instance; | 361 widget_instance* instance; |
384 widget_instance* prev; | 362 widget_instance* prev; |
385 for (info = all_widget_info; info; info = info->next) | 363 for (info = all_widget_info; info; info = info->next) |
408 { | 386 { |
409 return get_widget_instance (widget, False); | 387 return get_widget_instance (widget, False); |
410 } | 388 } |
411 | 389 |
412 static widget_instance* | 390 static widget_instance* |
413 #ifdef PROTOTYPES | |
414 find_instance (LWLIB_ID id, Widget parent, Boolean pop_up_p) | 391 find_instance (LWLIB_ID id, Widget parent, Boolean pop_up_p) |
415 #else | |
416 find_instance (id, parent, pop_up_p) | |
417 LWLIB_ID id; | |
418 Widget parent; | |
419 Boolean pop_up_p; | |
420 #endif | |
421 { | 392 { |
422 widget_info* info = get_widget_info (id, False); | 393 widget_info* info = get_widget_info (id, False); |
423 widget_instance* instance; | 394 widget_instance* instance; |
424 | 395 |
425 if (info) | 396 if (info) |
636 } | 607 } |
637 return widget; | 608 return widget; |
638 } | 609 } |
639 | 610 |
640 static void | 611 static void |
641 #ifdef PROTOTYPES | |
642 set_one_value (widget_instance* instance, widget_value* val, Boolean deep_p) | 612 set_one_value (widget_instance* instance, widget_value* val, Boolean deep_p) |
643 #else | |
644 set_one_value (instance, val, deep_p) | |
645 widget_instance* instance; | |
646 widget_value* val; | |
647 Boolean deep_p; | |
648 #endif | |
649 { | 613 { |
650 Widget widget = name_to_widget (instance, val->name); | 614 Widget widget = name_to_widget (instance, val->name); |
651 | 615 |
652 if (widget) | 616 if (widget) |
653 { | 617 { |
665 #endif | 629 #endif |
666 } | 630 } |
667 } | 631 } |
668 | 632 |
669 static void | 633 static void |
670 #ifdef PROTOTYPES | |
671 update_one_widget_instance (widget_instance* instance, Boolean deep_p) | 634 update_one_widget_instance (widget_instance* instance, Boolean deep_p) |
672 #else | |
673 update_one_widget_instance (instance, deep_p) | |
674 widget_instance* instance; | |
675 Boolean deep_p; | |
676 #endif | |
677 { | 635 { |
678 widget_value *val; | 636 widget_value *val; |
679 | 637 |
680 if (!instance->widget) | 638 if (!instance->widget) |
681 /* the widget was destroyed */ | 639 /* the widget was destroyed */ |
685 if (val->change != NO_CHANGE) | 643 if (val->change != NO_CHANGE) |
686 set_one_value (instance, val, deep_p); | 644 set_one_value (instance, val, deep_p); |
687 } | 645 } |
688 | 646 |
689 static void | 647 static void |
690 #ifdef PROTOTYPES | |
691 update_all_widget_values (widget_info* info, Boolean deep_p) | 648 update_all_widget_values (widget_info* info, Boolean deep_p) |
692 #else | |
693 update_all_widget_values (info, deep_p) | |
694 widget_info* info; | |
695 Boolean deep_p; | |
696 #endif | |
697 { | 649 { |
698 widget_instance* instance; | 650 widget_instance* instance; |
699 widget_value* val; | 651 widget_value* val; |
700 | 652 |
701 for (instance = info->instances; instance; instance = instance->next) | 653 for (instance = info->instances; instance; instance = instance->next) |
704 for (val = info->val; val; val = val->next) | 656 for (val = info->val; val; val = val->next) |
705 val->change = NO_CHANGE; | 657 val->change = NO_CHANGE; |
706 } | 658 } |
707 | 659 |
708 int | 660 int |
709 #ifdef PROTOTYPES | |
710 lw_modify_all_widgets (LWLIB_ID id, widget_value* val, Boolean deep_p) | 661 lw_modify_all_widgets (LWLIB_ID id, widget_value* val, Boolean deep_p) |
711 #else | |
712 lw_modify_all_widgets (id, val, deep_p) | |
713 LWLIB_ID id; | |
714 widget_value* val; | |
715 Boolean deep_p; | |
716 #endif | |
717 { | 662 { |
718 widget_info* info = get_widget_info (id, False); | 663 widget_info* info = get_widget_info (id, False); |
719 widget_value* new_val; | 664 widget_value* new_val; |
720 widget_value* next_new_val; | 665 widget_value* next_new_val; |
721 widget_value* cur; | 666 widget_value* cur; |
892 allocate_widget_info (type, name, id, val, pre_activate_cb, selection_cb, | 837 allocate_widget_info (type, name, id, val, pre_activate_cb, selection_cb, |
893 post_activate_cb, highlight_cb); | 838 post_activate_cb, highlight_cb); |
894 } | 839 } |
895 | 840 |
896 Widget | 841 Widget |
897 #ifdef PROTOTYPES | |
898 lw_get_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p) | 842 lw_get_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p) |
899 #else | |
900 lw_get_widget (id, parent, pop_up_p) | |
901 LWLIB_ID id; | |
902 Widget parent; | |
903 Boolean pop_up_p; | |
904 #endif | |
905 { | 843 { |
906 widget_instance* instance; | 844 widget_instance* instance; |
907 | 845 |
908 instance = find_instance (id, parent, pop_up_p); | 846 instance = find_instance (id, parent, pop_up_p); |
909 return instance ? instance->widget : NULL; | 847 return instance ? instance->widget : NULL; |
910 } | 848 } |
911 | 849 |
912 Widget | 850 Widget |
913 #ifdef PROTOTYPES | |
914 lw_make_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p) | 851 lw_make_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p) |
915 #else | |
916 lw_make_widget (id, parent, pop_up_p) | |
917 LWLIB_ID id; | |
918 Widget parent; | |
919 Boolean pop_up_p; | |
920 #endif | |
921 { | 852 { |
922 widget_instance* instance; | 853 widget_instance* instance; |
923 widget_info* info; | 854 widget_info* info; |
924 | 855 |
925 instance = find_instance (id, parent, pop_up_p); | 856 instance = find_instance (id, parent, pop_up_p); |
935 abort (); | 866 abort (); |
936 return instance->widget; | 867 return instance->widget; |
937 } | 868 } |
938 | 869 |
939 Widget | 870 Widget |
940 #ifdef PROTOTYPES | |
941 lw_create_widget (char* type, char* name, LWLIB_ID id, widget_value* val, | 871 lw_create_widget (char* type, char* name, LWLIB_ID id, widget_value* val, |
942 Widget parent, Boolean pop_up_p, | 872 Widget parent, Boolean pop_up_p, |
943 lw_callback pre_activate_cb, lw_callback selection_cb, | 873 lw_callback pre_activate_cb, lw_callback selection_cb, |
944 lw_callback post_activate_cb, lw_callback highlight_cb) | 874 lw_callback post_activate_cb, lw_callback highlight_cb) |
945 #else | |
946 lw_create_widget (type, name, id, val, parent, pop_up_p, pre_activate_cb, | |
947 selection_cb, post_activate_cb, highlight_cb) | |
948 char* type; | |
949 char* name; | |
950 LWLIB_ID id; | |
951 widget_value* val; | |
952 Widget parent; | |
953 Boolean pop_up_p; | |
954 lw_callback pre_activate_cb; | |
955 lw_callback selection_cb; | |
956 lw_callback post_activate_cb; | |
957 lw_callback highlight_cb; | |
958 #endif | |
959 { | 875 { |
960 lw_register_widget (type, name, id, val, pre_activate_cb, selection_cb, | 876 lw_register_widget (type, name, id, val, pre_activate_cb, selection_cb, |
961 post_activate_cb, highlight_cb); | 877 post_activate_cb, highlight_cb); |
962 return lw_make_widget (id, parent, pop_up_p); | 878 return lw_make_widget (id, parent, pop_up_p); |
963 } | 879 } |
1100 } | 1016 } |
1101 return result; | 1017 return result; |
1102 } | 1018 } |
1103 | 1019 |
1104 static void | 1020 static void |
1105 #ifdef PROTOTYPES | |
1106 lw_pop_all_widgets (LWLIB_ID id, Boolean up) | 1021 lw_pop_all_widgets (LWLIB_ID id, Boolean up) |
1107 #else | |
1108 lw_pop_all_widgets (id, up) | |
1109 LWLIB_ID id; | |
1110 Boolean up; | |
1111 #endif | |
1112 { | 1022 { |
1113 widget_info* info = get_widget_info (id, False); | 1023 widget_info* info = get_widget_info (id, False); |
1114 widget_instance* instance; | 1024 widget_instance* instance; |
1115 | 1025 |
1116 if (info) | 1026 if (info) |
1307 #endif | 1217 #endif |
1308 } | 1218 } |
1309 | 1219 |
1310 /* Show busy */ | 1220 /* Show busy */ |
1311 static void | 1221 static void |
1312 #ifdef PROTOTYPES | |
1313 show_one_widget_busy (Widget w, Boolean flag) | 1222 show_one_widget_busy (Widget w, Boolean flag) |
1314 #else | |
1315 show_one_widget_busy (w, flag) | |
1316 Widget w; | |
1317 Boolean flag; | |
1318 #endif | |
1319 { | 1223 { |
1320 Pixel foreground = 0; | 1224 Pixel foreground = 0; |
1321 Pixel background = 1; | 1225 Pixel background = 1; |
1322 Widget widget_to_invert = XtNameToWidget (w, "*sheet"); | 1226 Widget widget_to_invert = XtNameToWidget (w, "*sheet"); |
1323 if (!widget_to_invert) | 1227 if (!widget_to_invert) |
1332 XtNbackground, foreground, | 1236 XtNbackground, foreground, |
1333 NULL); | 1237 NULL); |
1334 } | 1238 } |
1335 | 1239 |
1336 void | 1240 void |
1337 #ifdef PROTOTYPES | |
1338 lw_show_busy (Widget w, Boolean busy) | 1241 lw_show_busy (Widget w, Boolean busy) |
1339 #else | |
1340 lw_show_busy (w, busy) | |
1341 Widget w; | |
1342 Boolean busy; | |
1343 #endif | |
1344 { | 1242 { |
1345 widget_instance* instance = get_widget_instance (w, False); | 1243 widget_instance* instance = get_widget_instance (w, False); |
1346 widget_info* info; | 1244 widget_info* info; |
1347 widget_instance* next; | 1245 widget_instance* next; |
1348 | 1246 |
1360 } | 1258 } |
1361 | 1259 |
1362 /* This hack exists because Lucid/Athena need to execute the strange | 1260 /* This hack exists because Lucid/Athena need to execute the strange |
1363 function below to support geometry management. */ | 1261 function below to support geometry management. */ |
1364 void | 1262 void |
1365 #ifdef PROTOTYPES | |
1366 lw_refigure_widget (Widget w, Boolean doit) | 1263 lw_refigure_widget (Widget w, Boolean doit) |
1367 #else | |
1368 lw_refigure_widget (w, doit) | |
1369 Widget w; | |
1370 Boolean doit; | |
1371 #endif | |
1372 { | 1264 { |
1373 #if defined (USE_XAW) | 1265 #if defined (USE_XAW) |
1374 XawPanedSetRefigureMode (w, doit); | 1266 XawPanedSetRefigureMode (w, doit); |
1375 #endif | 1267 #endif |
1376 #if defined (USE_MOTIF) | 1268 #if defined (USE_MOTIF) |
1408 } | 1300 } |
1409 | 1301 |
1410 /* Manage resizing for Motif. This disables resizing when the menubar | 1302 /* Manage resizing for Motif. This disables resizing when the menubar |
1411 is about to be modified. */ | 1303 is about to be modified. */ |
1412 void | 1304 void |
1413 #ifdef PROTOTYPES | |
1414 lw_allow_resizing (Widget w, Boolean flag) | 1305 lw_allow_resizing (Widget w, Boolean flag) |
1415 #else | |
1416 lw_allow_resizing (w, flag) | |
1417 Widget w; | |
1418 Boolean flag; | |
1419 #endif | |
1420 { | 1306 { |
1421 #if defined (USE_MOTIF) | 1307 #if defined (USE_MOTIF) |
1422 xm_manage_resizing (w, flag); | 1308 xm_manage_resizing (w, flag); |
1423 #endif | 1309 #endif |
1424 } | 1310 } |