1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00
Commit Graph

100059 Commits

Author SHA1 Message Date
Paul Eggert
a8a2bb29e2 * Makefile.in (GNULIB_MODULES): Add strtoumax. 2011-04-21 12:12:13 -07:00
Paul Eggert
d78050d6ba * lread.c (string_to_number): Use strtoumax, to convert more integers without overflow. 2011-04-21 11:57:37 -07:00
Paul Eggert
452f415013 Treat large integers as floats in the Lisp reader and in string-to-number. 2011-04-20 23:03:09 -07:00
Paul Eggert
6703b2e490 Remove stray comment. 2011-04-20 02:22:06 -07:00
Paul Eggert
67769ffc6f * textprop.c (set_text_properties_1): Rewrite for clarity,
and to avoid GCC warning about integer overflow.
2011-04-20 01:38:11 -07:00
Paul Eggert
37aa2f8525 * intervals.c (offset_intervals): Tell GCC not to worry about length overflow
when negating a negative length.
2011-04-20 01:30:52 -07:00
Paul Eggert
c20db43fef * intervals.h (struct interval): Use EMACS_INT for members
where EMACS_UINT might cause problems.  See
<http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
(CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
* intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
All uses changed.
2011-04-20 01:04:17 -07:00
Paul Eggert
2538aa2f5f * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
(overrun_check_free): Likewise.
2011-04-20 00:11:43 -07:00
Paul Eggert
997bfc6580 Merge from mainline. 2011-04-19 23:27:19 -07:00
Paul Eggert
b8e30af5f6 Merge: Make the Lisp reader and string-to-float more consistent. 2011-04-19 23:26:24 -07:00
Paul Eggert
8b9587d73b Make the Lisp reader and string-to-float more consistent.
* data.c (atof): Remove decl; no longer used or needed.
(Fstring_to_number): Use new string_to_float function, to be
consistent with how the Lisp reader treats infinities and NaNs.
Do not assume that floating-point numbers represent EMACS_INT
without losing information; this is not true on most 64-bit hosts.
Avoid double-rounding errors, by insisting on integers when
parsing non-base-10 numbers, as the documentation specifies.
Report integer overflow instead of silently converting to
integers.
* lisp.h (string_to_float): New decl, replacing ...
(isfloat_string): Remove.
* lread.c (read1): Do not accept +. and -. as integers; this
appears to have been a coding error.  Similarly, do not accept
strings like +-1e0 as floating point numbers.  Do not report
overflow for some integer overflows and not others; instead,
report them all.  Break out the floating-point parsing into a new
function string_to_float, so that Fstring_to_number parses
floating point numbers consistently with the Lisp reader.
(string_to_float): New function, replacing isfloat_string.
This function checks for valid syntax and produces the resulting
Lisp float number too.
2011-04-19 23:24:51 -07:00
Ken Brown
fe0e7ad718 * configure.in (use_mmap_for_buffers): Set to yes on Cygwin. 2011-04-19 22:18:13 -04:00
Glenn Morris
f195c582d8 solar.el fixes.
* lisp/calendar/solar.el (solar-horizontal-coordinates):
Use the longitude argument rather than `calendar-longitude' (15yr old bug).
(solar-date-next-longitude): Remove unused locals.
2011-04-19 19:09:06 -07:00
Katsumi Yamaoka
6b1f6ce90e gnus-registry.el (gnus-registry-action, gnus-registry-fetch-header-fast):
Don't use mail-header that looks an internal function of mailheader.el.
2011-04-20 00:43:48 +00:00
Paul Eggert
f2d3008d3c * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
word size.
2011-04-19 12:10:31 -07:00
Stefan Monnier
602ea69dc7 * lisp/progmodes/octave-mod.el (octave-in-comment-p, octave-in-string-p)
(octave-not-in-string-or-comment-p): Use syntax-ppss so it works with
multi-line comments as well.
2011-04-19 12:33:34 -03:00
Paul Eggert
0a20c80c9c Merge from mainline. 2011-04-19 07:46:13 -07:00
Juanma Barranquero
06b605171f lisp/*.el: Lexical-binding cleanup. 2011-04-19 15:44:55 +02:00
Eli Zaretskii
04c569546a Support buffers > 2GB on 64-bit hosts.
src/insdel.c (make_gap_larger): Remove limitation of buffer size
 to <= INT_MAX.
 src/syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
 gl_state.e_property when gl_state.object is Qt.
2011-04-19 13:48:30 +03:00
Paul Eggert
ec8df74431 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
(gnutls_make_error): Rename local to avoid shadowing.
(gnutls_emacs_global_deinit): ifdef out; not used.
(Fgnutls_boot): Use const for pointer to readonly storage.
Comment out unused local.  Fix pointer signedness problems.
2011-04-19 00:45:48 -07:00
Paul Eggert
640ee02d54 * lread.c (openp): Don't stuff size_t into an 'int'.
Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
about possible signed overflow.
2011-04-19 00:22:13 -07:00
Paul Eggert
6048fb2a5a * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
(GDK_KEY_g): Don't define if already defined.
(xg_prepare_tooltip): Avoid pointer signedness problem.
(xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
2011-04-19 00:10:55 -07:00
Paul Eggert
6f04d1261b Avoid 0 flag with %p printf format. 2011-04-18 23:52:00 -07:00
Paul Eggert
4ef23ecf04 Merge from mainline. 2011-04-18 23:44:06 -07:00
Paul Eggert
fa3c87e1f2 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
2011-04-18 23:42:12 -07:00
Paul Eggert
2172544bcd * xfns.c (Fx_window_property): Simplify a bit,
to make a bit faster and to avoid GCC 4.6.0 warning.
* xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
2011-04-18 23:34:43 -07:00
Glenn Morris
bc4f7f3d58 calendar housekeeping prompted by lexical-binding.
* lisp/calendar/appt.el (appt-make-list):
* lisp/calendar/cal-china.el (calendar-chinese-date-string):
* lisp/calendar/cal-hebrew.el (calendar-hebrew-list-yahrzeits)
(diary-hebrew-yahrzeit):
* lisp/calendar/cal-tex.el (cal-tex-last-blank-p, cal-tex-cursor-week2):
* lisp/calendar/calendar.el (calendar-generate-window):
* lisp/calendar/time-date.el (time-to-days):
Remove unused local variables.

* lisp/calendar/cal-dst.el (dst-adjust-time): Remove never-implemented
optional argument `style'.

* lisp/calendar/cal-tex.el (cal-tex-list-holidays, cal-tex-cursor-month)
(cal-tex-cursor-week, cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week)
(cal-tex-cursor-filofax-daily, cal-tex-mini-calendar)
* lisp/calendar/cal-html.el (cal-html-insert-minical):
* lisp/calendar/diary-lib.el (diary-list-entries-1, diary-list-entries)
(calendar-mark-date-pattern):
Prefix "unused" locals.
2011-04-18 21:11:01 -07:00
Paul Eggert
e50d64ebfa Remove blank line. 2011-04-18 18:15:59 -07:00
Paul Eggert
9b821a2194 * fns.c (internal_equal): Don't assume size_t fits in int. 2011-04-18 18:11:43 -07:00
Paul Eggert
3c616cfa13 * alloc.c (compact_small_strings): Tighten assertion a little. 2011-04-18 17:42:41 -07:00
Paul Eggert
c2982e87d3 Replace pEd with more-general pI, and fix some printf arg casts.
* lisp.h (pI): New macro, generalizing old pEd macro to other
conversion specifiers.  For example, use "...%"pI"d..." rather
than "...%"pEd"...".
(pEd): Remove.  All uses replaced with similar uses of pI.
* src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
* alloc.c (check_pure_size): Don't overflow by converting size to int.
* bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
* data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
* dbusbind.c (xd_append_arg): Use pI to avoid cast.
(Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
* font.c (font_unparse_xlfd): Avoid potential buffer overrun on
64-bit hosts.
(font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
* keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
* print.c (safe_debug_print, print_object): Likewise.
(print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
to int.
Use pI instead of if-then-else-abort.  Use %p to avoid casts.
* process.c (Fmake_network_process): Use pI to avoid cast.
* region-cache.c (pp_cache): Likewise.
* xdisp.c (decode_mode_spec): Likewise.
* xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
behavior on 64-bit hosts with printf arg.
* xselect.c (x_queue_event): Use %p to avoid casts.
(x_stop_queuing_selection_requests): Likewise.
(x_get_window_property): Don't truncate byte count to an 'int'
when tracing.
2011-04-18 17:34:42 -07:00
Paul Eggert
5e073ec738 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
here, since it parses constructs like leading '-' and spaces,
which are not wanted; and it overflows with large numbers.
Instead, simply match F[0-9]+, which is what is wanted anyway.
2011-04-18 16:32:38 -07:00
Chong Yidong
16a43933e8 Allow glyphless-char-display to distinguish between X and text terminals.
Use this for Tabulated List mode.

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode): Use a custom
glyphless-char-display table.
(tabulated-list-glyphless-char-display): New var.

* src/term.c (produce_glyphless_glyph): Handle cons cell entry in
glyphless-char-display.

* src/xdisp.c (lookup_glyphless_char_display)
(produce_glyphless_glyph): Handle cons cell entry in
glyphless-char-display.
(Vglyphless_char_display): Document it.
2011-04-18 19:21:31 -04:00
Katsumi Yamaoka
8d6d9c8f8d gnus-registry.el, registry.el: Silence the byte compiler.
gnus-registry.el: Eliminate cl functions.
 (gnus-registry-sort-addresses): New function that replaces mapcan.
 (gnus-registry-action, gnus-registry-spool-action)
 (gnus-registry-split-fancy-with-parent)
 (gnus-registry-fetch-recipients-fast): Use it.
 (gnus-registry-import-eld): Replace delete* with dolist + delq.
registry.el (initialize-instance, registry-lookup)
 (registry-lookup-breaks-before-lexbind, registry-lookup-secondary)
 (registry-lookup-secondary-value, registry-search, registry-delete)
 (registry-insert, registry-reindex, registry-size, registry-prune):
 Use eval-and-compile.
2011-04-18 22:59:02 +00:00
Sam Steingold
7eed1860d8 * lisp/vc/add-log.el (change-log-font-lock-keywords): Add "Thanks to" to acknowledgments. 2011-04-18 16:35:18 -04:00
Glenn Morris
ca36e0ff83 Auto-commit of generated files. 2011-04-18 06:17:49 -04:00
Paul Eggert
d0f4e1f5ac * alloc.c (check_sblock, check_string_bytes, check_string_free_list): Protoize. 2011-04-17 21:45:15 -07:00
Paul Eggert
36372bf93f * alloc.c: Remove unportable assumptions about struct layout.
(SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
(SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
(allocate_vectorlike, make_pure_vector): Use the new macros,
plus offsetof, to remove unportable assumptions about struct layout.
These assumptions hold on all porting targets that I know of, but
they are not guaranteed, they're easy to remove, and removing them
makes further changes easier.
2011-04-17 21:41:29 -07:00
Paul Eggert
c7bda33cad * alloc.c (allocate_buffer): Don't assume sizeof (struct buffer) is a
multiple of sizeof (EMACS_INT); it need not be, if
alignof(EMACS_INT) < sizeof (EMACS_INT).
2011-04-17 21:25:27 -07:00
Paul Eggert
000098c135 * alloc.c (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
can cause Emacs to crash when string overrun checking is enabled.
2011-04-17 21:16:47 -07:00
Paul Eggert
bfd1c7811d * alloc.c (string_overrun_cookie): Now const. Use initializers that
don't formally overflow signed char, to avoid warnings.
2011-04-17 21:13:51 -07:00
Paul Eggert
83998b7a92 Fix typo in comment. 2011-04-17 21:11:56 -07:00
Paul Eggert
0b432f213c * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
This doesn't fix a bug but makes the code clearer.
2011-04-17 21:08:35 -07:00
Paul Eggert
cc2e7b46b8 Merge from gnulib. 2011-04-17 21:03:18 -07:00
Chong Yidong
4581706e27 Minor redisplay cleanups.
* src/dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
definition for no-X builds.

* src/termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.

* src/xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
2011-04-17 14:40:55 -04:00
Glenn Morris
14964899b3 * etc/CONTRIBUTE: Recommend bug-gnu-emacs for patches. 2011-04-16 19:30:56 -07:00
Glenn Morris
4d2d1ccdbb Replace stack-trace-on-error usage in calendar.
* lisp/calendar/diary-lib.el (diary-sexp-entry):
* lisp/calendar/holidays.el (holiday-sexp):
Set debug-on-error rather than the removed stack-trace-on-error.
2011-04-16 19:11:49 -07:00
Glenn Morris
61c2b50edd ChangeLog fix. 2011-04-16 16:31:57 -07:00
Glenn Morris
239da61d98 Use lexcical-binding in f90.el.
* lisp/progmodes/f90.el: Use lexical-binding.  Use utf-8 coding.
(f90-get-correct-indent): Remove unnecessary local variable `cont'.
2011-04-16 16:30:15 -07:00
Paul Eggert
fd35b6f967 Static checks with GCC 4.6.0 and non-default toolkits. 2011-04-16 16:11:35 -07:00