1. 16 Jun, 2011 3 commits
  2. 15 Jun, 2011 23 commits
  3. 14 Jun, 2011 14 commits
    • Paul Eggert's avatar
    • Paul Eggert's avatar
    • Paul Eggert's avatar
    • Paul Eggert's avatar
      * fns.c: Don't overflow int when computing a list length. · e6966cd6
      Paul Eggert authored
      (Fsafe_length): Return a float if the value is not representable
      as a fixnum.  This shouldn't happen except in contrived situations.
      Use same QUIT_COUNT_HEURISTIC as Flength now does.
      e6966cd6
    • Paul Eggert's avatar
      * fns.c (Flength): Don't overflow int when computing a list length. · 00c604f2
      Paul Eggert authored
      Use EMACS_INT, not int, to avoid unwanted truncation on 64-bit hosts.
      Check for QUIT every 1024 entries rather than every other entry;
      that's faster and is responsive enough.  Report an error instead of
      overflowing an integer.
      00c604f2
    • Paul Eggert's avatar
      * alloc.c: Check that resized vectors' lengths fit in fixnums. · dd0b0efb
      Paul Eggert authored
      (header_size, word_size): New constants.
      (allocate_vectorlike): Don't check size overflow here.
      (allocate_vector): Check it here instead, since this is the only
      caller of allocate_vectorlike that could cause overflow.
      Check that the new vector's length is representable as a fixnum.
      dd0b0efb
    • Jan Djärv's avatar
      Fix resize and change of scroll bar width for Gtk3. · c195f2de
      Jan Djärv authored
      * configure.in: Add emacsgtkfixed.o to GTK_OBJ if HAVE_GTK3.
      
      * src/emacsgtkfixed.c, src/emacsgtkfixed.h: New files.
      
      * src/gtkutil.c: Include src/emacsgtkfixed.h if HAVE_GTK3.
      (int_gtk_range_get_value): Move to the scroll bar part of the file.
      (style_changed_cb): Call update_theme_scrollbar_width and call
      x_set_scroll_bar_default_width and xg_frame_set_char_size for
      all frames.
      (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
      Call gtk_window_set_resizable if HAVE_GTK3.
      (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
      and height if HAVE_GTK3 (Bug#8505).
      (scroll_bar_width_for_theme): New variable.
      (update_theme_scrollbar_width): New function.
      (xg_get_default_scrollbar_width): Move code to
      update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
      (xg_initialize): Call update_theme_scrollbar_width.
      
      * src/gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
      
      * src/xfns.c (x_set_scroll_bar_default_width): Remove argument to
      xg_get_default_scrollbar_width.
      c195f2de
    • Paul Eggert's avatar
      * fns.c (next_almost_prime): Don't return a multiple of 3 or 5. · 86fe5cfe
      Paul Eggert authored
      The previous code was bogus.  For example, next_almost_prime (32)
      returned 39, which is undesirable as it is a multiple of 3; and
      next_almost_prime (24) returned 25, which is a multiple of 5 so
      why was the code bothering to check for multiples of 7?
      86fe5cfe
    • Paul Eggert's avatar
    • Paul Eggert's avatar
    • Paul Eggert's avatar
      Merge from trunk. · e8f2a944
      Paul Eggert authored
      e8f2a944
    • Paul Eggert's avatar
      Variadic C functions now count arguments with ptrdiff_t. · f66c7cf8
      Paul Eggert authored
      This partly undoes my 2011-03-30 change, which replaced int with size_t.
      Back then I didn't know that the Emacs coding style prefers signed int.
      Also, in the meantime I found a few more instances where arguments
      were being counted with int, which may truncate counts on 64-bit
      machines, or EMACS_INT, which may be unnecessarily wide.
      * lisp.h (struct Lisp_Subr.function.aMANY)
      (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
      Arg counts are now ptrdiff_t, not size_t.
      All variadic functions and their callers changed accordingly.
      (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
      * bytecode.c (exec_byte_code): Check maxdepth for overflow,
      to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
      * callint.c (Fcall_interactively): Check arg count for overflow,
      to avoid potential buffer overrun.  Use signed char, not 'int',
      for 'varies' array, so that we needn't bother to check its size
      calculation for overflow.
      * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
      * eval.c (apply_lambda):
      * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
      (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
      (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
      f66c7cf8
    • Paul Eggert's avatar
    • Chong Yidong's avatar
      Print theme summaries in *Custom Themes* buffer. · c5dd5a51
      Chong Yidong authored
      * lisp/cus-theme.el (describe-theme-1): Use custom-theme-p.
      (custom-theme-summary): New function.
      (customize-themes): Use it.
      
      * etc/themes/light-blue-theme.el:
      * etc/themes/misterioso-theme.el:
      * etc/themes/tango-dark-theme.el:
      * etc/themes/tango-theme.el:
      * etc/themes/tsdh-dark-theme.el:
      * etc/themes/tsdh-light-theme.el:
      * etc/themes/wheatgrass-theme.el:
      * etc/themes/wombat-theme.el: Tweak summaries for better listability.
      c5dd5a51