diff options
| author | Eli Zaretskii | 2010-08-13 12:21:31 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-08-13 12:21:31 +0300 |
| commit | 891ef8f7d735c3841e7b55fcb994823a20005c80 (patch) | |
| tree | c82bb9145fd487f61941815c74cd273504be6c8c /src/msdos.c | |
| parent | 38e41e0e7878499325a609c8e6d30cd3acda3376 (diff) | |
| download | emacs-891ef8f7d735c3841e7b55fcb994823a20005c80.tar.gz emacs-891ef8f7d735c3841e7b55fcb994823a20005c80.zip | |
Fix -Wall compiler warnings in MSDOS sources.
msdos.c (IT_set_face): Fix format string to match argument types.
(IT_write_glyphs, IT_note_mode_line_highlight)
(IT_set_frame_parameters): Remove unused variables.
(x_set_menu_bar_lines): Declare set_menu_bar_lines.
(IT_set_terminal_modes): Disambiguate expression in if clause.
(Fmsdos_remember_default_colors): Return Qnil.
(IT_set_frame_parameters): Add parens to disambiguate boolean
expression for logging the cursor type to termscript.
(keyboard_layout_list, keypad_translate_map)
(grey_key_translate_map): Add braces in inner initializers.
(dos_rawgetc): Add parens in condition for mouse-3 button-press.
(dos_rawgetc): Remove unused label.
(XMenuActivate): Add braces to remove ambiguous `else'.
(dos_ttraw): Always return a value.
(spawnve): Declare.
(run_msdos_command): Cast 3rd arg of spawnve to "char **".
dosfns.h (x_set_title): Declare.
w16select.c (Fw16_set_clipboard_data, Fw16_get_clipboard_data):
Remove unused variables.
dosfns.c (Fint86, Fdos_memget, Fdos_memput): Remove unused variables.
(init_dosfns): Declare get_lim_data.
(system_process_attributes): Declare Fget_internal_run_time.
Diffstat (limited to 'src/msdos.c')
| -rw-r--r-- | src/msdos.c | 97 |
1 files changed, 47 insertions, 50 deletions
diff --git a/src/msdos.c b/src/msdos.c index ad529d00dea..086cad2ff84 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -68,8 +68,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 68 | #include <pc.h> | 68 | #include <pc.h> |
| 69 | #include <ctype.h> | 69 | #include <ctype.h> |
| 70 | /* #include <process.h> */ | 70 | /* #include <process.h> */ |
| 71 | /* Damn that local process.h! Instead we can define P_WAIT ourselves. */ | 71 | /* Damn that local process.h! Instead we can define P_WAIT and |
| 72 | spawnve ourselves. */ | ||
| 72 | #define P_WAIT 1 | 73 | #define P_WAIT 1 |
| 74 | extern int spawnve (int, const char *, char *const [], char *const []); | ||
| 73 | 75 | ||
| 74 | #ifndef _USE_LFN | 76 | #ifndef _USE_LFN |
| 75 | #define _USE_LFN 0 | 77 | #define _USE_LFN 0 |
| @@ -827,7 +829,7 @@ IT_set_face (int face) | |||
| 827 | bg = tem2; | 829 | bg = tem2; |
| 828 | } | 830 | } |
| 829 | if (tty->termscript) | 831 | if (tty->termscript) |
| 830 | fprintf (tty->termscript, "<FACE %d: %d/%d[FG:%d/BG:%d]>", face, | 832 | fprintf (tty->termscript, "<FACE %d: %lu/%lu[FG:%lu/BG:%lu]>", face, |
| 831 | fp->foreground, fp->background, fg, bg); | 833 | fp->foreground, fp->background, fg, bg); |
| 832 | if (fg >= 0 && fg < 16) | 834 | if (fg >= 0 && fg < 16) |
| 833 | { | 835 | { |
| @@ -859,12 +861,6 @@ IT_write_glyphs (struct frame *f, struct glyph *str, int str_len) | |||
| 859 | struct frame *sf; | 861 | struct frame *sf; |
| 860 | unsigned char *conversion_buffer; | 862 | unsigned char *conversion_buffer; |
| 861 | 863 | ||
| 862 | /* Do we need to consider conversion of unibyte characters to | ||
| 863 | multibyte? */ | ||
| 864 | int convert_unibyte_characters | ||
| 865 | = (NILP (current_buffer->enable_multibyte_characters) | ||
| 866 | && unibyte_display_via_language_environment); | ||
| 867 | |||
| 868 | /* If terminal_coding does any conversion, use it, otherwise use | 864 | /* If terminal_coding does any conversion, use it, otherwise use |
| 869 | safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here | 865 | safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here |
| 870 | because it always returns 1 if terminal_coding.src_multibyte is 1. */ | 866 | because it always returns 1 if terminal_coding.src_multibyte is 1. */ |
| @@ -1180,8 +1176,6 @@ fast_find_position (struct window *w, int pos, int *hpos, int *vpos) | |||
| 1180 | static void | 1176 | static void |
| 1181 | IT_note_mode_line_highlight (struct window *w, int x, int mode_line_p) | 1177 | IT_note_mode_line_highlight (struct window *w, int x, int mode_line_p) |
| 1182 | { | 1178 | { |
| 1183 | struct frame *f = XFRAME (w->frame); | ||
| 1184 | struct tty_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | ||
| 1185 | struct glyph_row *row; | 1179 | struct glyph_row *row; |
| 1186 | 1180 | ||
| 1187 | if (mode_line_p) | 1181 | if (mode_line_p) |
| @@ -1192,7 +1186,7 @@ IT_note_mode_line_highlight (struct window *w, int x, int mode_line_p) | |||
| 1192 | if (row->enabled_p) | 1186 | if (row->enabled_p) |
| 1193 | { | 1187 | { |
| 1194 | struct glyph *glyph, *end; | 1188 | struct glyph *glyph, *end; |
| 1195 | Lisp_Object help, map; | 1189 | Lisp_Object help; |
| 1196 | 1190 | ||
| 1197 | /* Find the glyph under X. */ | 1191 | /* Find the glyph under X. */ |
| 1198 | glyph = (row->glyphs[TEXT_AREA] | 1192 | glyph = (row->glyphs[TEXT_AREA] |
| @@ -1873,6 +1867,8 @@ IT_delete_glyphs (struct frame *f, int n) | |||
| 1873 | void | 1867 | void |
| 1874 | x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | 1868 | x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) |
| 1875 | { | 1869 | { |
| 1870 | extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); | ||
| 1871 | |||
| 1876 | set_menu_bar_lines (f, value, oldval); | 1872 | set_menu_bar_lines (f, value, oldval); |
| 1877 | } | 1873 | } |
| 1878 | 1874 | ||
| @@ -1939,7 +1935,7 @@ IT_set_terminal_modes (struct terminal *term) | |||
| 1939 | already point to the relocated buffer address returned by | 1935 | already point to the relocated buffer address returned by |
| 1940 | the Int 10h/AX=FEh call above. DJGPP v2.02 and later sets | 1936 | the Int 10h/AX=FEh call above. DJGPP v2.02 and later sets |
| 1941 | ScreenPrimary to that address at startup under DOS/V. */ | 1937 | ScreenPrimary to that address at startup under DOS/V. */ |
| 1942 | if (regs.x.es != (ScreenPrimary >> 4) & 0xffff) | 1938 | if (regs.x.es != ((ScreenPrimary >> 4) & 0xffff)) |
| 1943 | screen_old_address = ScreenPrimary; | 1939 | screen_old_address = ScreenPrimary; |
| 1944 | screen_virtual_segment = regs.x.es; | 1940 | screen_virtual_segment = regs.x.es; |
| 1945 | screen_virtual_offset = regs.x.di; | 1941 | screen_virtual_offset = regs.x.di; |
| @@ -2056,6 +2052,8 @@ DEFUN ("msdos-remember-default-colors", Fmsdos_remember_default_colors, | |||
| 2056 | frame colors are reversed. */ | 2052 | frame colors are reversed. */ |
| 2057 | initial_screen_colors[0] = FRAME_FOREGROUND_PIXEL (f); | 2053 | initial_screen_colors[0] = FRAME_FOREGROUND_PIXEL (f); |
| 2058 | initial_screen_colors[1] = FRAME_BACKGROUND_PIXEL (f); | 2054 | initial_screen_colors[1] = FRAME_BACKGROUND_PIXEL (f); |
| 2055 | |||
| 2056 | return Qnil; | ||
| 2059 | } | 2057 | } |
| 2060 | 2058 | ||
| 2061 | void | 2059 | void |
| @@ -2071,7 +2069,6 @@ IT_set_frame_parameters (struct frame *f, Lisp_Object alist) | |||
| 2071 | int reverse = EQ (Fcdr (Fassq (Qreverse, f->param_alist)), Qt); | 2069 | int reverse = EQ (Fcdr (Fassq (Qreverse, f->param_alist)), Qt); |
| 2072 | int redraw = 0, fg_set = 0, bg_set = 0; | 2070 | int redraw = 0, fg_set = 0, bg_set = 0; |
| 2073 | unsigned long orig_fg, orig_bg; | 2071 | unsigned long orig_fg, orig_bg; |
| 2074 | Lisp_Object frame_bg, frame_fg; | ||
| 2075 | struct tty_display_info *tty = FRAME_TTY (f); | 2072 | struct tty_display_info *tty = FRAME_TTY (f); |
| 2076 | 2073 | ||
| 2077 | /* If we are creating a new frame, begin with the original screen colors | 2074 | /* If we are creating a new frame, begin with the original screen colors |
| @@ -2195,9 +2192,10 @@ IT_set_frame_parameters (struct frame *f, Lisp_Object alist) | |||
| 2195 | IT_set_cursor_type (f, val); | 2192 | IT_set_cursor_type (f, val); |
| 2196 | if (tty->termscript) | 2193 | if (tty->termscript) |
| 2197 | fprintf (tty->termscript, "<CTYPE: %s>\n", | 2194 | fprintf (tty->termscript, "<CTYPE: %s>\n", |
| 2198 | EQ (val, Qbar) || EQ (val, Qhbar) | 2195 | EQ (val, Qbar) |
| 2199 | || CONSP (val) && (EQ (XCAR (val), Qbar) | 2196 | || EQ (val, Qhbar) |
| 2200 | || EQ (XCAR (val), Qhbar)) | 2197 | || (CONSP (val) && (EQ (XCAR (val), Qbar) |
| 2198 | || EQ (XCAR (val), Qhbar))) | ||
| 2201 | ? "bar" : "box"); | 2199 | ? "bar" : "box"); |
| 2202 | } | 2200 | } |
| 2203 | else if (EQ (prop, Qtty_type)) | 2201 | else if (EQ (prop, Qtty_type)) |
| @@ -2214,8 +2212,6 @@ IT_set_frame_parameters (struct frame *f, Lisp_Object alist) | |||
| 2214 | the current frame colors. */ | 2212 | the current frame colors. */ |
| 2215 | if (reverse) | 2213 | if (reverse) |
| 2216 | { | 2214 | { |
| 2217 | Lisp_Object frame; | ||
| 2218 | |||
| 2219 | if (!fg_set) | 2215 | if (!fg_set) |
| 2220 | { | 2216 | { |
| 2221 | FRAME_FOREGROUND_PIXEL (f) = orig_bg; | 2217 | FRAME_FOREGROUND_PIXEL (f) = orig_bg; |
| @@ -2532,11 +2528,11 @@ static struct keyboard_layout_list | |||
| 2532 | struct dos_keyboard_map *keyboard_map; | 2528 | struct dos_keyboard_map *keyboard_map; |
| 2533 | } keyboard_layout_list[] = | 2529 | } keyboard_layout_list[] = |
| 2534 | { | 2530 | { |
| 2535 | 1, &us_keyboard, | 2531 | { 1, &us_keyboard }, |
| 2536 | 33, &fr_keyboard, | 2532 | { 33, &fr_keyboard }, |
| 2537 | 39, &it_keyboard, | 2533 | { 39, &it_keyboard }, |
| 2538 | 45, &dk_keyboard, | 2534 | { 45, &dk_keyboard }, |
| 2539 | 81, &jp_keyboard | 2535 | { 81, &jp_keyboard } |
| 2540 | }; | 2536 | }; |
| 2541 | 2537 | ||
| 2542 | static struct dos_keyboard_map *keyboard; | 2538 | static struct dos_keyboard_map *keyboard; |
| @@ -2581,17 +2577,17 @@ static struct | |||
| 2581 | unsigned char keypad_code; /* keypad code */ | 2577 | unsigned char keypad_code; /* keypad code */ |
| 2582 | unsigned char editkey_code; /* edit key */ | 2578 | unsigned char editkey_code; /* edit key */ |
| 2583 | } keypad_translate_map[] = { | 2579 | } keypad_translate_map[] = { |
| 2584 | '0', '0', 0xb0, /* kp-0 */ 0x63, /* insert */ | 2580 | { '0', '0', 0xb0, /* kp-0 */ 0x63 /* insert */ }, |
| 2585 | '1', '1', 0xb1, /* kp-1 */ 0x57, /* end */ | 2581 | { '1', '1', 0xb1, /* kp-1 */ 0x57 /* end */ }, |
| 2586 | '2', '2', 0xb2, /* kp-2 */ 0x54, /* down */ | 2582 | { '2', '2', 0xb2, /* kp-2 */ 0x54 /* down */ }, |
| 2587 | '3', '3', 0xb3, /* kp-3 */ 0x56, /* next */ | 2583 | { '3', '3', 0xb3, /* kp-3 */ 0x56 /* next */ }, |
| 2588 | '4', '4', 0xb4, /* kp-4 */ 0x51, /* left */ | 2584 | { '4', '4', 0xb4, /* kp-4 */ 0x51 /* left */ }, |
| 2589 | '5', '5', 0xb5, /* kp-5 */ 0xb5, /* kp-5 */ | 2585 | { '5', '5', 0xb5, /* kp-5 */ 0xb5 /* kp-5 */ }, |
| 2590 | '6', '6', 0xb6, /* kp-6 */ 0x53, /* right */ | 2586 | { '6', '6', 0xb6, /* kp-6 */ 0x53 /* right */ }, |
| 2591 | '7', '7', 0xb7, /* kp-7 */ 0x50, /* home */ | 2587 | { '7', '7', 0xb7, /* kp-7 */ 0x50 /* home */ }, |
| 2592 | '8', '8', 0xb8, /* kp-8 */ 0x52, /* up */ | 2588 | { '8', '8', 0xb8, /* kp-8 */ 0x52 /* up */ }, |
| 2593 | '9', '9', 0xb9, /* kp-9 */ 0x55, /* prior */ | 2589 | { '9', '9', 0xb9, /* kp-9 */ 0x55 /* prior */ }, |
| 2594 | '.', '-', 0xae, /* kp-decimal */ 0xff /* delete */ | 2590 | { '.', '-', 0xae, /* kp-decimal */ 0xff /* delete */} |
| 2595 | }; | 2591 | }; |
| 2596 | 2592 | ||
| 2597 | static struct | 2593 | static struct |
| @@ -2599,11 +2595,11 @@ static struct | |||
| 2599 | unsigned char char_code; /* normal code */ | 2595 | unsigned char char_code; /* normal code */ |
| 2600 | unsigned char keypad_code; /* keypad code */ | 2596 | unsigned char keypad_code; /* keypad code */ |
| 2601 | } grey_key_translate_map[] = { | 2597 | } grey_key_translate_map[] = { |
| 2602 | '/', 0xaf, /* kp-decimal */ | 2598 | { '/', 0xaf /* kp-decimal */ }, |
| 2603 | '*', 0xaa, /* kp-multiply */ | 2599 | { '*', 0xaa /* kp-multiply */ }, |
| 2604 | '-', 0xad, /* kp-subtract */ | 2600 | { '-', 0xad /* kp-subtract */ }, |
| 2605 | '+', 0xab, /* kp-add */ | 2601 | { '+', 0xab /* kp-add */ }, |
| 2606 | '\r', 0x8d /* kp-enter */ | 2602 | { '\r', 0x8d /* kp-enter */ } |
| 2607 | }; | 2603 | }; |
| 2608 | 2604 | ||
| 2609 | static unsigned short | 2605 | static unsigned short |
| @@ -3129,7 +3125,6 @@ dos_rawgetc (void) | |||
| 3129 | break; | 3125 | break; |
| 3130 | } | 3126 | } |
| 3131 | 3127 | ||
| 3132 | make_event: | ||
| 3133 | if (code == 0) | 3128 | if (code == 0) |
| 3134 | continue; | 3129 | continue; |
| 3135 | 3130 | ||
| @@ -3237,14 +3232,14 @@ dos_rawgetc (void) | |||
| 3237 | /* If only one button is pressed, wait 100 msec and | 3232 | /* If only one button is pressed, wait 100 msec and |
| 3238 | check again. This way, Speedy Gonzales isn't | 3233 | check again. This way, Speedy Gonzales isn't |
| 3239 | punished, while the slow get their chance. */ | 3234 | punished, while the slow get their chance. */ |
| 3240 | if (press && mouse_pressed (1-but, &x2, &y2) | 3235 | if ((press && mouse_pressed (1-but, &x2, &y2)) |
| 3241 | || !press && mouse_released (1-but, &x2, &y2)) | 3236 | || (!press && mouse_released (1-but, &x2, &y2))) |
| 3242 | button_num = 2; | 3237 | button_num = 2; |
| 3243 | else | 3238 | else |
| 3244 | { | 3239 | { |
| 3245 | delay (100); | 3240 | delay (100); |
| 3246 | if (press && mouse_pressed (1-but, &x2, &y2) | 3241 | if ((press && mouse_pressed (1-but, &x2, &y2)) |
| 3247 | || !press && mouse_released (1-but, &x2, &y2)) | 3242 | || (!press && mouse_released (1-but, &x2, &y2))) |
| 3248 | button_num = 2; | 3243 | button_num = 2; |
| 3249 | } | 3244 | } |
| 3250 | } | 3245 | } |
| @@ -3680,10 +3675,12 @@ XMenuActivate (Display *foo, XMenu *menu, int *pane, int *selidx, | |||
| 3680 | if (0 <= dy && dy < state[i].menu->count) | 3675 | if (0 <= dy && dy < state[i].menu->count) |
| 3681 | { | 3676 | { |
| 3682 | if (!state[i].menu->submenu[dy]) | 3677 | if (!state[i].menu->submenu[dy]) |
| 3683 | if (state[i].menu->panenumber[dy]) | 3678 | { |
| 3684 | result = XM_SUCCESS; | 3679 | if (state[i].menu->panenumber[dy]) |
| 3685 | else | 3680 | result = XM_SUCCESS; |
| 3686 | result = XM_IA_SELECT; | 3681 | else |
| 3682 | result = XM_IA_SELECT; | ||
| 3683 | } | ||
| 3687 | *pane = state[i].pane - 1; | 3684 | *pane = state[i].pane - 1; |
| 3688 | *selidx = dy; | 3685 | *selidx = dy; |
| 3689 | /* We hit some part of a menu, so drop extra menus that | 3686 | /* We hit some part of a menu, so drop extra menus that |
| @@ -4181,7 +4178,7 @@ dos_ttraw (struct tty_display_info *tty) | |||
| 4181 | /* If we are called for the initial terminal, it's too early to do | 4178 | /* If we are called for the initial terminal, it's too early to do |
| 4182 | anything, and termscript isn't set up. */ | 4179 | anything, and termscript isn't set up. */ |
| 4183 | if (tty->terminal->type == output_initial) | 4180 | if (tty->terminal->type == output_initial) |
| 4184 | return; | 4181 | return 2; |
| 4185 | 4182 | ||
| 4186 | break_stat = getcbrk (); | 4183 | break_stat = getcbrk (); |
| 4187 | setcbrk (0); | 4184 | setcbrk (0); |
| @@ -4367,7 +4364,7 @@ run_msdos_command (unsigned char **argv, const char *working_dir, | |||
| 4367 | result = 0; /* emulate Unixy shell behavior with empty cmd line */ | 4364 | result = 0; /* emulate Unixy shell behavior with empty cmd line */ |
| 4368 | } | 4365 | } |
| 4369 | else | 4366 | else |
| 4370 | result = spawnve (P_WAIT, argv[0], argv, envv); | 4367 | result = spawnve (P_WAIT, argv[0], (char **)argv, envv); |
| 4371 | 4368 | ||
| 4372 | dup2 (inbak, 0); | 4369 | dup2 (inbak, 0); |
| 4373 | dup2 (outbak, 1); | 4370 | dup2 (outbak, 1); |