diff options
| author | Eli Zaretskii | 2015-01-29 19:16:56 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-01-29 19:16:56 +0200 |
| commit | 0761ec1669d6125d555ec39d2b938ce3562874af (patch) | |
| tree | 83f62ccea45c0ade728fc55a9146f2020c129e0e /src | |
| parent | 0c7b0967d262bd361de721d0d7a4da192bde1319 (diff) | |
| download | emacs-0761ec1669d6125d555ec39d2b938ce3562874af.tar.gz emacs-0761ec1669d6125d555ec39d2b938ce3562874af.zip | |
Use bool for boolean in w32menu.c, w32font.c, w32uniscribe.c.
src/w32uniscribe.c (uniscribe_list, uniscribe_match): Use bool where
appropriate.
src/w32font.c (struct font_callback_data, w32font_list_internal)
(w32font_driver, w32font_match_internal): Use bool where appropriate.
src/w32menu.c (x_activate_menubar, set_frame_menubar)
(w32_dialog_show, initialize_frame_menubar, w32_menu_show)
(is_simple_dialog): Use bool where appropriate.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32font.c | 10 | ||||
| -rw-r--r-- | src/w32font.h | 4 | ||||
| -rw-r--r-- | src/w32menu.c | 47 | ||||
| -rw-r--r-- | src/w32uniscribe.c | 4 |
4 files changed, 34 insertions, 31 deletions
diff --git a/src/w32font.c b/src/w32font.c index ab772679908..360ad3f1c48 100644 --- a/src/w32font.c +++ b/src/w32font.c | |||
| @@ -95,7 +95,7 @@ struct font_callback_data | |||
| 95 | /* The list to add matches to. */ | 95 | /* The list to add matches to. */ |
| 96 | Lisp_Object list; | 96 | Lisp_Object list; |
| 97 | /* Whether to match only opentype fonts. */ | 97 | /* Whether to match only opentype fonts. */ |
| 98 | int opentype_only; | 98 | bool opentype_only; |
| 99 | }; | 99 | }; |
| 100 | 100 | ||
| 101 | /* Handles the problem that EnumFontFamiliesEx will not return all | 101 | /* Handles the problem that EnumFontFamiliesEx will not return all |
| @@ -746,7 +746,8 @@ w32font_otf_drive (struct font *font, Lisp_Object features, | |||
| 746 | Additional parameter opentype_only restricts the returned fonts to | 746 | Additional parameter opentype_only restricts the returned fonts to |
| 747 | opentype fonts, which can be used with the Uniscribe backend. */ | 747 | opentype fonts, which can be used with the Uniscribe backend. */ |
| 748 | Lisp_Object | 748 | Lisp_Object |
| 749 | w32font_list_internal (struct frame *f, Lisp_Object font_spec, int opentype_only) | 749 | w32font_list_internal (struct frame *f, Lisp_Object font_spec, |
| 750 | bool opentype_only) | ||
| 750 | { | 751 | { |
| 751 | struct font_callback_data match_data; | 752 | struct font_callback_data match_data; |
| 752 | HDC dc; | 753 | HDC dc; |
| @@ -798,7 +799,8 @@ w32font_list_internal (struct frame *f, Lisp_Object font_spec, int opentype_only | |||
| 798 | Additional parameter opentype_only restricts the returned fonts to | 799 | Additional parameter opentype_only restricts the returned fonts to |
| 799 | opentype fonts, which can be used with the Uniscribe backend. */ | 800 | opentype fonts, which can be used with the Uniscribe backend. */ |
| 800 | Lisp_Object | 801 | Lisp_Object |
| 801 | w32font_match_internal (struct frame *f, Lisp_Object font_spec, int opentype_only) | 802 | w32font_match_internal (struct frame *f, Lisp_Object font_spec, |
| 803 | bool opentype_only) | ||
| 802 | { | 804 | { |
| 803 | struct font_callback_data match_data; | 805 | struct font_callback_data match_data; |
| 804 | HDC dc; | 806 | HDC dc; |
| @@ -2459,7 +2461,7 @@ w32font_filter_properties (Lisp_Object font, Lisp_Object alist) | |||
| 2459 | struct font_driver w32font_driver = | 2461 | struct font_driver w32font_driver = |
| 2460 | { | 2462 | { |
| 2461 | LISP_INITIALLY_ZERO, /* Qgdi */ | 2463 | LISP_INITIALLY_ZERO, /* Qgdi */ |
| 2462 | 0, /* case insensitive */ | 2464 | false, /* case insensitive */ |
| 2463 | w32font_get_cache, | 2465 | w32font_get_cache, |
| 2464 | w32font_list, | 2466 | w32font_list, |
| 2465 | w32font_match, | 2467 | w32font_match, |
diff --git a/src/w32font.h b/src/w32font.h index 82c5e09b9fc..0ad01254be9 100644 --- a/src/w32font.h +++ b/src/w32font.h | |||
| @@ -66,10 +66,10 @@ struct w32font_info | |||
| 66 | Lisp_Object w32font_get_cache (struct frame *fe); | 66 | Lisp_Object w32font_get_cache (struct frame *fe); |
| 67 | Lisp_Object w32font_list_internal (struct frame *f, | 67 | Lisp_Object w32font_list_internal (struct frame *f, |
| 68 | Lisp_Object font_spec, | 68 | Lisp_Object font_spec, |
| 69 | int opentype_only); | 69 | bool opentype_only); |
| 70 | Lisp_Object w32font_match_internal (struct frame *f, | 70 | Lisp_Object w32font_match_internal (struct frame *f, |
| 71 | Lisp_Object font_spec, | 71 | Lisp_Object font_spec, |
| 72 | int opentype_only); | 72 | bool opentype_only); |
| 73 | int w32font_open_internal (struct frame *f, Lisp_Object font_entity, | 73 | int w32font_open_internal (struct frame *f, Lisp_Object font_entity, |
| 74 | int pixel_size, Lisp_Object font_object); | 74 | int pixel_size, Lisp_Object font_object); |
| 75 | void w32font_close (struct font *font); | 75 | void w32font_close (struct font *font); |
diff --git a/src/w32menu.c b/src/w32menu.c index 2a1dafbd6d7..40b8f5f82a0 100644 --- a/src/w32menu.c +++ b/src/w32menu.c | |||
| @@ -103,7 +103,7 @@ void set_frame_menubar (struct frame *, bool, bool); | |||
| 103 | #ifdef HAVE_DIALOGS | 103 | #ifdef HAVE_DIALOGS |
| 104 | static Lisp_Object w32_dialog_show (struct frame *, Lisp_Object, Lisp_Object, char **); | 104 | static Lisp_Object w32_dialog_show (struct frame *, Lisp_Object, Lisp_Object, char **); |
| 105 | #else | 105 | #else |
| 106 | static int is_simple_dialog (Lisp_Object); | 106 | static bool is_simple_dialog (Lisp_Object); |
| 107 | static Lisp_Object simple_dialog_show (struct frame *, Lisp_Object, Lisp_Object); | 107 | static Lisp_Object simple_dialog_show (struct frame *, Lisp_Object, Lisp_Object); |
| 108 | #endif | 108 | #endif |
| 109 | 109 | ||
| @@ -166,7 +166,7 @@ w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents) | |||
| 166 | void | 166 | void |
| 167 | x_activate_menubar (struct frame *f) | 167 | x_activate_menubar (struct frame *f) |
| 168 | { | 168 | { |
| 169 | set_frame_menubar (f, 0, 1); | 169 | set_frame_menubar (f, false, true); |
| 170 | 170 | ||
| 171 | /* Lock out further menubar changes while active. */ | 171 | /* Lock out further menubar changes while active. */ |
| 172 | f->output_data.w32->menubar_active = 1; | 172 | f->output_data.w32->menubar_active = 1; |
| @@ -289,7 +289,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p) | |||
| 289 | XSETFRAME (Vmenu_updating_frame, f); | 289 | XSETFRAME (Vmenu_updating_frame, f); |
| 290 | 290 | ||
| 291 | if (! menubar_widget) | 291 | if (! menubar_widget) |
| 292 | deep_p = 1; | 292 | deep_p = true; |
| 293 | 293 | ||
| 294 | if (deep_p) | 294 | if (deep_p) |
| 295 | { | 295 | { |
| @@ -388,7 +388,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p) | |||
| 388 | else | 388 | else |
| 389 | first_wv->contents = wv; | 389 | first_wv->contents = wv; |
| 390 | /* Don't set wv->name here; GC during the loop might relocate it. */ | 390 | /* Don't set wv->name here; GC during the loop might relocate it. */ |
| 391 | wv->enabled = 1; | 391 | wv->enabled = true; |
| 392 | wv->button_type = BUTTON_TYPE_NONE; | 392 | wv->button_type = BUTTON_TYPE_NONE; |
| 393 | prev_wv = wv; | 393 | prev_wv = wv; |
| 394 | } | 394 | } |
| @@ -501,7 +501,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p) | |||
| 501 | /* Force the window size to be recomputed so that the frame's text | 501 | /* Force the window size to be recomputed so that the frame's text |
| 502 | area remains the same, if menubar has just been created. */ | 502 | area remains the same, if menubar has just been created. */ |
| 503 | if (old_widget == NULL) | 503 | if (old_widget == NULL) |
| 504 | adjust_frame_size (f, -1, -1, 2, 0, Qmenu_bar_lines); | 504 | adjust_frame_size (f, -1, -1, 2, false, Qmenu_bar_lines); |
| 505 | } | 505 | } |
| 506 | 506 | ||
| 507 | unblock_input (); | 507 | unblock_input (); |
| @@ -518,7 +518,7 @@ initialize_frame_menubar (struct frame *f) | |||
| 518 | /* This function is called before the first chance to redisplay | 518 | /* This function is called before the first chance to redisplay |
| 519 | the frame. It has to be, so the frame will have the right size. */ | 519 | the frame. It has to be, so the frame will have the right size. */ |
| 520 | fset_menu_bar_items (f, menu_bar_items (FRAME_MENU_BAR_ITEMS (f))); | 520 | fset_menu_bar_items (f, menu_bar_items (FRAME_MENU_BAR_ITEMS (f))); |
| 521 | set_frame_menubar (f, 1, 1); | 521 | set_frame_menubar (f, true, true); |
| 522 | } | 522 | } |
| 523 | 523 | ||
| 524 | /* Get rid of the menu bar of frame F, and free its storage. | 524 | /* Get rid of the menu bar of frame F, and free its storage. |
| @@ -570,7 +570,7 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags, | |||
| 570 | Lisp_Object *subprefix_stack | 570 | Lisp_Object *subprefix_stack |
| 571 | = (Lisp_Object *) alloca (menu_items_used * word_size); | 571 | = (Lisp_Object *) alloca (menu_items_used * word_size); |
| 572 | int submenu_depth = 0; | 572 | int submenu_depth = 0; |
| 573 | int first_pane; | 573 | bool first_pane; |
| 574 | 574 | ||
| 575 | *error = NULL; | 575 | *error = NULL; |
| 576 | 576 | ||
| @@ -590,7 +590,7 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags, | |||
| 590 | wv = make_widget_value ("menu", NULL, true, Qnil); | 590 | wv = make_widget_value ("menu", NULL, true, Qnil); |
| 591 | wv->button_type = BUTTON_TYPE_NONE; | 591 | wv->button_type = BUTTON_TYPE_NONE; |
| 592 | first_wv = wv; | 592 | first_wv = wv; |
| 593 | first_pane = 1; | 593 | first_pane = true; |
| 594 | 594 | ||
| 595 | /* Loop over all panes and items, filling in the tree. */ | 595 | /* Loop over all panes and items, filling in the tree. */ |
| 596 | i = 0; | 596 | i = 0; |
| @@ -601,14 +601,14 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags, | |||
| 601 | submenu_stack[submenu_depth++] = save_wv; | 601 | submenu_stack[submenu_depth++] = save_wv; |
| 602 | save_wv = prev_wv; | 602 | save_wv = prev_wv; |
| 603 | prev_wv = 0; | 603 | prev_wv = 0; |
| 604 | first_pane = 1; | 604 | first_pane = false; |
| 605 | i++; | 605 | i++; |
| 606 | } | 606 | } |
| 607 | else if (EQ (AREF (menu_items, i), Qlambda)) | 607 | else if (EQ (AREF (menu_items, i), Qlambda)) |
| 608 | { | 608 | { |
| 609 | prev_wv = save_wv; | 609 | prev_wv = save_wv; |
| 610 | save_wv = submenu_stack[--submenu_depth]; | 610 | save_wv = submenu_stack[--submenu_depth]; |
| 611 | first_pane = 0; | 611 | first_pane = false; |
| 612 | i++; | 612 | i++; |
| 613 | } | 613 | } |
| 614 | else if (EQ (AREF (menu_items, i), Qt) | 614 | else if (EQ (AREF (menu_items, i), Qt) |
| @@ -664,7 +664,7 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags, | |||
| 664 | save_wv = wv; | 664 | save_wv = wv; |
| 665 | prev_wv = 0; | 665 | prev_wv = 0; |
| 666 | } | 666 | } |
| 667 | first_pane = 0; | 667 | first_pane = false; |
| 668 | i += MENU_ITEMS_PANE_LENGTH; | 668 | i += MENU_ITEMS_PANE_LENGTH; |
| 669 | } | 669 | } |
| 670 | else | 670 | else |
| @@ -883,8 +883,9 @@ w32_dialog_show (struct frame *f, Lisp_Object title, | |||
| 883 | 883 | ||
| 884 | /* Number of elements seen so far, before boundary. */ | 884 | /* Number of elements seen so far, before boundary. */ |
| 885 | int left_count = 0; | 885 | int left_count = 0; |
| 886 | /* 1 means we've seen the boundary between left-hand elts and right-hand. */ | 886 | /* true means we've seen the boundary between left-hand elts and |
| 887 | int boundary_seen = 0; | 887 | right-hand. */ |
| 888 | bool boundary_seen = false; | ||
| 888 | 889 | ||
| 889 | *error = NULL; | 890 | *error = NULL; |
| 890 | 891 | ||
| @@ -928,7 +929,7 @@ w32_dialog_show (struct frame *f, Lisp_Object title, | |||
| 928 | { | 929 | { |
| 929 | /* This is the boundary between left-side elts | 930 | /* This is the boundary between left-side elts |
| 930 | and right-side elts. Stop incrementing right_count. */ | 931 | and right-side elts. Stop incrementing right_count. */ |
| 931 | boundary_seen = 1; | 932 | boundary_seen = true; |
| 932 | i++; | 933 | i++; |
| 933 | continue; | 934 | continue; |
| 934 | } | 935 | } |
| @@ -986,7 +987,7 @@ w32_dialog_show (struct frame *f, Lisp_Object title, | |||
| 986 | /* Actually create the dialog. */ | 987 | /* Actually create the dialog. */ |
| 987 | dialog_id = widget_id_tick++; | 988 | dialog_id = widget_id_tick++; |
| 988 | menu = lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv, | 989 | menu = lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv, |
| 989 | f->output_data.w32->widget, 1, 0, | 990 | f->output_data.w32->widget, true, 0, |
| 990 | dialog_selection_callback, 0); | 991 | dialog_selection_callback, 0); |
| 991 | lw_modify_all_widgets (dialog_id, first_wv->contents, TRUE); | 992 | lw_modify_all_widgets (dialog_id, first_wv->contents, TRUE); |
| 992 | 993 | ||
| @@ -1037,25 +1038,25 @@ w32_dialog_show (struct frame *f, Lisp_Object title, | |||
| 1037 | anywhere in Emacs that uses the other specific dialog choices that | 1038 | anywhere in Emacs that uses the other specific dialog choices that |
| 1038 | MessageBox provides. */ | 1039 | MessageBox provides. */ |
| 1039 | 1040 | ||
| 1040 | static int | 1041 | static bool |
| 1041 | is_simple_dialog (Lisp_Object contents) | 1042 | is_simple_dialog (Lisp_Object contents) |
| 1042 | { | 1043 | { |
| 1043 | Lisp_Object options; | 1044 | Lisp_Object options; |
| 1044 | Lisp_Object name, yes, no, other; | 1045 | Lisp_Object name, yes, no, other; |
| 1045 | 1046 | ||
| 1046 | if (!CONSP (contents)) | 1047 | if (!CONSP (contents)) |
| 1047 | return 0; | 1048 | return false; |
| 1048 | options = XCDR (contents); | 1049 | options = XCDR (contents); |
| 1049 | 1050 | ||
| 1050 | yes = build_string ("Yes"); | 1051 | yes = build_string ("Yes"); |
| 1051 | no = build_string ("No"); | 1052 | no = build_string ("No"); |
| 1052 | 1053 | ||
| 1053 | if (!CONSP (options)) | 1054 | if (!CONSP (options)) |
| 1054 | return 0; | 1055 | return false; |
| 1055 | 1056 | ||
| 1056 | name = XCAR (options); | 1057 | name = XCAR (options); |
| 1057 | if (!CONSP (name)) | 1058 | if (!CONSP (name)) |
| 1058 | return 0; | 1059 | return false; |
| 1059 | name = XCAR (name); | 1060 | name = XCAR (name); |
| 1060 | 1061 | ||
| 1061 | if (!NILP (Fstring_equal (name, yes))) | 1062 | if (!NILP (Fstring_equal (name, yes))) |
| @@ -1063,18 +1064,18 @@ is_simple_dialog (Lisp_Object contents) | |||
| 1063 | else if (!NILP (Fstring_equal (name, no))) | 1064 | else if (!NILP (Fstring_equal (name, no))) |
| 1064 | other = yes; | 1065 | other = yes; |
| 1065 | else | 1066 | else |
| 1066 | return 0; | 1067 | return false; |
| 1067 | 1068 | ||
| 1068 | options = XCDR (options); | 1069 | options = XCDR (options); |
| 1069 | if (!CONSP (options)) | 1070 | if (!CONSP (options)) |
| 1070 | return 0; | 1071 | return false; |
| 1071 | 1072 | ||
| 1072 | name = XCAR (options); | 1073 | name = XCAR (options); |
| 1073 | if (!CONSP (name)) | 1074 | if (!CONSP (name)) |
| 1074 | return 0; | 1075 | return false; |
| 1075 | name = XCAR (name); | 1076 | name = XCAR (name); |
| 1076 | if (NILP (Fstring_equal (name, other))) | 1077 | if (NILP (Fstring_equal (name, other))) |
| 1077 | return 0; | 1078 | return false; |
| 1078 | 1079 | ||
| 1079 | /* Check there are no more options. */ | 1080 | /* Check there are no more options. */ |
| 1080 | options = XCDR (options); | 1081 | options = XCDR (options); |
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 9cd97e28616..73c0410c7b7 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c | |||
| @@ -67,7 +67,7 @@ memq_no_quit (Lisp_Object elt, Lisp_Object list) | |||
| 67 | static Lisp_Object | 67 | static Lisp_Object |
| 68 | uniscribe_list (struct frame *f, Lisp_Object font_spec) | 68 | uniscribe_list (struct frame *f, Lisp_Object font_spec) |
| 69 | { | 69 | { |
| 70 | Lisp_Object fonts = w32font_list_internal (f, font_spec, 1); | 70 | Lisp_Object fonts = w32font_list_internal (f, font_spec, true); |
| 71 | FONT_ADD_LOG ("uniscribe-list", font_spec, fonts); | 71 | FONT_ADD_LOG ("uniscribe-list", font_spec, fonts); |
| 72 | return fonts; | 72 | return fonts; |
| 73 | } | 73 | } |
| @@ -75,7 +75,7 @@ uniscribe_list (struct frame *f, Lisp_Object font_spec) | |||
| 75 | static Lisp_Object | 75 | static Lisp_Object |
| 76 | uniscribe_match (struct frame *f, Lisp_Object font_spec) | 76 | uniscribe_match (struct frame *f, Lisp_Object font_spec) |
| 77 | { | 77 | { |
| 78 | Lisp_Object entity = w32font_match_internal (f, font_spec, 1); | 78 | Lisp_Object entity = w32font_match_internal (f, font_spec, true); |
| 79 | FONT_ADD_LOG ("uniscribe-match", font_spec, entity); | 79 | FONT_ADD_LOG ("uniscribe-match", font_spec, entity); |
| 80 | return entity; | 80 | return entity; |
| 81 | } | 81 | } |