1. 06 Jun, 2011 6 commits
    • Paul Eggert's avatar
      Check for overflow when converting integer to cons and back. · be44ca6c
      Paul Eggert authored
      * charset.c (Fdefine_charset_internal, Fdecode_char):
      Use cons_to_unsigned to catch overflow.
      (Fencode_char): Use INTEGER_TO_CONS.
      * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
      (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
      * data.c (long_to_cons, cons_to_long): Remove.
      (cons_to_unsigned, cons_to_signed): New functions.
      These signal an error for invalid or out-of-range values.
      * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
      * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
      * font.c (Ffont_variation_glyphs):
      * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
      * lisp.h: Include <intprops.h>.
      (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
      (cons_to_signed, cons_to_unsigned): New decls.
      (long_to_cons, cons_to_long): Remove decls.
      * undo.c (record_first_change): Use INTEGER_TO_CONS.
      (Fprimitive_undo): Use CONS_TO_INTEGER.
      * xfns.c (Fx_window_property): Likewise.
      * xselect.c: Include <limits.h>.
      (x_own_selection, selection_data_to_lisp_data):
      Use INTEGER_TO_CONS.
      (x_handle_selection_request, x_handle_selection_clear)
      (x_get_foreign_selection, Fx_disown_selection_internal)
      (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
      (lisp_data_to_selection_data): Use cons_to_unsigned.
      (x_fill_property_data): Use cons_to_signed.
      Report values out of range.
      be44ca6c
    • Paul Eggert's avatar
      Check for buffer and string overflow more precisely. · d1f3d2af
      Paul Eggert authored
      * buffer.h (BUF_BYTES_MAX): New macro.
      * lisp.h (STRING_BYTES_MAX): New macro.
      * alloc.c (Fmake_string):
      * character.c (string_escape_byte8):
      * coding.c (coding_alloc_by_realloc):
      * doprnt.c (doprnt):
      * editfns.c (Fformat):
      * eval.c (verror):
      Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
      since they may not be the same number.
      * editfns.c (Finsert_char):
      * fileio.c (Finsert_file_contents):
      Likewise for BUF_BYTES_MAX.
      d1f3d2af
    • Paul Eggert's avatar
      * image.c: Use ptrdiff_t, not int, for sizes. · dd52fcea
      Paul Eggert authored
      (slurp_file): Switch from int to ptrdiff_t.
      All uses changed.
      (slurp_file): Check that file size fits in both size_t (for
      malloc) and ptrdiff_t (for sanity and safety).
      dd52fcea
    • Paul Eggert's avatar
      * fileio.c (Fverify_visited_file_modtime): Avoid time overflow · 7f9bbdbb
      Paul Eggert authored
      if b->modtime has its maximal value.
      7f9bbdbb
    • Paul Eggert's avatar
    • Paul Eggert's avatar
      * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacO). · 4d09bcf6
      Paul Eggert authored
      Fixes: debbugs:8800
      4d09bcf6
  2. 05 Jun, 2011 5 commits
  3. 04 Jun, 2011 3 commits
  4. 03 Jun, 2011 1 commit
  5. 02 Jun, 2011 4 commits
  6. 01 Jun, 2011 5 commits
    • Dan Nicolaescu's avatar
      Make it possible to build with GCC-4.6+ -O2 -flto. · 698d32e2
      Dan Nicolaescu authored
      * src/emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
      698d32e2
    • Stefan Monnier's avatar
      * lisp/minibuffer.el (minibuffer-inactive-mode-map): New var. · fd6fa53f
      Stefan Monnier authored
      (minibuffer-inactive-mode): New major mode.
      * src/minibuf.c (get_minibuffer, read_minibuf_unwind): Call it.
      * lisp/mouse.el (mouse-drag-region): Remove the "mouse-1 pops up
      the *Messages* buffer" hack.
      (mouse-popup-menubar): Don't burp if the event is a normal key.
      fd6fa53f
    • Stefan Monnier's avatar
      Miscellaneous tweaks. · 2462470b
      Stefan Monnier authored
      * lisp/emacs-lisp/cl-macs.el (dolist, dotimes): Use the same strategy for
      lexical scoping as in subr.el's dolist and dotimes.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-unfold-bcf):
      Silence compiler warning.
      * lisp/thingatpt.el (forward-whitespace): Trivial coding style fix.
      * lisp/subr.el (with-output-to-temp-buffer): Provide an edebug spec.
      * lisp/international/ccl.el (ccl-compile): Trivial simplification.
      * lisp/help-fns.el (help-do-arg-highlight): Silence compiler warning.
      * lisp/emacs-lisp/testcover.el (testcover-end): Remove spurious
      `printflag' argument.
      * lisp/emacs-lisp/byte-run.el (make-obsolete, make-obsolete-variable):
      Purecopy the whole obsolescence data.
      2462470b
    • Paul Eggert's avatar
      Minor fixes for signed vs unsigned integers. · ccd9a01a
      Paul Eggert authored
      * character.h (MAYBE_UNIFY_CHAR):
      * charset.c (maybe_unify_char):
      * keyboard.c (read_char, reorder_modifiers):
      XINT -> XFASTINT, since the integer must be nonnegative.
      * ftfont.c (ftfont_spec_pattern):
      * keymap.c (access_keymap, silly_event_symbol_error):
      XUINT -> XFASTINT, since the integer must be nonnegative.
      (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
      since it makes no difference and we prefer signed.
      * keyboard.c (record_char): Use XUINT when all the neighbors do.
      (access_keymap): NATNUMP -> INTEGERP, since the integer must be
      nonnegative.
      ccd9a01a
    • YAMAMOTO Mitsuharu's avatar
      * fringe.c (update_window_fringes): Don't update overlay arrow bitmap in the... · 14eca62f
      YAMAMOTO Mitsuharu authored
      * fringe.c (update_window_fringes): Don't update overlay arrow bitmap in the current matrix if keep_current_p is non-zero.
      14eca62f
  7. 31 May, 2011 14 commits
    • Eli Zaretskii's avatar
    • Juanma Barranquero's avatar
      864db017
    • Dan Nicolaescu's avatar
      * src/data.c (init_data): Remove code for UTS, this system is not · 2ad0baf4
      Dan Nicolaescu authored
      supported anymore.
      2ad0baf4
    • Dan Nicolaescu's avatar
      Don't force ./temacs to start in terminal mode. · 4fcc2638
      Dan Nicolaescu authored
      * frame.c (make_initial_frame): Initialize faces in all cases, not
      only when CANNOT_DUMP is defined.
      * dispnew.c (init_display): Remove CANNOT_DUMP condition.
      4fcc2638
    • Dan Nicolaescu's avatar
      Use const for a string pointer. · c56e0fd5
      Dan Nicolaescu authored
      * src/dispnew.c (add_window_display_history): Use const for the string
      pointer.  Remove declaration, not needed.
      c56e0fd5
    • Paul Eggert's avatar
      3870d916
    • Paul Eggert's avatar
      Add Bug#. · ac32cd99
      Paul Eggert authored
      ac32cd99
    • Paul Eggert's avatar
      Remove arbitrary limit of 2**31 entries in hash tables. · 0de4bb68
      Paul Eggert authored
      * category.c (hash_get_category_set): Use 'EMACS_UINT' and 'EMACS_INT'
      for hashes and hash indexes, instead of 'unsigned' and 'int'.
      * ccl.c (ccl_driver): Likewise.
      * charset.c (Fdefine_charset_internal): Likewise.
      * charset.h (struct charset.hash_index): Likewise.
      * composite.c (get_composition_id, gstring_lookup_cache):
      (composition_gstring_put_cache): Likewise.
      * composite.h (struct composition.hash_index): Likewise.
      * dispextern.h (struct image.hash): Likewise.
      * fns.c (next_almost_prime, larger_vector, cmpfn_eql):
      (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql):
      (hashfn_equal, hashfn_user_defined, make_hash_table):
      (maybe_resize_hash_table, hash_lookup, hash_put):
      (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE):
      (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
      (Fsxhash, Fgethash, Fputhash, Fmaphash): Likewise.
      * image.c (make_image, search_image_cache, lookup_image):
      (xpm_put_color_table_h): Likewise.
      * lisp.h (struct Lisp_Hash_Table): Likewise, for 'count', 'cmpfn',
      and 'hashfn' members.
      * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
      Likewise.
      * print.c (print): Likewise.
      * alloc.c (allocate_vectorlike): Check for overflow in vector size
      calculations.
      * ccl.c (ccl_driver): Check for overflow when converting EMACS_INT
      to int.
      * fns.c, image.c: Remove unnecessary static decls that would otherwise
      need to be updated by these changes.
      * fns.c (make_hash_table, maybe_resize_hash_table): Check for integer
      overflow with large hash tables.
      (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
      Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
      (SXHASH_REDUCE): New macro.
      (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
      Use it instead of discarding useful hash info with large hash values.
      (sxhash_float): New function.
      (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
      * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
      (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK): Rewrite
      to use FIXNUM_BITS, as this simplifies things.
      (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
      Adjust signatures to match updated version of code.
      (consing_since_gc): Now EMACS_INT, since a single hash table can
      use more than INT_MAX bytes.
      0de4bb68
    • Paul Eggert's avatar
      Fix ChangeLog entry order. · 97f4ea97
      Paul Eggert authored
      97f4ea97
    • Paul Eggert's avatar
      Add bug#. · 12c69b84
      Paul Eggert authored
      12c69b84
    • Paul Eggert's avatar
      * ccl.c: Improve comment. (Bug#8751) · b9627cfb
      Paul Eggert authored
      b9627cfb
    • Dan Nicolaescu's avatar
      Make it possible to run ./temacs. · 738db178
      Dan Nicolaescu authored
      * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
      syms_of_callproc does the same thing.  Remove test for
      "initialized", do it in the caller.
      * emacs.c (main): Avoid calling set_initial_environment when dumping.
      738db178
    • Stefan Monnier's avatar
      * lisp/minibuffer.el: Add metadata method to completion tables. · 620c53a6
      Stefan Monnier authored
      (completion-category-overrides): New defcustom.
      (completion-metadata, completion--field-metadata)
      (completion-metadata-get, completion--styles)
      (completion--cycle-threshold): New functions.
      (completion-try-completion, completion-all-completions):
      Add `metadata' argument to choose completion-styles.
      (completion--do-completion): Use metadata to choose cycling.
      (completion-all-sorted-completions): Use metadata for sorting.
      Remove :completion-cycle-penalty which is not needed any more.
      (completion--try-word-completion): Add `metadata' argument.
      (minibuffer-completion-help): Check metadata for annotation function
      and sorting.
      (completion-file-name-table): Return `category' metadata.
      (minibuffer-completing-file-name): Make obsolete.
      * lisp/simple.el (minibuffer-completing-symbol): Make obsolete.
      * lisp/icomplete.el (icomplete-completions): Pass new `metadata' param to
      completion-try-completion.
      * src/minibuf.c (Finternal_complete_buffer): Return `category' metadata.
      (read_minibuf): Use get_minibuffer.
      (syms_of_minibuf): Use DEFSYM.
      (Qmetadata): New var.
      * src/data.c (Qbuffer): Don't make it static.
      (syms_of_data): Use DEFSYM.
      620c53a6
    • Paul Eggert's avatar
      * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751) · e003a292
      Paul Eggert authored
      (CCL_CODE_MIN): New macro.
      e003a292
  8. 30 May, 2011 2 commits
    • Paul Eggert's avatar
      [ChangeLog] · 531b0165
      Paul Eggert authored
      Malloc failure behavior now depends on size of allocation.
      * lib/allocator.h (struct allocator.die): New size arg.
      * lib/careadlinkat.c (careadlinkat): Pass size to 'die' function.
      If the actual problem is an ssize_t limitation, not a size_t or
      malloc failure, fail with errno == ENAMETOOLONG instead of calling 'die'.
      [src/ChangeLog]
      Malloc failure behavior now depends on size of allocation.
      * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
      * lisp.h: Change signatures accordingly.
      * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
      All callers changed.
      531b0165
    • Paul Eggert's avatar