summaryrefslogtreecommitdiff
path: root/src/region-cache.c
Commit message (Collapse)AuthorAge
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-01
|
* ; Add 2022 to copyright years.Eli Zaretskii2022-01-01
|
* Update copyright year to 2021Paul Eggert2021-01-01
| | | | Run "TZ=UTC0 admin/update-copyright".
* Update copyright year to 2020Paul Eggert2020-01-01
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Minor putc tweaksPaul Eggert2019-06-20
| | | | | | | * src/emacs-module.c (module_abort): * src/xdisp.c (vmessage): Prefer fputc to putc, since speed isn’t crucial here. * src/region-cache.c (pp_cache) [ENABLE_CHECKING]: Simplify.
* Update copyright year to 2019Paul Eggert2019-01-01
| | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* Update copyright year to 2018Paul Eggert2018-01-01
| | | | Run admin/update-copyright.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-13
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Update copyright year to 2017Paul Eggert2016-12-31
| | | | Run admin/update-copyright.
* Rework C source files to avoid ^(Paul Eggert2016-03-10
| | | | | | | | Work around Bug#22884 by rewording comments and strings to avoid ‘(’ at the start of a line unless it starts a function. This change is a short-term hack; in the longer run we plan to fix cc-mode’s performance for C files that have ‘(’ at the start of a line in a comment or string.
* Update copyright year to 2016Paul Eggert2016-01-01
| | | | Run admin/update-copyright.
* Include-file cleanup for src directoryPaul Eggert2015-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707). In a few cases, add ‘#include "foo.h"’ if the file needs foo.h but does not include it directly. As a general rule, a source file should include foo.h if it needs the interfaces that foo.h defines. * src/alloc.c: Don’t include process.h. Include dispextern.h, systime.h. * src/atimer.c: Don’t include blockinput.h. * src/buffer.c: Include coding.h, systime.h. Don’t include keyboard.h, coding.h. * src/callint.c: Don’t include commands.h, keymap.h. * src/callproc.c: Don’t include character.h, ccl.h, composite.h, systty.h, termhooks.h. * src/casetab.c: Don’t include character.h. * src/category.c: Don’t include charset.h, keymap.h. * src/ccl.h: Don’t include character.h. * src/character.c: Don’t include charset.h. * src/charset.c: Don’t include disptab.h. * src/chartab.c: Don’t include ccl.h. * src/cm.c: Don’t include frame.h, termhooks.h. * src/cmds.c: Don’t include window.h, dispextern.h. * src/coding.c: Don’t include window.h, frame.h. * src/composite.c: Include composite.h. Don’t include window.h, font.h. * src/data.c: Don’t include syssignal.h, termhooks.h, font.h. * src/dbusbind.c: Don’t include frame.h. * src/decompress.c: Don’t include character.h. * src/dired.c: Don’t include character.h, commands.h, charset.h. * src/dispnew.c: Don’t include character.h, indent.h, intervals.h, process.h, timespec.h. Include systime.h. * src/doc.c: Include coding.h. Don’t include keyboard.h. * src/editfns.c: Include composite.h. Don’t include frame.h. * src/emacs.c: Include fcntl.h, coding.h. Don’t include commands.h, systty.h.. * src/fileio.c: Don’t include intervals.h, dispextern.h. Include composite.h. * src/filelock.c: Don’t include character.h, systime.h. * src/fns.c: Don’t include time.h, commands.h, keyboard.h, keymap.h, frame.h, blockinput.h, xterm.h. Include composite.h. * src/font.c: Include termhooks.h. * src/font.h: Don’t include ccl.h, frame.h. Add forward decls of struct composition_it, struct face, struct glyph_string. * src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h, intervals.h, window.h, termhooks.h. * src/frame.c: Don’t include character.h, commands.h, font.h. * src/frame.h: Don’t include dispextern.h. * src/fringe.c: Don’t include character.h. * src/ftcrfont.c: Don’t include dispextern.h, frame.h, character.h, charset.h, fontset.h. * src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h, fontset.h. * src/ftxfont.c: Don’t include dispextern.h, character.h, charset.h, fontset.h. * src/gfilenotify.c: Don’t include frame.h, process.h. * src/gtkutil.c: Include dispextern.h, frame.h, systime.h. Don’t include syssignal.h, buffer.h, charset.h, font.h. * src/gtkutil.h: Don’t include frame.h. * src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h. Don’t include character.h. * src/indent.c: Don’t include keyboard.h, termchar.h. * src/inotify.c: Don’t include character.h, frame.h. * src/insdel.c: Include composite.h. Don’t include blockinput.h. * src/intervals.c: Don’t include character.h, keyboard.h. * src/intervals.h: Don’t include dispextern.h, composite.h. * src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h. Include coding.h. * src/keyboard.h: Don’t incldue systime.h. * src/keymap.c: Don’t include charset.h, frame.h. * src/lread.c: Include dispextern.h and systime.h. Don’t include frame.h. Include systime.h. * src/macros.c: Don’t include commands.h, character.h, buffer.h. * src/menu.c: Include character.h, coding.h. Don’t include dispextern.h. * src/menu.h: Don’t include systime.h. * src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h, intervals.h, termhooks.h. * src/print.c: Include coding.h. Don’t include keyboard.h, window.h, dispextern.h, termchar.h, termhooks.h, font.h. Add forward decl of struct terminal. * src/process.c: Don’t include termhooks.h, commands.h, dispextern.h, composite.h. * src/region-cache.c: Don’t include character.h. * src/scroll.c: Don’t include keyboard.h, window.h. * src/search.c: Don’t include category.h, commands.h. * src/sound.c: Don’t include dispextern.h. * src/syntax.c: Don’t include command.h, keymap.h. * src/sysdep.c: Don’t include window.h, dispextern.h. * src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’, * src/term.c: Don’t include systty.h, intervals.h, xterm.h. * src/terminal.c: Include character.h. Don’t include charset.h, coding.h. * src/textprop.c: Don’t include character.h. * src/undo.c: Don’t include character.h, commands.h, window.h. * src/unexsol.c: Don’t include character.h, charset.h. * src/widget.c: Include widget.h. Don’t include keyboard.h, window.h, dispextern.h, blockinput.h, character.h, font.h. * src/widgetprv.h: Don’t include widget.h. * src/window.c: Don’t include character.h, menu.h, intervals.h. * src/xdisp.c: Include composite.h, systime.h. Don’t include macros.h, process.h. * src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h, intervals.h. * src/xfns.c: Don’t include menu.h, character.h, intervals.h, epaths.h, fontset.h, systime.h, atimer.h, termchar.h. * src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h. * src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h. * src/xgselect.c: Don’t include timespec.h, frame.h. Include systime.h. * src/xgselect.h: Don’t include time.h. Use a forward decl to struct timespec instead. * src/xmenu.c: Don’t include keymap.h, character.h, charset.h, dispextern.h. Include systime.h. * src/xml.c: Don’t include character.h. * src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h. * src/xselect.c: Don’t include dispextern.h, character.h, buffer.h, process.h. * src/xsmfns.c: Don’t include systime.h, sysselect.h. * src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h, intervals.h process.h, keymap.h, xgselect.h. Include composite.h.
* Update copyright year to 2015Paul Eggert2015-01-01
| | | | Run admin/update-copyright.
* Revert previous change.Paul Eggert2014-07-26
| | | | | | | | There is certainly nothing wrong with writing code like 'lo <= i && i <= hi', even if LO happens to a constant. There isn't even anything wrong in general with writing 'a <= b' if A happens to be a constant. At any rate stylistic changes shouldn't be done like this without discussion.
* Reorder conditions that are written backwardsAndreas Schwab2014-07-26
| | | | | | | | | | | | | | | | | | | * alloc.c (xnmalloc, xnrealloc, xpalloc, make_save_value) (Fgarbage_collect): Reorder conditions that are written backwards. * data.c (cons_to_unsigned): Likewise. * dispnew.c (update_frame_1, sit_for): Likewise. * fileio.c (file_offset): Likewise. * filelock.c (read_lock_data, lock_file): Likewise. * fns.c (larger_vector, make_hash_table, Fmake_hash_table): Likewise. * font.c (font_intern_prop, font_style_symbolic): Likewise. * lisp.h (FIXNUM_OVERFLOW_P): Likewise. * lread.c (read1): Likewise. * minibuf.c (read_minibuf_noninteractive): Likewise. * nsterm.m (x_set_frame_alpha): Likewise. * process.c (wait_reading_process_output): Likewise. * region-cache.c (delete_cache_boundaries): Likewise. * xterm.c (x_set_frame_alpha): Likewise.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-01
|
* Use bool for boolean, focusing on headers.Paul Eggert2013-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (PTY_OPEN, GC_MARK_SECONDARY_STACK): Use bool for boolean. * lib-src/emacsclient.c, lib-src/etags.c, lib-src/hexl.c (FALSE, TRUE): Remove. All uses replaced with uncapitalized version. * lib-src/emacsclient.c (message): * lib-src/etags.c (make_tag, pfnote, consider_token, make_C_tag, lang_names): * lib-src/hexl.c (un_flag, iso_flag, endian): * lib-src/pop.c (pop_debug, pop_open, pop_multi_first, pop_multi_next) (pop_trash): Use bool for boolean. * lib-src/etags.c (bool): Remove. * lib-src/etags.c (globals, members, declarations, no_line_directive) (no_duplicates): Use 'int' for boolean values that getopt requires to be 'int'. Formerly, these were 'bool' and 'bool' was 'int', but we can no longer rely on this implementation. * lib-src/pop.h (struct _popserver): Use bool_bf for boolean bit-fields. * lwlib/xlwmenuP.h (XlwMenu_part): Use bool_bf for boolean bit-fields. * src/atimer.h, src/lisp.h, src/syssignal.h, src/syswait.h, src/unexelf.c: No need to include <stdbool.h>, since conf_post.h does it now. * src/buffer.h (BUF_COMPUTE_UNCHANGED, DECODE_POSITION) (BUFFER_CHECK_INDIRECTION, GET_OVERLAYS_AT, PER_BUFFER_VALUE_P) (SET_PER_BUFFER_VALUE_P): * src/ccl.c, src/ccl.h (setup_ccl_program): * src/ccl.h (CHECK_CCL_PROGRAM): * src/character.h (MAKE_CHAR_UNIBYTE, CHECK_CHARACTER_CAR) (CHECK_CHARACTER_CDR, CHAR_STRING_ADVANCE, NEXT_CHAR_BOUNDARY) (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE) (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE) (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE) (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH) (DEC_BOTH, BUF_INC_POS, BUF_DEC_POS): * src/charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID) (CHECK_CHARSET_GET_ATTR, CHECK_CHARSET_GET_CHARSET) (CHARSET_FAST_MAP_SET): * src/coding.c (decode_coding_ccl, encode_coding_ccl): * src/coding.h (CHECK_CODING_SYSTEM, CHECK_CODING_SYSTEM_GET_SPEC) (CHECK_CODING_SYSTEM_GET_ID, SJIS_TO_JIS, SJIS_TO_JIS2) (JIS_TO_SJIS, JIS_TO_SJIS2, ENCODE_FILE, DECODE_FILE) (ENCODE_SYSTEM, DECODE_SYSTEM, ENCODE_UTF_8) (decode_coding_c_string): * src/composite.h (COMPOSITION_DECODE_REFS, COMPOSITION_DECODE_RULE): * src/conf_post.h (has_attribute): * src/dispextern.h (trace_redisplay_p): (INC_TEXT_POS, DEC_TEXT_POS, SET_GLYPH_FROM_GLYPH_CODE) (SET_CHAR_GLYPH, SET_CHAR_GLYPH_FROM_GLYPH) (SET_GLYPH_FROM_CHAR_GLYPH): (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P) (FACE_SUITABLE_FOR_ASCII_CHAR_P, FACE_SUITABLE_FOR_CHAR_P) (PRODUCE_GLYPHS, reset_mouse_highlight, in_display_vector_p) (cursor_in_mouse_face_p): * src/dispnew.c (adjust_glyph_matrix, clear_glyph_matrix_rows) (blank_row, prepare_desired_row) (build_frame_matrix_from_leaf_window, make_current) (mirror_make_current, mirrored_line_dance, mirror_line_dance) (update_window, scrolling_window, update_frame_line): * src/disptab.h (GLYPH_FOLLOW_ALIASES): * src/editfns.c (Fformat): * src/font.h (FONT_WEIGHT_SYMBOLIC, FONT_SLANT_SYMBOLIC) (FONT_WIDTH_SYMBOLIC, FONT_WEIGHT_FOR_FACE, FONT_SLANT_FOR_FACE) (FONT_WIDTH_FOR_FACE, FONT_WEIGHT_NAME_NUMERIC) (FONT_SLANT_NAME_NUMERIC, FONT_WIDTH_NAME_NUMERIC) (FONT_SET_STYLE, CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY) (CHECK_FONT_OBJECT, CHECK_FONT_GET_OBJECT, FONT_ADD_LOG) (FONT_DEFERRED_LOG): * src/frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_WINDOW_P): (FRAME_EXTERNAL_TOOL_BAR, FRAME_EXTERNAL_MENU_BAR, FOR_EACH_FRAME) (FRAME_MOUSE_UPDATE): * src/fringe.c (Fdefine_fringe_bitmap): * src/image.c (x_create_bitmap_from_data, x_create_bitmap_mask) (x_create_bitmap_from_xpm_data, xpm_load_image): * src/intervals.h (INTERVAL_HAS_PARENT, INTERVAL_PARENT) (set_interval_parent, RESET_INTERVAL, COPY_INTERVAL_CACHE) (MERGE_INTERVAL_CACHE): * src/keymap.h (KEYMAPP): * src/lisp.h (eassert, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE) (STRING_SET_UNIBYTE, STRING_SET_MULTIBYTE, DEFSYM, PSEUDOVECTORP) (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER) (CHECK_NUMBER_COERCE_MARKER, CHECK_NUMBER_OR_FLOAT_COERCE_MARKER) (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT) (DEFVAR_BUFFER_DEFAULTS, DEFVAR_KBOARD, QUIT) (RETURN_UNGCPRO, USE_SAFE_ALLOCA, SAFE_NALLOCA, SAFE_FREE) (SAFE_ALLOCA_LISP, FOR_EACH_ALIST_VALUE, functionp): * src/syntax.h (SYNTAX_ENTRY, SYNTAX_WITH_FLAGS, SYNTAX) (UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD) (SETUP_BUFFER_SYNTAX_TABLE): * src/systime.h (timespec_valid_p): * src/term.c (save_and_enable_current_matrix): * src/window.h (WINDOW_MENU_BAR_P, WINDOW_TOOL_BAR_P): * src/xdisp.c (in_display_vector_p, display_tool_bar_line) (redisplay_internal, try_window_reusing_current_matrix) (sync_frame_with_window_matrix_rows, try_window_id) (display_menu_bar, display_tty_menu_item, display_mode_line) (coords_in_mouse_face_p, cursor_in_mouse_face_p): * src/xmenu.c (xmenu_show): * src/xterm.c (use_xim, x_term_init): * src/xterm.h (XSync, GTK_CHECK_VERSION, use_xim, SET_SCROLL_BAR_X_WIDGET) (struct x_bitmap_record): Use bool for booleans. * src/ccl.c (struct buffer_text): * src/ccl.h (struct ccl_program): * src/charset.h (struct charset): * src/cm.h (struct cm): * src/coding.h (struct iso_2022_spec, struct coding_system): * src/dispextern.h (struct glyph, struct glyph_matrix, struct glyph_row) (struct glyph_string, struct face, struct face_cache) (struct bidi_string_data, struct bidi_it) (struct draw_fringe_bitmap_params, struct it, Mouse_HLInfo) (struct image): * src/editfns.c (Fformat): * src/frame.h (struct frame): * src/fringe.c (struct fringe_bitmap): * src/intervals.h (struct interval): * src/keyboard.h (struct kboard): * src/lisp.h (struct Lisp_Symbol, struct Lisp_Misc_Any, struct Lisp_Marker) (struct Lisp_Overlay, struct Lisp_Save_Value, struct Lisp_Free) (struct Lisp_Buffer_Local_Value, union specbinding): * src/macfont.m (struct macfont_info): * src/process.h (struct Lisp_Process): * src/termchar.h (struct tty_display_info): * src/window.h (struct window): * src/xterm.h (struct x_output): Use bool_bf for boolean bit-fields. * src/ccl.c (setup_ccl_program): Now returns bool instead of -1 or 0. All callers changed. * src/ccl.h (struct ccl_program): Remove unused members private_state, src_multibyte, dst_multibyte, cr_consumed, suppress_error, eight_bit_control. (struct ccl_spec): Remove unused members cr_carryover, eight_bit_carryover. * src/conf_post.h: Include <stdbool.h>. (bool_bf): New type. * src/dispextern.h (TRACE, PREPARE_FACE_FOR_DISPLAY): * src/interval.h (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE) Surround statement macro with proper 'do { ... } while (false)' brackets. (SET_MATRIX_ROW_ENABLED_P): Assume 2nd arg is bool. (PRODUCE_GLYPHS): Simplify use of boolean. * src/fileio.c (Fcopy_file): If I is an integer, prefer 'if (I != 0)' to 'if (I)'. * src/lisp.h (UNGCPRO): Return void, not int. (FOR_EACH_TAIL): Use void expression, not int expression. * src/region-cache.c: Reindent. * src/region-cache.h: Copy comments from region-cache.c, to fix incorrect remarks about booleans.
* * region-cache.c (find_cache_boundary, move_cache_gap)Dmitry Antipov2013-03-15
| | | | | | (insert_cache_boundary, delete_cache_boundaries, set_cache_region): Simplify debugging check and convert to eassert. Adjust comment. (pp_cache): Put under ENABLE_CHECKING.
* region-cache.c, scroll.c, search.c: Use bool for booleans.Paul Eggert2013-03-08
| | | | | | | | | | | | * lisp.h (compile_pattern): * scroll.c (do_scrolling, do_direct_scrolling): * search.c (struct regexp_cache, compile_pattern_1) (compile_pattern, string_match_1, search_command) (trivial_regexp_p, search_buffer, Freplace_match, match_limit) (search_regs_saved, Fregexp_quote): Use bool for boolean. * region-cache.c (region_cache_forward, region_cache_backward): Fix comments to match code: these functions return int, not boolean.
* Update copyright notices for 2013.Paul Eggert2013-01-01
|
* Port better to POSIX hosts lacking _setjmp.Paul Eggert2012-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols. (_setjmp, _longjmp): Remove. * src/lisp.h: Include <setjmp.h> here, since we use its symbols here. All instances of '#include <setjmp.h>' removed, if the only reason for the instance was because "lisp.h" was included. (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols. Unless otherwise specified, replace all uses of jmp_buf, _setjmp, and _longjmp with the new symbols. Emacs already uses _setjmp if available, so this change affects only POSIXish hosts that have sigsetjmp but not _setjmp, such as some versions of Solaris and Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.) * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros. (png_load_body) [HAVE_PNG]: (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]: (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]: Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp, since PNG requires jmp_buf. This is the only exception to the general rule that we now use sys_setjmp and sys_longjmp. This exception is OK since this code does not change the signal mask or longjmp out of a signal handler. Fixes: debbugs:12446
* Simplify redefinition of 'abort' (Bug#12316).Paul Eggert2012-09-04
| | | | | | | | | | | | | | | | | | | | | | Do not try to redefine the 'abort' function. Instead, redo the code so that it calls 'emacs_abort' rather than 'abort'. This removes the need for the NO_ABORT configure-time macro and makes it easier to change the abort code to do a backtrace. * configure.ac (NO_ABRT): Remove. * admin/CPP-DEFINES (NO_ABORT): Remove. * nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove. * src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort. * src/emacs.c (abort) [!DOS_NT && !NO_ABORT]: Remove; sysdep.c's emacs_abort now takes its place. * src/lisp.h (emacs_abort): New decl. All calls from Emacs code to 'abort' changed to use 'emacs_abort'. * src/msdos.c (dos_abort) [defined abort]: Remove; not used. (abort) [!defined abort]: Rename to ... (emacs_abort): ... new name. * src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking the place of the old 'abort' in emacs.c. * src/w32.c, src/w32fns.c (abort): Do not #undef. * src/w32.c (emacs_abort): Rename from w32_abort.
* Fix bug #12196 with incorrect memory allocations for region-cache.Eli Zaretskii2012-08-15
| | | | | src/region-cache.c (move_cache_gap): Update gap_len using the actual growth of the boundaries array. Do not change cache_len.
* More xmalloc and related cleanup.Paul Eggert2012-07-05
| | | | | | | | | | | | | | | | | | | | | | | | * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c: * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c: * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c: * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c: * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c: * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c: * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c: * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c: * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c: * xterm.c: Omit needless casts involving void * pointers and allocation. Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))", as the former is more robust if P's type is changed. Prefer xzalloc to xmalloc + memset 0. Simplify malloc-or-realloc to realloc. Don't worry about xmalloc returning a null pointer. Prefer xstrdup to xmalloc + strcpy. * editfns.c (Fmessage_box): Grow message_text by at least 80 when growing it. * keyboard.c (apply_modifiers_uncached): Prefer local array to alloca of a constant.
* Cleanup xmalloc.Dmitry Antipov2012-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/coccinelle/xzalloc.cocci: Semantic patch to convert calls to xmalloc with following memset to xzalloc. * src/lisp.h (xzalloc): New prototype. Omit needless casts. * src/alloc.c (xzalloc): New function. Omit needless casts. * src/charset.c: Omit needless casts. Convert all calls to malloc with following memset to xzalloc. * src/dispnew.c: Likewise. * src/fringe.c: Likewise. * src/image.c: Likewise. * src/sound.c: Likewise. * src/term.c: Likewise. * src/w32fns.c: Likewise. * src/w32font.c: Likewise. * src/w32term.c: Likewise. * src/xfaces.c: Likewise. * src/xfns.c: Likewise. * src/xterm.c: Likewise. * src/atimer.c: Omit needless casts. * src/buffer.c: Likewise. * src/callproc.c: Likewise. * src/ccl.c: Likewise. * src/coding.c: Likewise. * src/composite.c: Likewise. * src/doc.c: Likewise. * src/doprnt.c: Likewise. * src/editfns.c: Likewise. * src/emacs.c: Likewise. * src/eval.c: Likewise. * src/filelock.c: Likewise. * src/fns.c: Likewise. * src/gtkutil.c: Likewise. * src/keyboard.c: Likewise. * src/lisp.h: Likewise. * src/lread.c: Likewise. * src/minibuf.c: Likewise. * src/msdos.c: Likewise. * src/print.c: Likewise. * src/process.c: Likewise. * src/region-cache.c: Likewise. * src/search.c: Likewise. * src/sysdep.c: Likewise. * src/termcap.c: Likewise. * src/terminal.c: Likewise. * src/tparam.c: Likewise. * src/w16select.c: Likewise. * src/w32.c: Likewise. * src/w32reg.c: Likewise. * src/w32select.c: Likewise. * src/w32uniscribe.c: Likewise. * src/widget.c: Likewise. * src/xdisp.c: Likewise. * src/xmenu.c: Likewise. * src/xrdb.c: Likewise. * src/xselect.c: Likewise.
* * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.Andreas Schwab2012-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (BUF_FETCH_MULTIBYTE_CHAR): Likewise. * character.c (_fetch_multibyte_char_p): Remove. * alloc.c: Include "character.h" before "buffer.h". * bidi.c: Likewise. * buffer.c: Likewise. * bytecode.c: Likewise. * callint.c: Likewise. * callproc.c: Likewise. * casefiddle.c: Likewise. * casetab.c: Likewise. * category.c: Likewise. * cmds.c: Likewise. * coding.c: Likewise. * composite.c: Likewise. * dired.c: Likewise. * dispnew.c: Likewise. * doc.c: Likewise. * dosfns.c: Likewise. * editfns.c: Likewise. * emacs.c: Likewise. * fileio.c: Likewise. * filelock.c: Likewise. * font.c: Likewise. * fontset.c: Likewise. * fringe.c: Likewise. * indent.c: Likewise. * insdel.c: Likewise. * intervals.c: Likewise. * keyboard.c: Likewise. * keymap.c: Likewise. * lread.c: Likewise. * macros.c: Likewise. * marker.c: Likewise. * minibuf.c: Likewise. * nsfns.m: Likewise. * nsmenu.m: Likewise. * print.c: Likewise. * process.c: Likewise. * regex.c: Likewise. * region-cache.c: Likewise. * search.c: Likewise. * syntax.c: Likewise. * term.c: Likewise. * textprop.c: Likewise. * undo.c: Likewise. * unexsol.c: Likewise. * w16select.c: Likewise. * w32fns.c: Likewise. * w32menu.c: Likewise. * window.c: Likewise. * xdisp.c: Likewise. * xfns.c: Likewise. * xmenu.c: Likewise. * xml.c: Likewise. * xselect.c: Likewise.
* Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-05
|
* Spelling fixes.Paul Eggert2011-12-11
|
* Adjust in response to jan.h.d's comments.Paul Eggert2011-08-04
| | | | See, for example <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#26>.
* * region-cache.c (move_cache_gap): Check for size calculation overflow.Paul Eggert2011-07-28
|
* Replace pEd with more-general pI, and fix some printf arg casts.Paul Eggert2011-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Don't publish debugger-only interfaces to other modules.Paul Eggert2011-04-13
| | | | | | | | | * lisp.h (safe_debug_print, debug_output_compilation_hack): (verify_bytepos, count_markers): Move decls to the only modules that need them. * region-cache.h (pp_cache): Likewise. * window.h (check_all_windows): Likewise. * marker.c, print.c, region-cache.c, window.c: Decls moved here.
* * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.Paul Eggert2011-03-17
|
* Refill some long/short copyright headers.Glenn Morris2011-01-26
|
* Convert consecutive FSF copyright years to ranges.Glenn Morris2011-01-24
|
* Nuke arch-tags.Glenn Morris2011-01-15
|
* Merge from emacs-23Stefan Monnier2011-01-14
|\
| * Add 2011 to FSF/AIST copyright years.Glenn Morris2011-01-02
| |
* | Fix int/EMACS_INT in eval.c and indent.c, correct previous changes.Eli Zaretskii2010-09-24
| | | | | | | | | | | | | | | | | | | | | | | | indent.c (Fcurrent_indentation, indented_beyond_p) (compute_motion): Use EMACS_INT for buffer position variables. lisp.h (indented_beyond_p): Adjust prototype. buffer.c (overlay_strings): Return EMACS_INT. buffer.h (overlay_strings): Adjust prototype. region-cache.c (pp_cache): Adjust format to arguments. eval.c <specpdl_size, lisp_eval_depth>: Declare EMACS_INT. (call_debugger): Use EMACS_INT for specpdl_size related variables. (verror): Use EMACS_INT for size of allocated buffer.
* | Fix EMACS_INT/int conversion in region-cache.c.Lars Magne Ingebrigtsen2010-09-24
| |
* | Fix use of int instead of EMACS_INT in search.c and region-cache.c.Eli Zaretskii2010-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | indent.c (compute_motion): Use EMACS_INT for arguments to region_cache_forward. region-cache.c (struct boundary, struct region_cache): Use EMACS_INT for positions. (find_cache_boundary, move_cache_gap, insert_cache_boundary) (delete_cache_boundaries, set_cache_region) (invalidate_region_cache, know_region_cache) (region_cache_forward, region_cache_backward, pp_cache): Use EMACS_INT for buffer positions. region-cache.h (know_region_cache, invalidate_region_cache) (region_cache_forward, region_cache_backward): Adjust prototypes. search.c (string_match_1, fast_c_string_match_ignore_case) (looking_at_1, scan_buffer, scan_newline) (find_next_newline_no_quit, find_before_next_newline) (search_command, trivial_regexp_p, search_buffer, simple_search) (boyer_moore, wordify, Freplace_match): Use EMACS_INT for buffer and string positions and length. lisp.h (scan_buffer, scan_newline, find_next_newline_no_quit) (find_before_next_newline): Adjust prototypes.
* | Convert (most) functions in src to standard C.Dan Nicolaescu2010-07-04
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c: Convert function definitions to standard C. * src/atimer.c: * src/bidi.c: * src/bytecode.c: * src/callint.c: * src/callproc.c: * src/casefiddle.c: * src/casetab.c: * src/category.c: * src/ccl.c: * src/character.c: * src/charset.c: * src/chartab.c: * src/cmds.c: * src/coding.c: * src/composite.c: * src/data.c: * src/dbusbind.c: * src/dired.c: * src/dispnew.c: * src/doc.c: * src/doprnt.c: * src/ecrt0.c: * src/editfns.c: * src/fileio.c: * src/filelock.c: * src/filemode.c: * src/fns.c: * src/font.c: * src/fontset.c: * src/frame.c: * src/fringe.c: * src/ftfont.c: * src/ftxfont.c: * src/gtkutil.c: * src/indent.c: * src/insdel.c: * src/intervals.c: * src/keymap.c: * src/lread.c: * src/macros.c: * src/marker.c: * src/md5.c: * src/menu.c: * src/minibuf.c: * src/prefix-args.c: * src/print.c: * src/ralloc.c: * src/regex.c: * src/region-cache.c: * src/scroll.c: * src/search.c: * src/sound.c: * src/strftime.c: * src/syntax.c: * src/sysdep.c: * src/termcap.c: * src/terminal.c: * src/terminfo.c: * src/textprop.c: * src/tparam.c: * src/undo.c: * src/unexelf.c: * src/window.c: * src/xfaces.c: * src/xfns.c: * src/xfont.c: * src/xftfont.c: * src/xgselect.c: * src/xmenu.c: * src/xrdb.c: * src/xselect.c: * src/xsettings.c: * src/xsmfns.c: * src/xterm.c: Likewise.
* Add 2010 to copyright years.Glenn Morris2010-01-13
|
* * alloc.c: Do not define struct catchtag.Dan Nicolaescu2009-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * eval.c: Move struct catchtag definition ... * lisp.h: ... here. * image.c: Move png.h #include earlier to avoid warnings. * xterm.c: * xsmfns.c: * xselect.c: * xrdb.c: * xmenu.c: * xftfont.c: * xfont.c: * xfns.c: * xfaces.c: * xdisp.c: * window.c: * widget.c: * w32xfns.c: * w32uniscribe.c: * w32term.c: * w32select.c: * w32reg.c: * w32proc.c: * w32menu.c: * w32inevt.c: * w32heap.c: * w32font.c: * w32fns.c: * w32console.c: * w32.c: * w16select.c: * vm-limit.c: * unexsol.c: * unexec.c: * unexcw.c: * unexaix.c: * undo.c: * tparam.c: * textprop.c: * terminfo.c: * terminal.c: * termcap.c: * term.c: * syntax.c: * sound.c: * sheap.c: * search.c: * scroll.c: * region-cache.c: * regex.c: * ralloc.c: * process.c: * print.c: * msdos.c: * minibuf.c: * menu.c: * marker.c: * macros.c: * keymap.c: * keyboard.c: * intervals.c: * insdel.c: * indent.c: * gtkutil.c: * ftxfont.c: * ftfont.c: * fringe.c: * frame.c: * fontset.c: * font.c: * fns.c: * floatfns.c: * filelock.c: * fileio.c: * emacs.c: * editfns.c: * dosfns.c: * doprnt.c: * doc.c: * dispnew.c: * dired.c: * dbusbind.c: * data.c: * composite.c: * coding.c: * cmds.c: * cm.c: * chartab.c: * charset.c: * character.c: * ccl.c: * category.c: * casetab.c: * casefiddle.c: * callproc.c: * callint.c: * bytecode.c: * buffer.c: * atimer.c: Include setjmp.h. (Bug#4643) * xlwmenu.c: * lwlib.c: * lwlib-utils.c: * lwlib-Xm.c: * lwlib-Xlw.c: * lwlib-Xaw.c: Include setjmp.h.
* Add 2009 to copyright years.Glenn Morris2009-01-08
|
* Switch to recommended form of GPLv3 permissions notice.Glenn Morris2008-05-14
|
* Add 2008 to copyright years.Glenn Morris2008-01-08
|
* Switch license to GPLv3 or later.Glenn Morris2007-07-25
|
* Update copyright for years from Emacs 21 to present (mainly addingGlenn Morris2007-01-14
| | | | 2001).
* Update years in copyright notice; nfc.Thien-Thi Nguyen2006-02-06
|