aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii <[email protected]>2010-08-13 14:09:51 +0300
committerEli Zaretskii <[email protected]>2010-08-13 14:09:51 +0300
commit9dec0f7642296c34dfd3700c6094808ce6ed289e (patch)
tree0b0f87d6c22ed0b2e49cdf7e4db2466573c42b00
parent186a9cbb9d4e7e9fd74249501ce6838442c7c11a (diff)
parent8ee818927b65c6efa665e5ba13d25f985721de04 (diff)
Fix compilation of xmenu.c and unexcoff.c, clean up MSDOS source files.
unexcoff.c: Remove the parts used when "emacs" is not defined. (report_error, report_error_1): Ditto. (write_segment): Remove "#if 0" unused code. (make_hdr): Remove code that was "#ifndef NO_REMAP" before NO_REMAP was removed (in 2010-07-29T03:25:[email protected]). (start_of_text): Remove unused function (was used only if NO_REMAP was NOT defined). 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. xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Fix argument list to be consistent with menu.h.
-rw-r--r--src/ChangeLog39
-rw-r--r--src/dosfns.c6
-rw-r--r--src/dosfns.h1
-rw-r--r--src/msdos.c97
-rw-r--r--src/unexcoff.c41
-rw-r--r--src/w16select.c8
-rw-r--r--src/xmenu.c2
7 files changed, 93 insertions, 101 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9c00465612..024cf18efb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,44 @@
2010-08-13 Eli Zaretskii <[email protected]>
+ * unexcoff.c: Remove the parts used when "emacs" is not defined.
+ (report_error, report_error_1): Ditto.
+ (write_segment): Remove "#if 0" unused code.
+ (make_hdr): Remove code that was "#ifndef NO_REMAP" before
+ NO_REMAP was removed (in 2010-07-29T03:25:[email protected]).
+ (start_of_text): Remove unused function (was used only if NO_REMAP
+ was NOT defined).
+
+ * 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.
+
+ * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Fix argument
+ list to be consistent with menu.h.
+
* w32menu.c (add_menu_item, name_is_separator): Shut up compiler
warnings due to mixing of "char *" and "const char *".
diff --git a/src/dosfns.c b/src/dosfns.c
index 5be0a363da..e66b50ed3f 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -60,7 +60,6 @@ REGISTERS should be a vector produced by `make-register' and
register int i;
int no;
union REGS inregs, outregs;
- Lisp_Object val;
CHECK_NUMBER (interrupt);
no = (unsigned long) XINT (interrupt);
@@ -101,7 +100,6 @@ Return the updated VECTOR. */)
register int i;
int offs, len;
char *buf;
- Lisp_Object val;
CHECK_NUMBER (address);
offs = (unsigned long) XINT (address);
@@ -125,7 +123,6 @@ DEFUN ("msdos-memput", Fdos_memput, Sdos_memput, 2, 2, 0,
register int i;
int offs, len;
char *buf;
- Lisp_Object val;
CHECK_NUMBER (address);
offs = (unsigned long) XINT (address);
@@ -286,6 +283,8 @@ init_dosfns (void)
unsigned long xbuf = _go32_info_block.linear_address_of_transfer_buffer;
#ifndef SYSTEM_MALLOC
+ extern void get_lim_data (void);
+
get_lim_data (); /* why the hell isn't this called elsewhere? */
#endif
@@ -558,6 +557,7 @@ system_process_attributes (Lisp_Object pid)
int i;
Lisp_Object cmd_str, decoded_cmd, tem;
double pmem;
+ EXFUN (Fget_internal_run_time, 0);
#ifndef SYSTEM_MALLOC
extern unsigned long ret_lim_data ();
#endif
diff --git a/src/dosfns.h b/src/dosfns.h
index 820b6b30e4..d31401247b 100644
--- a/src/dosfns.h
+++ b/src/dosfns.h
@@ -40,6 +40,7 @@ extern Lisp_Object Vdos_display_scancodes;
extern int msdos_stdcolor_idx (const char *);
extern Lisp_Object msdos_stdcolor_name (int);
+extern void x_set_title (struct frame *, Lisp_Object);
#endif
/* arch-tag: a83b8c4c-63c8-451e-9e94-bc72e3e2f8bc
diff --git a/src/msdos.c b/src/msdos.c
index ad529d00de..086cad2ff8 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/>. */
#include <pc.h>
#include <ctype.h>
/* #include <process.h> */
-/* Damn that local process.h! Instead we can define P_WAIT ourselves. */
+/* Damn that local process.h! Instead we can define P_WAIT and
+ spawnve ourselves. */
#define P_WAIT 1
+extern int spawnve (int, const char *, char *const [], char *const []);
#ifndef _USE_LFN
#define _USE_LFN 0
@@ -827,7 +829,7 @@ IT_set_face (int face)
bg = tem2;
}
if (tty->termscript)
- fprintf (tty->termscript, "<FACE %d: %d/%d[FG:%d/BG:%d]>", face,
+ fprintf (tty->termscript, "<FACE %d: %lu/%lu[FG:%lu/BG:%lu]>", face,
fp->foreground, fp->background, fg, bg);
if (fg >= 0 && fg < 16)
{
@@ -859,12 +861,6 @@ IT_write_glyphs (struct frame *f, struct glyph *str, int str_len)
struct frame *sf;
unsigned char *conversion_buffer;
- /* Do we need to consider conversion of unibyte characters to
- multibyte? */
- int convert_unibyte_characters
- = (NILP (current_buffer->enable_multibyte_characters)
- && unibyte_display_via_language_environment);
-
/* If terminal_coding does any conversion, use it, otherwise use
safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here
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)
static void
IT_note_mode_line_highlight (struct window *w, int x, int mode_line_p)
{
- struct frame *f = XFRAME (w->frame);
- struct tty_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
struct glyph_row *row;
if (mode_line_p)
@@ -1192,7 +1186,7 @@ IT_note_mode_line_highlight (struct window *w, int x, int mode_line_p)
if (row->enabled_p)
{
struct glyph *glyph, *end;
- Lisp_Object help, map;
+ Lisp_Object help;
/* Find the glyph under X. */
glyph = (row->glyphs[TEXT_AREA]
@@ -1873,6 +1867,8 @@ IT_delete_glyphs (struct frame *f, int n)
void
x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
+ extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
+
set_menu_bar_lines (f, value, oldval);
}
@@ -1939,7 +1935,7 @@ IT_set_terminal_modes (struct terminal *term)
already point to the relocated buffer address returned by
the Int 10h/AX=FEh call above. DJGPP v2.02 and later sets
ScreenPrimary to that address at startup under DOS/V. */
- if (regs.x.es != (ScreenPrimary >> 4) & 0xffff)
+ if (regs.x.es != ((ScreenPrimary >> 4) & 0xffff))
screen_old_address = ScreenPrimary;
screen_virtual_segment = regs.x.es;
screen_virtual_offset = regs.x.di;
@@ -2056,6 +2052,8 @@ DEFUN ("msdos-remember-default-colors", Fmsdos_remember_default_colors,
frame colors are reversed. */
initial_screen_colors[0] = FRAME_FOREGROUND_PIXEL (f);
initial_screen_colors[1] = FRAME_BACKGROUND_PIXEL (f);
+
+ return Qnil;
}
void
@@ -2071,7 +2069,6 @@ IT_set_frame_parameters (struct frame *f, Lisp_Object alist)
int reverse = EQ (Fcdr (Fassq (Qreverse, f->param_alist)), Qt);
int redraw = 0, fg_set = 0, bg_set = 0;
unsigned long orig_fg, orig_bg;
- Lisp_Object frame_bg, frame_fg;
struct tty_display_info *tty = FRAME_TTY (f);
/* 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)
IT_set_cursor_type (f, val);
if (tty->termscript)
fprintf (tty->termscript, "<CTYPE: %s>\n",
- EQ (val, Qbar) || EQ (val, Qhbar)
- || CONSP (val) && (EQ (XCAR (val), Qbar)
- || EQ (XCAR (val), Qhbar))
+ EQ (val, Qbar)
+ || EQ (val, Qhbar)
+ || (CONSP (val) && (EQ (XCAR (val), Qbar)
+ || EQ (XCAR (val), Qhbar)))
? "bar" : "box");
}
else if (EQ (prop, Qtty_type))
@@ -2214,8 +2212,6 @@ IT_set_frame_parameters (struct frame *f, Lisp_Object alist)
the current frame colors. */
if (reverse)
{
- Lisp_Object frame;
-
if (!fg_set)
{
FRAME_FOREGROUND_PIXEL (f) = orig_bg;
@@ -2532,11 +2528,11 @@ static struct keyboard_layout_list
struct dos_keyboard_map *keyboard_map;
} keyboard_layout_list[] =
{
- 1, &us_keyboard,
- 33, &fr_keyboard,
- 39, &it_keyboard,
- 45, &dk_keyboard,
- 81, &jp_keyboard
+ { 1, &us_keyboard },
+ { 33, &fr_keyboard },
+ { 39, &it_keyboard },
+ { 45, &dk_keyboard },
+ { 81, &jp_keyboard }
};
static struct dos_keyboard_map *keyboard;
@@ -2581,17 +2577,17 @@ static struct
unsigned char keypad_code; /* keypad code */
unsigned char editkey_code; /* edit key */
} keypad_translate_map[] = {
- '0', '0', 0xb0, /* kp-0 */ 0x63, /* insert */
- '1', '1', 0xb1, /* kp-1 */ 0x57, /* end */
- '2', '2', 0xb2, /* kp-2 */ 0x54, /* down */
- '3', '3', 0xb3, /* kp-3 */ 0x56, /* next */
- '4', '4', 0xb4, /* kp-4 */ 0x51, /* left */
- '5', '5', 0xb5, /* kp-5 */ 0xb5, /* kp-5 */
- '6', '6', 0xb6, /* kp-6 */ 0x53, /* right */
- '7', '7', 0xb7, /* kp-7 */ 0x50, /* home */
- '8', '8', 0xb8, /* kp-8 */ 0x52, /* up */
- '9', '9', 0xb9, /* kp-9 */ 0x55, /* prior */
- '.', '-', 0xae, /* kp-decimal */ 0xff /* delete */
+ { '0', '0', 0xb0, /* kp-0 */ 0x63 /* insert */ },
+ { '1', '1', 0xb1, /* kp-1 */ 0x57 /* end */ },
+ { '2', '2', 0xb2, /* kp-2 */ 0x54 /* down */ },
+ { '3', '3', 0xb3, /* kp-3 */ 0x56 /* next */ },
+ { '4', '4', 0xb4, /* kp-4 */ 0x51 /* left */ },
+ { '5', '5', 0xb5, /* kp-5 */ 0xb5 /* kp-5 */ },
+ { '6', '6', 0xb6, /* kp-6 */ 0x53 /* right */ },
+ { '7', '7', 0xb7, /* kp-7 */ 0x50 /* home */ },
+ { '8', '8', 0xb8, /* kp-8 */ 0x52 /* up */ },
+ { '9', '9', 0xb9, /* kp-9 */ 0x55 /* prior */ },
+ { '.', '-', 0xae, /* kp-decimal */ 0xff /* delete */}
};
static struct
@@ -2599,11 +2595,11 @@ static struct
unsigned char char_code; /* normal code */
unsigned char keypad_code; /* keypad code */
} grey_key_translate_map[] = {
- '/', 0xaf, /* kp-decimal */
- '*', 0xaa, /* kp-multiply */
- '-', 0xad, /* kp-subtract */
- '+', 0xab, /* kp-add */
- '\r', 0x8d /* kp-enter */
+ { '/', 0xaf /* kp-decimal */ },
+ { '*', 0xaa /* kp-multiply */ },
+ { '-', 0xad /* kp-subtract */ },
+ { '+', 0xab /* kp-add */ },
+ { '\r', 0x8d /* kp-enter */ }
};
static unsigned short
@@ -3129,7 +3125,6 @@ dos_rawgetc (void)
break;
}
- make_event:
if (code == 0)
continue;
@@ -3237,14 +3232,14 @@ dos_rawgetc (void)
/* If only one button is pressed, wait 100 msec and
check again. This way, Speedy Gonzales isn't
punished, while the slow get their chance. */
- if (press && mouse_pressed (1-but, &x2, &y2)
- || !press && mouse_released (1-but, &x2, &y2))
+ if ((press && mouse_pressed (1-but, &x2, &y2))
+ || (!press && mouse_released (1-but, &x2, &y2)))
button_num = 2;
else
{
delay (100);
- if (press && mouse_pressed (1-but, &x2, &y2)
- || !press && mouse_released (1-but, &x2, &y2))
+ if ((press && mouse_pressed (1-but, &x2, &y2))
+ || (!press && mouse_released (1-but, &x2, &y2)))
button_num = 2;
}
}
@@ -3680,10 +3675,12 @@ XMenuActivate (Display *foo, XMenu *menu, int *pane, int *selidx,
if (0 <= dy && dy < state[i].menu->count)
{
if (!state[i].menu->submenu[dy])
- if (state[i].menu->panenumber[dy])
- result = XM_SUCCESS;
- else
- result = XM_IA_SELECT;
+ {
+ if (state[i].menu->panenumber[dy])
+ result = XM_SUCCESS;
+ else
+ result = XM_IA_SELECT;
+ }
*pane = state[i].pane - 1;
*selidx = dy;
/* We hit some part of a menu, so drop extra menus that
@@ -4181,7 +4178,7 @@ dos_ttraw (struct tty_display_info *tty)
/* If we are called for the initial terminal, it's too early to do
anything, and termscript isn't set up. */
if (tty->terminal->type == output_initial)
- return;
+ return 2;
break_stat = getcbrk ();
setcbrk (0);
@@ -4367,7 +4364,7 @@ run_msdos_command (unsigned char **argv, const char *working_dir,
result = 0; /* emulate Unixy shell behavior with empty cmd line */
}
else
- result = spawnve (P_WAIT, argv[0], argv, envv);
+ result = spawnve (P_WAIT, argv[0], (char **)argv, envv);
dup2 (inbak, 0);
dup2 (outbak, 1);
diff --git a/src/unexcoff.c b/src/unexcoff.c
index ed319ec8e7..3e9786348c 100644
--- a/src/unexcoff.c
+++ b/src/unexcoff.c
@@ -74,12 +74,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
* of Dell Computer Corporation. [email protected].
*/
-#ifndef emacs
-#define PERROR(arg) perror (arg); return -1
-#else
#include <config.h>
#define PERROR(file) report_error (file, new)
-#endif
#ifndef CANNOT_DUMP /* all rest of file! */
@@ -132,7 +128,6 @@ struct aouthdr
#endif
-extern char *start_of_text (); /* Start of text */
extern char *start_of_data (); /* Start of initialized data */
static long block_copy_start; /* Old executable start point */
@@ -155,8 +150,6 @@ static int pagemask;
#define ADDR_CORRECT(x) ((char *)(x) - (char*)0)
-#ifdef emacs
-
#include <setjmp.h>
#include "lisp.h"
@@ -169,7 +162,6 @@ report_error (file, fd)
close (fd);
report_file_error ("Cannot unexec", Fcons (build_string (file), Qnil));
}
-#endif /* emacs */
#define ERROR0(msg) report_error_1 (new, msg, 0, 0); return -1
#define ERROR1(msg,x) report_error_1 (new, msg, x, 0); return -1
@@ -182,12 +174,7 @@ report_error_1 (fd, msg, a1, a2)
int a1, a2;
{
close (fd);
-#ifdef emacs
error (msg, a1, a2);
-#else
- fprintf (stderr, msg, a1, a2);
- fprintf (stderr, "\n");
-#endif
}
static int make_hdr ();
@@ -319,9 +306,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
to correspond to what we want to dump. */
f_hdr.f_flags |= (F_RELFLG | F_EXEC);
- f_ohdr.text_start = (long) start_of_text ();
- f_ohdr.tsize = data_start - f_ohdr.text_start;
- f_ohdr.data_start = data_start;
f_ohdr.dsize = bss_start - f_ohdr.data_start;
f_ohdr.bsize = bss_end - bss_start;
f_thdr.s_size = f_ohdr.tsize;
@@ -417,16 +401,6 @@ write_segment (new, ptr, end)
nwrite = pagesize;
write (new, zeros, nwrite);
}
-#if 0 /* Now that we have can ask `write' to write more than a page,
- it is legit for write do less than the whole amount specified. */
- else if (nwrite != ret)
- {
- sprintf (buf,
- "unexec write failure: addr 0x%x, fileno %d, size 0x%x, wrote 0x%x, errno %d",
- ptr, new, nwrite, ret, errno);
- PERROR (buf);
- }
-#endif
i += nwrite;
ptr += nwrite;
}
@@ -606,21 +580,6 @@ adjust_lnnoptrs (writedesc, readdesc, new_name)
return 0;
}
-extern unsigned start __asm__ ("start");
-
-/*
- * Return the address of the start of the text segment prior to
- * doing an unexec. After unexec the return value is undefined.
- * See crt0.c for further explanation and _start.
- *
- */
-
-char *
-start_of_text (void)
-{
- return ((char *) &start);
-}
-
/* ****************************************************************
* unexec
*
diff --git a/src/w16select.c b/src/w16select.c
index 384b82ceff..ef1b974752 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -456,7 +456,7 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat
(Lisp_Object string, Lisp_Object frame)
{
unsigned ok = 1, put_status = 0;
- int nbytes, charset_info, no_crlf_conversion;
+ int nbytes, no_crlf_conversion;
unsigned char *src, *dst = NULL;
CHECK_STRING (string);
@@ -494,9 +494,7 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat
{
/* We must encode contents of STRING according to what
clipboard-coding-system specifies. */
- int bufsize;
struct coding_system coding;
- unsigned char *htext2;
Lisp_Object coding_system =
NILP (Vnext_selection_coding_system) ?
Vselection_coding_system : Vnext_selection_coding_system;
@@ -567,7 +565,7 @@ DEFUN ("w16-get-clipboard-data", Fw16_get_clipboard_data, Sw16_get_clipboard_dat
unsigned data_size, truelen;
unsigned char *htext = NULL;
Lisp_Object ret = Qnil;
- int no_crlf_conversion, require_decoding = 0;
+ int require_decoding = 0;
if (NILP (frame))
frame = Fselected_frame ();
@@ -608,8 +606,6 @@ DEFUN ("w16-get-clipboard-data", Fw16_get_clipboard_data, Sw16_get_clipboard_dat
}
if (require_decoding)
{
- int bufsize;
- unsigned char *buf;
struct coding_system coding;
Lisp_Object coding_system = Vnext_selection_coding_system;
diff --git a/src/xmenu.c b/src/xmenu.c
index 0f42a5f089..68b442388a 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -2243,7 +2243,7 @@ pop_down_menu (Lisp_Object arg)
Lisp_Object
xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
- Lisp_Object title, char **error, EMACS_UINT timestamp)
+ Lisp_Object title, const char **error, EMACS_UINT timestamp)
{
Window root;
XMenu *menu;