1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-17 08:31:09 -08:00
Commit graph

11227 commits

Author SHA1 Message Date
Jan Djärv
115b96bdb5 (xg_make_tool_item): Insert comment about eventbox. 2011-09-07 19:25:24 +02:00
Paul Eggert
c8199d0f9e isnan: Fix porting problem to Solaris 10 with bundled gcc.
Without this fix, the command to link temacs failed due to an
undefined symbol __builtin_isnan.  This is because
/usr/include/iso/math_c99.h #defines isnan(x) to
__builtin_isnan(x), but the bundled gcc, which identifies itself
as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
a __builtin_isnan.
* configure.in (isnan): Remove now-unnecessary check.
* src/floatfns.c (isnan): #undef, and then #define to a clone of
what's in data.c.
(Fisnan): Always define, since it's always available now.
(syms_of_floatfns): Always define isnan at the Lisp level.
2011-09-06 13:47:45 -07:00
Paul Eggert
e39b275c8c Merge from trunk. 2011-09-06 09:34:41 -07:00
Paul Eggert
b2db44d9c6 Merge from trunk. 2011-09-06 08:27:16 -07:00
Paul Eggert
1dc4aa6d97 Merge from trunk. 2011-09-05 13:43:14 -07:00
Michael Albinus
ecfc0a4901 * dbusbind.c (xd_signature_cat): Rename from signature_cat. 2011-09-05 11:34:18 +02:00
Paul Eggert
1c262cae40 Merge from trunk. 2011-09-04 16:58:01 -07:00
Paul Eggert
6511acf257 Merge from trunk. 2011-09-04 12:18:28 -07:00
Paul Eggert
53e9fe9081 Integer overflow fixes for scrolling, etc. 2011-09-04 12:14:54 -07:00
Paul Eggert
806add1d2f * xdisp.c: Integer overflow fix.
(try_window_id): Check Emacs fixnum range before converting to 'int'.
2011-09-04 11:48:35 -07:00
Paul Eggert
71f02bc59a * window.c: Integer overflow fixes.
(window_scroll_line_based, Frecenter):
Check that an Emacs fixnum is in range before assigning it to 'int'.
(Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
values converted from Emacs fixnums.
(Frecenter): Don't wrap around a line count if it is out of 'int'
range; instead, treat it as an extreme value.
(Fset_window_configuration, compare_window_configurations):
Use ptrdiff_t, not int, for index that might exceed 2 GiB.
2011-09-04 11:46:51 -07:00
Paul Eggert
a0efffc812 * search.c: Integer overflow fixes
(Freplace_match): Use ptrdiff_t, not int, for indexes that can
exceed INT_MAX.  Check that EMACS_INT value is in range before
assigning it to the (possibly-narrower) index.
(match_limit): Don't assume that a fixnum can fit in 'int'.
2011-09-04 10:27:38 -07:00
Paul Eggert
29ebea3b12 * print.c: Integer overflow fix.
(print_object): Use ptrdiff_t, not int, for index that can
exceed INT_MAX.
2011-09-04 10:25:23 -07:00
Paul Eggert
3f8236f46b * indent.c: Integer overflow fixes.
(position_indentation): Now takes ptrdiff_t, not int.
(Fvertical_motion): Don't wrap around LINES values that don't fit
in 'int'.  Instead, treat them as extreme values.  This is good
enough for windows, which can't have more than INT_MAX lines anyway.
2011-09-04 10:24:12 -07:00
Paul Eggert
b49e353d9d Merge from trunk. 2011-09-03 16:03:38 -07:00
Lars Magne Ingebrigtsen
0f2f6b6d00 * Require libxml/parser.h to avoid compilation warning. 2011-09-04 00:20:00 +02:00
Lars Magne Ingebrigtsen
fcb901a77a Fix up xmlCleanupParser sequence.
* xml.c (parse_region): Don't call xmlCleanupParser after parsing,
since this reportedly can destroy thread storage.

* emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
2011-09-03 23:59:25 +02:00
Paul Eggert
f4af5137d4 Add Bug#. 2011-09-02 22:32:13 -07:00
Paul Eggert
728f8f0a00 * fileio.c: Fix bugs with large file offsets.
The previous code assumed that file offsets (off_t values) fit in
EMACS_INT variables, which is not true on typical 32-bit hosts.
The code messed up by falsely reporting buffer overflow in cases
such as (insert-file-contents "big" nil 1 2) into an empty buffer
when "big" contains more than 2**29 bytes, even though this
inserts just one byte and does not overflow the buffer.
(Finsert_file_contents): Store file offsets as off_t
values, not as EMACS_INT values.  Check for overflow when
converting between EMACS_INT and off_t.  When checking for
buffer overflow or for overlap, take the offsets into account.
Don't use EMACS_INT for small values where int suffices.
When checking for overlap, fix a typo: ZV was used where
ZV_BYTE was intended.
(Fwrite_region): Don't assume off_t fits into 'long'.
* buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
2011-09-02 22:23:17 -07:00
Paul Eggert
8666506ecd * src/doprnt.c (esnprintf): Remove. All uses removed.
Suggested by Chong Yidong in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9412#23>.
2011-09-01 07:44:49 -07:00
Paul Eggert
55e5faa189 Add a stub for snprintf, for ancient hosts lacking it.
* configure.in (snprintf): New check.
* nt/config.nt (HAVE_SNPRINTF): New macro.
* src/sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
2011-08-31 15:18:16 -07:00
Paul Eggert
e91caa6011 Merge from trunk. 2011-08-31 13:02:51 -07:00
Paul Eggert
61bfeeb79d Avoid the use of snprintf.
* font.c (APPEND_SNPRINTF): Remove.
(font_unparse_xlfd):
* xterm.c (x_io_error_quitter):
Use esnprintf, not snprintf.  That way, we don't have to worry
about porting to ancient platforms that lack snprintf.
(x_term_init): Use sprintf, not snprintf.
2011-08-30 22:50:49 -07:00
Paul Eggert
0999621ac5 Add Bug#. 2011-08-30 15:49:45 -07:00
Chong Yidong
51751aa26f Merge changes from emacs-23 branch 2011-08-30 18:43:43 -04:00
Chong Yidong
6e20a0d47c Fix syntax scanning bug causing fontification crashes.
* src/syntax.c (find_defun_start): Update all cache variables if
exiting early.

Fixes: debbugs:9401
2011-08-30 18:38:07 -04:00
Paul Eggert
542f2c78ac Merge from trunk. 2011-08-30 14:16:49 -07:00
Eli Zaretskii
f6cfbd8f9d src/image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings. 2011-08-30 21:15:53 +03:00
Eli Zaretskii
148ae00e30 Fix bug #9402 with :align-to on TTY frames.
src/xdisp.c (produce_stretch_glyph): No longer static, compiled also
 when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
 frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
 src/term.c (tty_append_glyph): New function.
 (produce_stretch_glyph): Static function and its prototype deleted.
 src/dispextern.h (produce_stretch_glyph, tty_append_glyph): Add
 prototypes.
2011-08-30 20:32:44 +03:00
Paul Eggert
2be7d70206 * dbusbind.c (signature_cat): New function. 2011-08-30 09:27:26 -07:00
Paul Eggert
6e1a67fbe9 * font.c, gtkutil.c: Include <float.h>. 2011-08-29 13:57:42 -07:00
Paul Eggert
1a091fbc08 Merge from trunk. 2011-08-29 13:06:52 -07:00
Paul Eggert
c43c8a6af9 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF. 2011-08-29 13:04:46 -07:00
Paul Eggert
ae58ff1fbc * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer. 2011-08-29 13:03:30 -07:00
Paul Eggert
b7163a504a * xfns.c (x_window): Make sprintf buffer a bit bigger
to avoid potential buffer overrun.
2011-08-29 12:59:51 -07:00
Paul Eggert
670741ab04 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
if X resource line is longer than 512 bytes.
2011-08-29 12:58:56 -07:00
Paul Eggert
80f2e268a3 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
to avoid potential buffer overrun.
2011-08-29 12:47:44 -07:00
Paul Eggert
31c286f79d * process.c (make_process): Use printmax_t, not int, to format
process-name gensyms.
2011-08-29 12:46:15 -07:00
Paul Eggert
aca216ff01 * print.c (float_to_string): Detect width overflow more reliably.
(print_object): Make sprintf buffer a bit bigger, to avoid potential
buffer overrun.  Don't assume list length fits in 'int'.  Treat
print length of 0 as 0, not as infinity; to be consistent with other
uses of print length in this function.  Don't overflow print length
index.  Don't assume hash table size fits in 'long', or that
vectorlike size fits in 'unsigned long'.
2011-08-29 12:14:47 -07:00
Paul Eggert
a66ff6d8b7 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
in case result does not fit in int.
2011-08-29 12:09:16 -07:00
Paul Eggert
48e3079369 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
(Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
it as a large positive number.
(Fexecute_kbd_macro): Don't assume repeat count fits in int.
* macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
2011-08-29 12:07:18 -07:00
Paul Eggert
0df02bf3e9 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
Use esprintf, not sprintf, in case result does not fit in int.
2011-08-29 11:55:58 -07:00
Paul Eggert
84722b3d57 * gtkutil.c (xg_check_special_colors, xg_set_geometry):
Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
2011-08-29 11:54:11 -07:00
Paul Eggert
8a4014344e * frame.c (tty_frame_count): Now printmax_t, not int.
(make_terminal_frame, set_term_frame_name): Print it.
(x_report_frame_params): In X, window IDs are unsigned long,
not signed long, so print them as unsigned.
(validate_x_resource_name): Check for implausibly long names,
and don't assume name length fits in 'int'.
(x_get_resource_string): Don't blindly alloca invocation name;
use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
not fit in int.
2011-08-29 11:52:26 -07:00
Paul Eggert
c57b67fcf0 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
(fontset_from_font): Print it.
2011-08-29 11:48:24 -07:00
Paul Eggert
c21721cc39 * font.c (font_unparse_xlfd): Don't blindly alloca long strings.
Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
fits in int, when using sprintf.  Use single snprintf to count
length of string rather than counting it via multiple sprintfs;
that's simpler and more reliable.
(APPEND_SPRINTF): New macro.
(font_unparse_fcname): Use it to avoid sprintf buffer overrun.
(generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
sprintf, in case result does not fit in int.
2011-08-29 11:46:42 -07:00
Paul Eggert
b5cd190546 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
2011-08-29 09:48:19 -07:00
Paul Eggert
d749b01b0c * eval.c (verror): Simplify by rewriting in terms of evxprintf,
which has the guts of the old verror function.
2011-08-29 09:01:33 -07:00
Paul Eggert
66c6fdd52e * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
when creating daemon; the previous buffer-overflow check was incorrect.
2011-08-29 08:56:20 -07:00
Paul Eggert
33ef5c6437 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
even if the time zone offset is outlandishly large.
Don't mishandle offset == INT_MIN.
2011-08-29 08:53:21 -07:00