summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog75
-rw-r--r--src/buffer.c3
-rw-r--r--src/ccl.c1
-rw-r--r--src/emacs.c2
-rw-r--r--src/fileio.c1
-rw-r--r--src/fns.c2
-rw-r--r--src/image.c109
-rw-r--r--src/lread.c37
-rw-r--r--src/minibuf.c22
-rw-r--r--src/search.c4
-rw-r--r--src/syssignal.h5
-rw-r--r--src/term.c6
-rw-r--r--src/unexelf.c14
-rw-r--r--src/window.c1
-rw-r--r--src/xterm.c1
15 files changed, 236 insertions, 47 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 61b658b6b88..213e7762485 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,76 @@
+2005-10-21 Richard M. Stallman <rms@gnu.org>
+
+ * lread.c (Fload): Simplify gcpro structure.
+ Gcpro FOUND as well as FILE, but not EFOUND.
+ Unless preloading, record FOUND instead of FILE in Vload_history.
+ Rename repeat local FILE to MSG_FILE.
+ (syms_of_lread) <load-history>: Doc fix.
+
+2005-10-21 Kenichi Handa <handa@m17n.org>
+
+ * search.c (boyer_moore): Surround the '||' part of expression in
+ `if' condition by parentheses explicitly.
+
+2005-10-20 Kim F. Storm <storm@cua.dk>
+
+ * buffer.c (clone_per_buffer_values): Remove unused var tem.
+ (init_buffer): Remove unused vars dotstat, pwdstat.
+
+ * ccl.c (check_ccl_update): Remove unused var vp.
+
+ * fileio.c (auto_save_error): Call SAFE_FREE.
+
+ * fns.c (Fchar_table_range): Remove unused var i.
+
+ * minibuf.c (display_completion_list_1): New wrapper function
+ for Fdisplay_completion_list.
+ (Fminibuffer_completion_help): Use it.
+
+ * term.c (encode_terminal_code): Remove unused var src_start.
+
+ * window.c (Fwindow_tree): Remove unused var alist.
+
+ * xterm.c (x_calc_absolute_position): Remove unused vars win_x, win_y.
+
+2005-10-20 Aubrey Jaffer <agj@alum.mit.edu> (tiny change)
+
+ * unexelf.c (unexec): Fix calls to `fatal' with less than 3
+ arguments.
+
+2005-10-20 Olli Savia <ops@iki.fi> (tiny change)
+
+ * syssignal.h [__Lynx__]: Undef SIGPOLL along with SIGIO.
+
+2005-10-20 Andreas Schwab <schwab@suse.de>
+
+ * minibuf.c (Fdisplay_completion_list): Doc fix.
+
+2005-10-19 Kim F. Storm <storm@cua.dk>
+
+ * image.c (check_image_size): Handle integer Vmax_image_size value
+ directly as max pixel value. Use default frame size for null frame.
+ (syms_of_image) <max-image-size>: Describe integer value.
+
+2005-10-19 Romain Francoise <romain@orebokech.com>
+
+ * emacs.c (main): Update copyright year.
+
+2005-10-18 Chong Yidong <cyd@stupidchicken.com>
+
+ * image.c (Vmax_image_size): New variable.
+ (check_image_size): New function.
+ (xbm_read_bitmap_data, pbm_load, png_load, jpeg_load, tiff_load)
+ (gif_load, gs_load): Use it.
+ (lookup_image): Try loading again if previous load failed.
+ (xbm_read_bitmap_data): Add a new argument, a pointer to the frame
+ to display in, NULL if none.
+ (xbm_load_image, xbm_file_p): Pass xbm_read_bitmap_data the new
+ argument.
+
+2005-10-18 Richard M. Stallman <rms@gnu.org>
+
+ * search.c (Fstring_match): Doc fix.
+
2005-10-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* macterm.c (note_mouse_movement): Use PtInRect.
@@ -8,7 +81,7 @@
2005-10-16 Masatake YAMATO <jet@gyve.org>
* minibuf.c (Fdisplay_completion_list): Add new optional
- argument COMMON_SUBSTRING. Bind `completion-common-substring'
+ argument COMMON_SUBSTRING. Bind `completion-common-substring'
to the optional argument during running `completion-setup-hook'.
2005-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
diff --git a/src/buffer.c b/src/buffer.c
index c173136961e..5e304d5a1bb 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -485,7 +485,7 @@ static void
clone_per_buffer_values (from, to)
struct buffer *from, *to;
{
- Lisp_Object to_buffer, tem;
+ Lisp_Object to_buffer;
int offset;
XSETBUFFER (to_buffer, to);
@@ -5112,7 +5112,6 @@ void
init_buffer ()
{
char *pwd;
- struct stat dotstat, pwdstat;
Lisp_Object temp;
int len;
diff --git a/src/ccl.c b/src/ccl.c
index 562215218bc..a5a39ca0d4b 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -2119,7 +2119,6 @@ int
check_ccl_update (ccl)
struct ccl_program *ccl;
{
- struct Lisp_Vector *vp;
Lisp_Object slot, ccl_prog;
if (ccl->idx < 0)
diff --git a/src/emacs.c b/src/emacs.c
index 9ada521f1e3..33941ae9227 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -897,7 +897,7 @@ main (argc, argv
else
{
printf ("GNU Emacs %s\n", SDATA (tem));
- printf ("Copyright (C) 2004 Free Software Foundation, Inc.\n");
+ printf ("Copyright (C) 2005 Free Software Foundation, Inc.\n");
printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");
printf ("You may redistribute copies of Emacs\n");
printf ("under the terms of the GNU General Public License.\n");
diff --git a/src/fileio.c b/src/fileio.c
index 1cd996d2a4f..6806c7d025a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5797,6 +5797,7 @@ auto_save_error (error)
Fsleep_for (make_number (1), Qnil);
}
+ SAFE_FREE ();
UNGCPRO;
return Qnil;
}
diff --git a/src/fns.c b/src/fns.c
index 73ed21d0fbe..d0d4da4cd57 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2555,7 +2555,7 @@ Note that this function doesn't check the parent of CHAR-TABLE. */)
Lisp_Object char_table, range;
{
int charset_id, c1 = 0, c2 = 0;
- int size, i;
+ int size;
Lisp_Object ch, val, current_default;
CHECK_CHAR_TABLE (char_table);
diff --git a/src/image.c b/src/image.c
index 2463c24a33a..1996d8477e9 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1099,7 +1099,10 @@ or omitted means use the selected frame. */)
static struct image *make_image P_ ((Lisp_Object spec, unsigned hash));
static void free_image P_ ((struct frame *f, struct image *img));
+static int check_image_size P_ ((struct frame *f, int width, int height));
+#define MAX_IMAGE_SIZE 6.0
+Lisp_Object Vmax_image_size;
/* Allocate and return a new image structure for image specification
SPEC. SPEC has a hash value of HASH. */
@@ -1151,6 +1154,39 @@ free_image (f, img)
}
}
+/* Return 1 if the given widths and heights are valid for display;
+ otherwise, return 0. */
+
+int
+check_image_size (f, width, height)
+ struct frame *f;
+ int width;
+ int height;
+{
+ int w, h;
+
+ if (width <= 0 || height <= 0)
+ return 0;
+
+ if (INTEGERP (Vmax_image_size))
+ w = h = XINT (Vmax_image_size);
+ else if (FLOATP (Vmax_image_size))
+ {
+ if (f != NULL)
+ {
+ w = FRAME_PIXEL_WIDTH (f);
+ h = FRAME_PIXEL_HEIGHT (f);
+ }
+ else
+ w = h = 1024; /* Arbitrary size for unknown frame. */
+ w = (int) (XFLOAT_DATA (Vmax_image_size) * w);
+ h = (int) (XFLOAT_DATA (Vmax_image_size) * h);
+ }
+ else
+ return 1;
+
+ return (width <= w && height <= h);
+}
/* Prepare image IMG for display on frame F. Must be called before
drawing an image. */
@@ -1708,6 +1744,12 @@ lookup_image (f, spec)
if (img->hash == hash && !NILP (Fequal (img->spec, spec)))
break;
+ if (img && img->load_failed_p)
+ {
+ free_image (f, img);
+ img = NULL;
+ }
+
/* If not found, create a new image and cache it. */
if (img == NULL)
{
@@ -2551,7 +2593,8 @@ static int xbm_load P_ ((struct frame *f, struct image *img));
static int xbm_load_image P_ ((struct frame *f, struct image *img,
unsigned char *, unsigned char *));
static int xbm_image_p P_ ((Lisp_Object object));
-static int xbm_read_bitmap_data P_ ((unsigned char *, unsigned char *,
+static int xbm_read_bitmap_data P_ ((struct frame *f,
+ unsigned char *, unsigned char *,
int *, int *, unsigned char **));
static int xbm_file_p P_ ((Lisp_Object));
@@ -2939,7 +2982,8 @@ Create_Pixmap_From_Bitmap_Data(f, img, data, fg, bg, non_default_colors)
CONTENTS looks like an in-memory XBM file. */
static int
-xbm_read_bitmap_data (contents, end, width, height, data)
+xbm_read_bitmap_data (f, contents, end, width, height, data)
+ struct frame *f;
unsigned char *contents, *end;
int *width, *height;
unsigned char **data;
@@ -2992,7 +3036,7 @@ xbm_read_bitmap_data (contents, end, width, height, data)
expect (XBM_TK_NUMBER);
}
- if (*width < 0 || *height < 0)
+ if (!check_image_size (f, *width, *height))
goto failure;
else if (data == NULL)
goto success;
@@ -3096,7 +3140,7 @@ xbm_load_image (f, img, contents, end)
unsigned char *data;
int success_p = 0;
- rc = xbm_read_bitmap_data (contents, end, &img->width, &img->height, &data);
+ rc = xbm_read_bitmap_data (f, contents, end, &img->width, &img->height, &data);
if (rc)
{
unsigned long foreground = FRAME_FOREGROUND_PIXEL (f);
@@ -3150,7 +3194,7 @@ xbm_file_p (data)
{
int w, h;
return (STRINGP (data)
- && xbm_read_bitmap_data (SDATA (data),
+ && xbm_read_bitmap_data (NULL, SDATA (data),
(SDATA (data)
+ SBYTES (data)),
&w, &h, NULL));
@@ -5465,8 +5509,7 @@ pbm_load (f, img)
max_color_idx = 255;
}
- if (width < 0
- || height < 0
+ if (!check_image_size (f, width, height)
|| (type != PBM_MONO && max_color_idx < 0))
goto error;
@@ -5966,6 +6009,9 @@ png_load (f, img)
fn_png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
&interlace_type, NULL, NULL);
+ if (!check_image_size (f, width, height))
+ goto error;
+
/* If image contains simply transparency data, we prefer to
construct a clipping mask. */
if (fn_png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS))
@@ -6726,6 +6772,12 @@ jpeg_load (f, img)
width = img->width = cinfo.output_width;
height = img->height = cinfo.output_height;
+ if (!check_image_size (f, width, height))
+ {
+ image_error ("Invalid image size", Qnil, Qnil);
+ longjmp (mgr.setjmp_buffer, 2);
+ }
+
/* Create X image and pixmap. */
if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
longjmp (mgr.setjmp_buffer, 2);
@@ -7155,6 +7207,14 @@ tiff_load (f, img)
of width x height 32-bit values. */
fn_TIFFGetField (tiff, TIFFTAG_IMAGEWIDTH, &width);
fn_TIFFGetField (tiff, TIFFTAG_IMAGELENGTH, &height);
+
+ if (!check_image_size (f, width, height))
+ {
+ image_error ("Invalid image size", Qnil, Qnil);
+ UNGCPRO;
+ return 0;
+ }
+
buf = (uint32 *) xmalloc (width * height * sizeof *buf);
rc = fn_TIFFReadRGBAImage (tiff, width, height, buf, 0);
@@ -7459,6 +7519,15 @@ gif_load (f, img)
}
}
+ /* Before reading entire contents, check the declared image size. */
+ if (!check_image_size (f, gif->SWidth, gif->SHeight))
+ {
+ image_error ("Invalid image size", Qnil, Qnil);
+ fn_DGifCloseFile (gif);
+ UNGCPRO;
+ return 0;
+ }
+
/* Read entire contents. */
rc = fn_DGifSlurp (gif);
if (rc == GIF_ERROR)
@@ -7492,6 +7561,14 @@ gif_load (f, img)
max (gif->Image.Top + gif->Image.Height,
image_top + image_height));
+ if (!check_image_size (f, width, height))
+ {
+ image_error ("Invalid image size", Qnil, Qnil);
+ fn_DGifCloseFile (gif);
+ UNGCPRO;
+ return 0;
+ }
+
/* Create the X image and pixmap. */
if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
{
@@ -7944,6 +8021,12 @@ gs_load (f, img)
in_height = XFASTINT (pt_height) / 72.0;
img->height = in_height * FRAME_X_DISPLAY_INFO (f)->resy;
+ if (!check_image_size (f, img->width, img->height))
+ {
+ image_error ("Invalid image size", Qnil, Qnil);
+ return 0;
+ }
+
/* Create the pixmap. */
xassert (img->pixmap == NO_PIXMAP);
@@ -8217,6 +8300,18 @@ listed; they're always supported. */);
Vimage_library_alist = Qnil;
Fput (intern ("image-library-alist"), Qrisky_local_variable, Qt);
+ DEFVAR_LISP ("max-image-size", &Vmax_image_size,
+ doc: /* Maximum size of images.
+Emacs will not load an image into memory if its pixel width or
+pixel height exceeds this limit.
+
+If the value is an integer, it directly specifies the maximum
+image height and width, measured in pixels. If it is a floating
+point number, it specifies the maximum image height and width
+as a ratio to the frame height and width. If the value is
+non-numeric, there is no explicit limit on the size of images. */);
+ Vmax_image_size = make_float (MAX_IMAGE_SIZE);
+
Vimage_type_cache = Qnil;
staticpro (&Vimage_type_cache);
diff --git a/src/lread.c b/src/lread.c
index 94fb5ddb155..43c7bf6cfc2 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -670,6 +670,11 @@ If optional fourth arg NOSUFFIX is non-nil, don't try adding
If optional fifth arg MUST-SUFFIX is non-nil, insist on
the suffix `.elc' or `.el'; don't accept just FILE unless
it ends in one of those suffixes or includes a directory name.
+
+Loading a file records its definitions, and its `provide' and
+`require' calls, in an element of `load-history' whose
+car is the file name loaded. See `load-history'.
+
Return t if file exists. */)
(file, noerror, nomessage, nosuffix, must_suffix)
Lisp_Object file, noerror, nomessage, nosuffix, must_suffix;
@@ -678,7 +683,7 @@ Return t if file exists. */)
register int fd = -1;
int count = SPECPDL_INDEX ();
Lisp_Object temp;
- struct gcpro gcpro1;
+ struct gcpro gcpro1, gcpro2;
Lisp_Object found, efound;
/* 1 means we printed the ".el is newer" message. */
int newer = 0;
@@ -725,7 +730,8 @@ Return t if file exists. */)
int size = SBYTES (file);
Lisp_Object tmp[2];
- GCPRO1 (file);
+ found = Qnil;
+ GCPRO2 (file, found);
if (! NILP (must_suffix))
{
@@ -812,6 +818,8 @@ Return t if file exists. */)
struct stat s1, s2;
int result;
+ GCPRO2 (file, found);
+
if (!safe_to_load_p (fd))
{
safe_p = 0;
@@ -828,7 +836,6 @@ Return t if file exists. */)
compiled = 1;
- GCPRO1 (efound);
efound = ENCODE_FILE (found);
#ifdef DOS_NT
@@ -838,7 +845,6 @@ Return t if file exists. */)
SSET (efound, SBYTES (efound) - 1, 0);
result = stat ((char *)SDATA (efound), &s2);
SSET (efound, SBYTES (efound) - 1, 'c');
- UNGCPRO;
if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime)
{
@@ -848,12 +854,13 @@ Return t if file exists. */)
/* If we won't print another message, mention this anyway. */
if (!NILP (nomessage))
{
- Lisp_Object file;
- file = Fsubstring (found, make_number (0), make_number (-1));
+ Lisp_Object msg_file;
+ msg_file = Fsubstring (found, make_number (0), make_number (-1));
message_with_string ("Source file `%s' newer than byte-compiled file",
- file, 1);
+ msg_file, 1);
}
}
+ UNGCPRO;
}
}
else
@@ -872,12 +879,12 @@ Return t if file exists. */)
}
}
+ GCPRO2 (file, found);
+
#ifdef WINDOWSNT
emacs_close (fd);
- GCPRO1 (efound);
efound = ENCODE_FILE (found);
stream = fopen ((char *) SDATA (efound), fmode);
- UNGCPRO;
#else /* not WINDOWSNT */
stream = fdopen (fd, fmode);
#endif /* not WINDOWSNT */
@@ -904,7 +911,6 @@ Return t if file exists. */)
message_with_string ("Loading %s...", file, 1);
}
- GCPRO1 (file);
record_unwind_protect (load_unwind, make_save_value (stream, 0));
record_unwind_protect (load_descriptor_unwind, load_descriptor_list);
specbind (Qload_file_name, found);
@@ -912,8 +918,8 @@ Return t if file exists. */)
load_descriptor_list
= Fcons (make_number (fileno (stream)), load_descriptor_list);
load_in_progress++;
- readevalloop (Qget_file_char, stream, file, Feval,
- 0, Qnil, Qnil, Qnil, Qnil);
+ readevalloop (Qget_file_char, stream, (! NILP (Vpurify_flag) ? file : found),
+ Feval, 0, Qnil, Qnil, Qnil, Qnil);
unbind_to (count, Qnil);
/* Run any load-hooks for this file. */
@@ -3880,7 +3886,7 @@ when the corresponding call to `provide' is made. */);
Vafter_load_alist = Qnil;
DEFVAR_LISP ("load-history", &Vload_history,
- doc: /* Alist mapping source file names to symbols and features.
+ doc: /* Alist mapping file names to symbols and features.
Each alist element is a list that starts with a file name,
except for one element (optional) that starts with nil and describes
definitions evaluated from buffers not visiting files.
@@ -3889,7 +3895,10 @@ and cons cells of the form `(provide . FEATURE)', `(require . FEATURE)',
`(defun . FUNCTION)', `(autoload . SYMBOL)', and `(t . SYMBOL)'.
An element `(t . SYMBOL)' precedes an entry `(defun . FUNCTION)',
and means that SYMBOL was an autoload before this file redefined it
-as a function. */);
+as a function.
+
+For a preloaded file, the file name recorded is relative to the main Lisp
+directory. These names are converted to absolute by `file-loadhist-lookup'. */);
Vload_history = Qnil;
DEFVAR_LISP ("load-file-name", &Vload_file_name,
diff --git a/src/minibuf.c b/src/minibuf.c
index 9c0f4a09284..cdee2ad8300 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2367,14 +2367,14 @@ alternative, the second serves as annotation.
The actual completion alternatives, as inserted, are given `mouse-face'
properties of `highlight'.
At the end, this runs the normal hook `completion-setup-hook'.
-It can find the completion buffer in `standard-output'.
-The optional second arg COMMON-SUBSTRING is a string.
+It can find the completion buffer in `standard-output'.
+The optional second arg COMMON-SUBSTRING is a string.
It is used to put faces, `completions-first-difference` and
-`completions-common-part' on the completion bufffer. The
+`completions-common-part' on the completion buffer. The
`completions-common-part' face is put on the common substring
specified by COMMON-SUBSTRING. If COMMON-SUBSTRING is nil,
-the faces are not put.
-Internally, COMMON-SUBSTRING is bound to `completion-common-substring'
+the faces are not put.
+Internally, COMMON-SUBSTRING is bound to `completion-common-substring'
during running `completion-setup-hook'. */)
(completions, common_substring)
Lisp_Object completions;
@@ -2550,7 +2550,7 @@ during running `completion-setup-hook'. */)
specbind (intern ("completion-common-substring"), common_substring);
call1 (Vrun_hooks, intern ("completion-setup-hook"));
-
+
unbind_to (count1, Qnil);
}
@@ -2559,6 +2559,14 @@ during running `completion-setup-hook'. */)
return Qnil;
}
+
+static Lisp_Object
+display_completion_list_1 (list)
+ Lisp_Object list;
+{
+ return Fdisplay_completion_list (list, Qnil);
+}
+
DEFUN ("minibuffer-completion-help", Fminibuffer_completion_help, Sminibuffer_completion_help,
0, 0, "",
doc: /* Display a list of possible completions of the current minibuffer contents. */)
@@ -2580,7 +2588,7 @@ DEFUN ("minibuffer-completion-help", Fminibuffer_completion_help, Sminibuffer_co
}
else
internal_with_output_to_temp_buffer ("*Completions*",
- Fdisplay_completion_list,
+ display_completion_list_1,
Fsort (completions, Qstring_lessp));
return Qnil;
}
diff --git a/src/search.c b/src/search.c
index f60e6d0cfe2..d3a5bd838a9 100644
--- a/src/search.c
+++ b/src/search.c
@@ -429,7 +429,7 @@ string_match_1 (regexp, string, start, posix)
DEFUN ("string-match", Fstring_match, Sstring_match, 2, 3, 0,
doc: /* Return index of start of first match for REGEXP in STRING, or nil.
-Case is ignored if `case-fold-search' is non-nil in the current buffer.
+Matching ignores case if `case-fold-search' is non-nil.
If third arg START is non-nil, start search at that index in STRING.
For index of first char beyond the match, do (match-end 0).
`match-end' and `match-beginning' also give indices of substrings
@@ -1709,7 +1709,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
if (ASCII_BYTE_P (*ptr) || ! multibyte)
ch = *ptr;
else if (charset_base
- && (pat_end - ptr) == 1 || CHAR_HEAD_P (ptr[1]))
+ && ((pat_end - ptr) == 1 || CHAR_HEAD_P (ptr[1])))
{
unsigned char *charstart = ptr - 1;
diff --git a/src/syssignal.h b/src/syssignal.h
index 1e9c0dbb38a..3cb28220962 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -147,7 +147,10 @@ extern SIGMASKTYPE sigprocmask_set;
#undef SIGINFO
#endif
#if defined (SIGIO) && defined (BROKEN_SIGIO)
-#undef SIGIO
+# undef SIGIO
+# if defined (__Lynx__)
+# undef SIGPOLL /* Defined as SIGIO on LynxOS */
+# endif
#endif
#if defined (SIGPOLL) && defined (BROKEN_SIGPOLL)
#undef SIGPOLL
diff --git a/src/term.c b/src/term.c
index bb7f7354890..234be4a9271 100644
--- a/src/term.c
+++ b/src/term.c
@@ -639,7 +639,7 @@ encode_terminal_code (src, src_len, coding)
int src_len;
struct coding_system *coding;
{
- struct glyph *src_start = src, *src_end = src + src_len;
+ struct glyph *src_end = src + src_len;
register GLYPH g;
unsigned char *buf;
int nchars, nbytes, required;
@@ -724,7 +724,7 @@ encode_terminal_code (src, src_len, coding)
if (SYMBOLP (coding->pre_write_conversion)
&& ! NILP (Ffboundp (coding->pre_write_conversion)))
{
- run_pre_write_conversin_on_c_str (&encode_terminal_buf,
+ run_pre_write_conversin_on_c_str (&encode_terminal_buf,
&encode_terminal_bufsize,
nchars, nbytes, coding);
nchars = coding->produced_char;
@@ -1662,7 +1662,7 @@ produce_stretch_glyph (it)
&& calc_pixel_width_or_height (&tem, it, prop, 0, 1, &align_to))
{
if (it->glyph_row == NULL || !it->glyph_row->mode_line_p)
- align_to = (align_to < 0
+ align_to = (align_to < 0
? 0
: align_to - window_box_left_offset (it->w, TEXT_AREA));
else if (align_to < 0)
diff --git a/src/unexelf.c b/src/unexelf.c
index e33a9a1aeb3..f50e849fdcf 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -702,7 +702,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
#if MAP_ANON == 0
mmap_fd = open ("/dev/zero", O_RDONLY);
if (mmap_fd < 0)
- fatal ("Can't open /dev/zero for reading: errno %d\n", errno);
+ fatal ("Can't open /dev/zero for reading: errno %d\n", errno, 0);
#endif
/* We cannot use malloc here because that may use sbrk. If it does,
@@ -713,7 +713,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
old_base = mmap (NULL, old_file_size, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE, mmap_fd, 0);
if (old_base == MAP_FAILED)
- fatal ("Can't allocate buffer for %s\n", old_name);
+ fatal ("Can't allocate buffer for %s\n", old_name, 0);
if (read (old_file, old_base, stat_buf.st_size) != stat_buf.st_size)
fatal ("Didn't read all of %s: errno %d\n", old_name, errno);
@@ -802,7 +802,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
new_base = mmap (NULL, new_file_size, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE, mmap_fd, 0);
if (new_base == MAP_FAILED)
- fatal ("Can't allocate buffer for %s\n", old_name);
+ fatal ("Can't allocate buffer for %s\n", old_name, 0);
new_file_h = (ElfW(Ehdr) *) new_base;
new_program_h = (ElfW(Phdr) *) ((byte *) new_base + old_file_h->e_phoff);
@@ -1079,7 +1079,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
&& old_mdebug_index != -1)
{
int diff = NEW_SECTION_H(nn).sh_offset
- - OLD_SECTION_H(old_mdebug_index).sh_offset;
+ - OLD_SECTION_H(old_mdebug_index).sh_offset;
HDRR *phdr = (HDRR *)(NEW_SECTION_H (nn).sh_offset + new_base);
if (diff)
@@ -1257,9 +1257,13 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
/* Write out new_file, and free the buffers. */
if (write (new_file, new_base, new_file_size) != new_file_size)
+#ifndef emacs
+ fatal ("Didn't write %d bytes: errno %d\n",
+ new_file_size, errno);
+#else
fatal ("Didn't write %d bytes to %s: errno %d\n",
new_file_size, new_base, errno);
-
+#endif
munmap (old_base, old_file_size);
munmap (new_base, new_file_size);
diff --git a/src/window.c b/src/window.c
index 7b3f28ac799..520d5ae8eaa 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6295,7 +6295,6 @@ selected frame. */)
(frame)
Lisp_Object frame;
{
- Lisp_Object alist;
FRAME_PTR f;
if (NILP (frame))
diff --git a/src/xterm.c b/src/xterm.c
index ef40c8b790d..2aa1095f27c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8103,7 +8103,6 @@ void
x_calc_absolute_position (f)
struct frame *f;
{
- int win_x = 0, win_y = 0;
int flags = f->size_hint_flags;
/* We have nothing to do if the current position