Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 103778. ------------------------------------------------------------ revno: 103778 committer: Chong Yidong branch nick: trunk timestamp: Tue 2011-03-29 22:21:28 -0400 message: Change default type of open-protocol-stream. * nnimap.el (nnimap-stream, nnimap-open-connection-1): Accept `network' value. * nntp.el (nntp-open-connection-function): Document the fact that some values are not functions but are instead handled specially. Recognize nntp-open-plain-stream value. (nntp-open-connection): Recognize that value. * proto-stream.el (open-protocol-stream): Bring back `network' type. Make this the default type. (proto-stream-open-plain): Rename from proto-stream-open-default. (open-protocol-stream, proto-stream-open-starttls) (proto-stream-open-tls, proto-stream-open-shell): Replace `default' with `plain'. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-03-29 13:23:38 +0000 +++ lisp/gnus/ChangeLog 2011-03-30 02:21:28 +0000 @@ -1,3 +1,20 @@ +2011-03-30 Chong Yidong + + * proto-stream.el (open-protocol-stream): Bring back `network' type. + Make this the default type. + (proto-stream-open-plain): Rename from proto-stream-open-default. + (open-protocol-stream, proto-stream-open-starttls) + (proto-stream-open-tls, proto-stream-open-shell): Replace `default' + with `plain'. + + * nnimap.el (nnimap-stream, nnimap-open-connection-1): Accept `network' + value. + + * nntp.el (nntp-open-connection-function): Document the fact that some + values are not functions but are instead handled specially. Recognize + nntp-open-plain-stream value. + (nntp-open-connection): Recognize that value. + 2011-03-29 Julien Danjou * mm-view.el (mm-display-inline-fontify): Use `set-normal-mode' with === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2011-03-26 23:18:42 +0000 +++ lisp/gnus/nnimap.el 2011-03-30 02:21:28 +0000 @@ -61,10 +61,12 @@ it will default to `imap'.") (defvoo nnimap-stream 'undecided - "How nnimap will talk to the IMAP server. -Values are `ssl', `default', `try-starttls', `starttls' or -`shell'. The default is to try `ssl' first, and then -`try-starttls'.") + "How nnimap talks to the IMAP server. +The value should be either `undecided', `ssl' or `tls', +`network', `starttls', `plain', or `shell'. + +If the value is `undecided', nnimap tries `ssl' first, then falls +back on `network'.") (defvoo nnimap-shell-program (if (boundp 'imap-shell-program) (if (listp imap-shell-program) @@ -319,7 +321,7 @@ (setq nnimap-stream 'ssl)) (let ((stream (if (eq nnimap-stream 'undecided) - (loop for type in '(ssl try-starttls) + (loop for type in '(ssl network) for stream = (let ((nnimap-stream type)) (nnimap-open-connection-1 buffer)) while (eq stream 'no-connect) @@ -339,7 +341,7 @@ (port nil) (ports (cond - ((memq nnimap-stream '(try-starttls default starttls)) + ((memq nnimap-stream '(network plain starttls)) (nnheader-message 7 "Opening connection to %s..." nnimap-address) '("imap" "143")) === modified file 'lisp/gnus/nntp.el' --- lisp/gnus/nntp.el 2011-03-26 23:18:42 +0000 +++ lisp/gnus/nntp.el 2011-03-30 02:21:28 +0000 @@ -76,27 +76,27 @@ You probably don't want to do that, though.") (defvoo nntp-open-connection-function 'nntp-open-network-stream - "*Function used for connecting to a remote system. -It will be called with the buffer to output in as argument. - -Currently, five such functions are provided (please refer to their -respective doc string for more information), three of them establishing -direct connections to the nntp server, and two of them using an indirect -host. - -Direct connections: -- `nntp-open-network-stream' (the default), -- `network-only' (the same as the above, but don't do automatic - STARTTLS upgrades). -- `nntp-open-ssl-stream', -- `nntp-open-tls-stream', -- `nntp-open-netcat-stream'. -- `nntp-open-telnet-stream'. - -Indirect connections: -- `nntp-open-via-rlogin-and-netcat', -- `nntp-open-via-rlogin-and-telnet', -- `nntp-open-via-telnet-and-telnet'.") + "Method for connecting to a remote system. +It should be a function, which is called with the output buffer +as its single argument, or one of the following special values: + +- `nntp-open-network-stream' specifies a network connection, + upgrading to a TLS connection via STARTTLS if possible. +- `nntp-open-plain-stream' specifies an unencrypted network + connection (no STARTTLS upgrade is attempted). +- `nntp-open-ssl-stream' or `nntp-open-tls-stream' specify a TLS + network connection. + +Apart from the above special values, valid functions are as +follows; please refer to their respective doc string for more +information. +For direct connections: +- `nntp-open-netcat-stream' +- `nntp-open-telnet-stream' +For indirect connections: +- `nntp-open-via-rlogin-and-netcat' +- `nntp-open-via-rlogin-and-telnet' +- `nntp-open-via-telnet-and-telnet'") (defvoo nntp-never-echoes-commands nil "*Non-nil means the nntp server never echoes commands. @@ -1339,15 +1339,15 @@ (condition-case err (let ((coding-system-for-read nntp-coding-system-for-read) (coding-system-for-write nntp-coding-system-for-write) - (map '((nntp-open-network-stream try-starttls) - (network-only default) + (map '((nntp-open-network-stream network) + (network-only plain) ; compat + (nntp-open-plain-stream plain) (nntp-open-ssl-stream tls) (nntp-open-tls-stream tls)))) (if (assoc nntp-open-connection-function map) (open-protocol-stream "nntpd" pbuffer nntp-address nntp-port-number - :type (or (cadr (assoc nntp-open-connection-function map)) - 'try-starttls) + :type (cadr (assoc nntp-open-connection-function map)) :end-of-command "^\\([2345]\\|[.]\\).*\n" :capability-command "CAPABILITIES\r\n" :success "^3" === modified file 'lisp/gnus/proto-stream.el' --- lisp/gnus/proto-stream.el 2011-03-26 23:18:42 +0000 +++ lisp/gnus/proto-stream.el 2011-03-30 02:21:28 +0000 @@ -37,7 +37,7 @@ ;; (open-protocol-stream ;; "*nnimap*" buffer address port -;; :type 'try-starttls +;; :type 'network ;; :capability-command "1 CAPABILITY\r\n" ;; :success " OK " ;; :starttls-function @@ -65,17 +65,20 @@ PARAMETERS should be a sequence of keywords and values: :type specifies the connection type, one of the following: - `default' -- An ordinary network connection. - `try-starttls' - -- Begin an ordinary network connection, and try - upgrading it to an encrypted connection via - STARTTLS if both HOST and Emacs support TLS. If - that fails, keep the unencrypted connection. - `starttls' -- Begin an ordinary connection, and try upgrading - it via STARTTLS. If that fails for any reason, - drop the connection; in this case, the returned - process object is a killed process. - `tls' or `ssl' -- A TLS connection. + nil or `network' + -- Begin with an ordinary network connection, and if + the parameters :success and :capability-command + are also supplied, try to upgrade to an encrypted + connection via STARTTLS. Even if that + fails (e.g. if HOST does not support TLS), retain + an unencrypted connection. + `plain' -- An ordinary, unencrypted network connection. + `starttls' -- Begin with an ordinary connection, and try + upgrading via STARTTLS. If that fails for any + reason, drop the connection; in that case the + returned object is a killed process. + `tls' -- A TLS connection. + `ssl' -- Equivalent to `tls'. `shell' -- A shell connection. :return-list specifies this function's return value. @@ -85,16 +88,15 @@ :greeting -- the greeting returned by HOST (a string), or nil. :capabilities -- a string representing HOST's capabilities, or nil if none could be found. - :type -- the actual connection type; either `default' for an - unencrypted connection, or `tls'. + :type -- the resulting connection type; `plain' (unencrypted) + or `tls' (TLS-encrypted). :end-of-command specifies a regexp matching the end of a command. If non-nil, it defaults to \"\\n\". :success specifies a regexp matching a message indicating a successful STARTTLS negotiation. For instance, the default - should be \"^3\" for an NNTP connection. If this is not - supplied, STARTTLS will always fail. + should be \"^3\" for an NNTP connection. :capability-command specifies a command used to query the HOST for its capabilities. For instance, for IMAP this should be @@ -106,27 +108,24 @@ STARTTLS if the server supports STARTTLS, and nil otherwise." (let ((type (plist-get parameters :type)) (return-list (plist-get parameters :return-list))) - (if (and (null return-list) (memq type '(nil default))) - ;; The simplest case---no encryption, and no need to report - ;; connection properties. Like `open-network-stream', this - ;; doesn't read anything into BUFFER yet. + (if (and (not return-list) + (or (eq type 'plain) + (and (memq type '(nil network)) + (not (and (plist-get parameters :success) + (plist-get parameters :capability-command)))))) + ;; The simplest case is equivalent to `open-network-stream'. (open-network-stream name buffer host service) ;; For everything else, refer to proto-stream-open-*. (unless (plist-get parameters :end-of-command) - (setq parameters - (append '(:end-of-command "\r\n") parameters))) + (setq parameters (append '(:end-of-command "\r\n") parameters))) (let* ((connection-function (cond - ((memq type '(nil default)) - 'proto-stream-open-default) - ((memq type '(try-starttls starttls)) + ((eq type 'plain) 'proto-stream-open-plain) + ((memq type '(nil network starttls)) 'proto-stream-open-starttls) - ((memq type '(tls ssl)) - 'proto-stream-open-tls) - ((eq type 'shell) - 'proto-stream-open-shell) - (t - (error "Invalid connection type %s" type)))) + ((memq type '(tls ssl)) 'proto-stream-open-tls) + ((eq type 'shell) 'proto-stream-open-shell) + (t (error "Invalid connection type %s" type)))) (result (funcall connection-function name buffer host service parameters))) (if return-list @@ -136,19 +135,18 @@ :type (nth 3 result)) (car result)))))) -(defun proto-stream-open-default (name buffer host service parameters) +(defun proto-stream-open-plain (name buffer host service parameters) (let ((start (with-current-buffer buffer (point))) (stream (open-network-stream name buffer host service))) (list stream (proto-stream-get-response stream start (plist-get parameters :end-of-command)) nil - 'default))) + 'plain))) (defun proto-stream-open-starttls (name buffer host service parameters) (let* ((start (with-current-buffer buffer (point))) - ;; This should be `starttls' or `try-starttls'. - (type (plist-get parameters :type)) + (require-tls (eq (plist-get parameters :type) 'starttls)) (starttls-function (plist-get parameters :starttls-function)) (success-string (plist-get parameters :success)) (capability-command (plist-get parameters :capability-command)) @@ -159,7 +157,7 @@ (capabilities (when capability-command (proto-stream-command stream capability-command eoc))) - (resulting-type 'default) + (resulting-type 'plain) starttls-command) ;; If we have STARTTLS support, try to upgrade the connection. @@ -175,11 +173,11 @@ (setq start (with-current-buffer buffer (point-max))) (let* ((starttls-use-gnutls t) (starttls-extra-arguments - (if (not (eq type 'starttls)) - ;; For opportunistic TLS upgrades, we don't - ;; really care about the identity of the peer. - (cons "--insecure" starttls-extra-arguments) - starttls-extra-arguments))) + (if require-tls + starttls-extra-arguments + ;; For opportunistic TLS upgrades, we don't really + ;; care about the identity of the peer. + (cons "--insecure" starttls-extra-arguments)))) (setq stream (starttls-open-stream name buffer host service))) (proto-stream-get-response stream start eoc)) (when (string-match success-string @@ -193,7 +191,7 @@ (setq resulting-type 'tls) ;; We didn't successfully negotiate STARTTLS; if TLS ;; isn't demanded, reopen an unencrypted connection. - (when (eq type 'try-starttls) + (unless require-tls (setq stream (open-network-stream name buffer host service)) (proto-stream-get-response stream start eoc))) ;; Re-get the capabilities, which may have now changed. @@ -201,8 +199,8 @@ (proto-stream-command stream capability-command eoc)))) ;; If TLS is mandatory, close the connection if it's unencrypted. - (and (eq type 'starttls) - (eq resulting-type 'default) + (and require-tls + (eq resulting-type 'plain) (delete-process stream)) ;; Return value: (list stream greeting capabilities resulting-type))) @@ -237,7 +235,7 @@ name buffer host service)) (eoc (plist-get parameters :end-of-command))) (if (null stream) - (list nil nil nil 'default) + (list nil nil nil 'plain) ;; If we're using tls.el, we have to delete the output from ;; openssl/gnutls-cli. (unless (fboundp 'open-gnutls-stream) @@ -260,7 +258,7 @@ (format-spec-make ?s host ?p service)))) - parameters 'default)) + parameters 'plain)) (defun proto-stream-capability-open (start stream parameters stream-type) (let* ((capability-command (plist-get parameters :capability-command)) ------------------------------------------------------------ revno: 103777 committer: Leo Liu branch nick: trunk timestamp: Wed 2011-03-30 09:06:00 +0800 message: Improve key bindings in edit-abbrevs-mode C-x C-s and C-x C-w in edit-abbrevs-mode now do something similar to their corresponding global bindings. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-29 18:26:01 +0000 +++ lisp/ChangeLog 2011-03-30 01:06:00 +0000 @@ -1,3 +1,10 @@ +2011-03-30 Leo Liu + + * abbrev.el (abbrev-edit-save-to-file, abbrev-edit-save-buffer): + New commands. + (edit-abbrevs-map): Bind them here. + (write-abbrev-file): New optinal arg VERBOSE. (Bug#5937) + 2011-03-29 Ken Manheimer * allout.el (allout-hide-by-annotation, allout-flag-region): === modified file 'lisp/abbrev.el' --- lisp/abbrev.el 2011-03-28 14:34:32 +0000 +++ lisp/abbrev.el 2011-03-30 01:06:00 +0000 @@ -65,7 +65,8 @@ (defvar edit-abbrevs-map (let ((map (make-sparse-keymap))) - (define-key map "\C-x\C-s" 'edit-abbrevs-redefine) + (define-key map "\C-x\C-s" 'abbrev-edit-save-buffer) + (define-key map "\C-x\C-w" 'abbrev-edit-save-to-file) (define-key map "\C-c\C-c" 'edit-abbrevs-redefine) map) "Keymap used in `edit-abbrevs'.") @@ -216,13 +217,15 @@ ;(interactive "fRead abbrev file: ") (read-abbrev-file file t)) -(defun write-abbrev-file (&optional file) +(defun write-abbrev-file (&optional file verbose) "Write all user-level abbrev definitions to a file of Lisp code. This does not include system abbrevs; it includes only the abbrev tables listed in listed in `abbrev-table-name-list'. The file written can be loaded in another session to define the same abbrevs. The argument FILE is the file name to write. If omitted or nil, the file -specified in `abbrev-file-name' is used." +specified in `abbrev-file-name' is used. +If VERBOSE is non-nil, display a message indicating where abbrevs +have been saved." (interactive (list (read-file-name "Write abbrev file: " @@ -252,7 +255,25 @@ 'emacs-mule))) (goto-char (point-min)) (insert (format ";;-*-coding: %s;-*-\n" coding-system-for-write)) - (write-region nil nil file nil 0)))) + (write-region nil nil file nil (and (not verbose) 0))))) + +(defun abbrev-edit-save-to-file (file) + "Save all user-level abbrev definitions in current buffer to FILE." + (interactive + (list (read-file-name "Save abbrevs to file: " + (file-name-directory + (expand-file-name abbrev-file-name)) + abbrev-file-name))) + (edit-abbrevs-redefine) + (write-abbrev-file file t)) + +(defun abbrev-edit-save-buffer () + "Save all user-level abbrev definitions in current buffer. +The saved abbrevs are written to the file specified by +`abbrev-file-name'." + (interactive) + (abbrev-edit-save-to-file abbrev-file-name)) + (defun add-mode-abbrev (arg) "Define mode-specific abbrev for last word(s) before point. ------------------------------------------------------------ revno: 103776 [merge] committer: Paul Eggert branch nick: trunk timestamp: Tue 2011-03-29 17:39:12 -0700 message: Fix more problems found by GCC 4.6.0's static checks. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2011-03-27 02:27:11 +0000 +++ lib-src/ChangeLog 2011-03-30 00:39:12 +0000 @@ -1,3 +1,8 @@ +2011-03-30 Paul Eggert + + Fix a problem found by GCC 4.6.0's static checks. + * etags.c (just_read_file): Remove dummy variable and simplify. + 2011-03-27 Glenn Morris * emacsclient.c: Replace SIGTYPE with void. === modified file 'lib-src/etags.c' --- lib-src/etags.c 2011-03-21 16:41:03 +0000 +++ lib-src/etags.c 2011-03-29 06:54:38 +0000 @@ -3978,10 +3978,8 @@ static void just_read_file (FILE *inf) { - register char *dummy; - - LOOP_ON_INPUT_LINES (inf, lb, dummy) - continue; + while (!feof (inf)) + readline (&lb, inf); } === modified file 'src/ChangeLog' --- src/ChangeLog 2011-03-28 22:41:01 +0000 +++ src/ChangeLog 2011-03-30 00:39:12 +0000 @@ -1,3 +1,76 @@ +2011-03-30 Paul Eggert + + Fix more problems found by GCC 4.6.0's static checks. + + * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]: + Remove unused local var. + + * editfns.c (Fmessage_box): Remove unused local var. + + * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs): + (note_mode_line_or_margin_highlight, note_mouse_highlight): + Omit unused local vars. + * window.c (shrink_windows): Omit unused local var. + * menu.c (digest_single_submenu): Omit unused local var. + * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]: + Omit unused local var. + + * keyboard.c (parse_modifiers_uncached, parse_modifiers): + Don't assume string length fits in int. + (keyremap_step, read_key_sequence): Use size_t for sizes. + (read_key_sequence): Don't check last_real_key_start redundantly. + + * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA + instead of alloca (Bug#8344). + + * eval.c (Fbacktrace): Don't assume nargs fits in int. + (Fbacktrace_frame): Don't assume nframes fits in int. + + * syntax.c (scan_sexps_forward): Avoid pointer wraparound. + + * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow + concerns. + + * term.c (produce_glyphless_glyph): Remove unnecessary test. + + * cm.c (calccost): Turn while-do into do-while, for clarity. + + * keyboard.c (syms_of_keyboard): Use the same style as later + in this function when indexing through an array. This also + works around GCC bug 48267. + + * image.c (tiff_load): Fix off-by-one image count (Bug#8336). + + * xselect.c (x_check_property_data): Return correct size (Bug#8335). + + * chartab.c (sub_char_table_ref_and_range): Redo for slight + efficiency gain, and to bypass a gcc -Wstrict-overflow warning. + + * keyboard.c, keyboard.h (num_input_events): Now size_t. + This avoids undefined behavior on integer overflow, and is a bit + more convenient anyway since it is compared to a size_t variable. + + Variadic C functions now count arguments with size_t, not int. + This avoids an unnecessary limitation on 64-bit machines, which + caused (substring ...) to crash on large vectors (Bug#8344). + * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int. + (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise. + All variadic functions and their callers changed accordingly. + (struct gcpro.nvars): Now size_t, not int. All uses changed. + * data.c (arith_driver, float_arith_driver): Likewise. + * editfns.c (general_insert_function): Likewise. + * eval.c (struct backtrace.nargs, interactive_p) + (internal_condition_case_n, run_hook_with_args, apply_lambda) + (funcall_lambda, mark_backtrace): Likewise. + * fns.c (concat): Likewise. + * frame.c (x_set_frame_parameters): Likewise. + * fns.c (get_key_arg): Now accepts and returns size_t, and returns + 0 if not found, not -1. All callers changed. + + * alloc.c (garbage_collect): Don't assume stack size fits in int. + (stack_copy_size): Now size_t, not int. + (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0. + 2011-03-28 Juanma Barranquero * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end', === modified file 'src/alloc.c' --- src/alloc.c 2011-03-16 07:37:10 +0000 +++ src/alloc.c 2011-03-27 02:12:36 +0000 @@ -254,8 +254,10 @@ /* Buffer in which we save a copy of the C stack at each GC. */ +#if MAX_SAVE_STACK > 0 static char *stack_copy; -static int stack_copy_size; +static size_t stack_copy_size; +#endif /* Non-zero means ignore malloc warnings. Set during initialization. Currently not used. */ @@ -2705,7 +2707,7 @@ doc: /* Return a newly created list with specified arguments as elements. Any number of arguments, even zero arguments, are allowed. usage: (list &rest OBJECTS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { register Lisp_Object val; val = Qnil; @@ -2921,10 +2923,10 @@ doc: /* Return a newly created vector with specified arguments as elements. Any number of arguments, even zero arguments, are allowed. usage: (vector &rest OBJECTS) */) - (register int nargs, Lisp_Object *args) + (register size_t nargs, Lisp_Object *args) { register Lisp_Object len, val; - register int i; + register size_t i; register struct Lisp_Vector *p; XSETFASTINT (len, nargs); @@ -2943,10 +2945,10 @@ The first four arguments are required; at most six have any significance. usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */) - (register int nargs, Lisp_Object *args) + (register size_t nargs, Lisp_Object *args) { register Lisp_Object len, val; - register int i; + register size_t i; register struct Lisp_Vector *p; XSETFASTINT (len, nargs); @@ -4228,7 +4230,7 @@ check_gcpros (void) { struct gcpro *p; - int i; + size_t i; for (p = gcprolist; p; p = p->next) for (i = 0; i < p->nvars; ++i) @@ -4837,7 +4839,7 @@ { register struct specbinding *bind; char stack_top_variable; - register int i; + register size_t i; int message_p; Lisp_Object total[8]; int count = SPECPDL_INDEX (); @@ -4903,21 +4905,26 @@ #if MAX_SAVE_STACK > 0 if (NILP (Vpurify_flag)) { - i = &stack_top_variable - stack_bottom; - if (i < 0) i = -i; - if (i < MAX_SAVE_STACK) - { - if (stack_copy == 0) - stack_copy = (char *) xmalloc (stack_copy_size = i); - else if (stack_copy_size < i) - stack_copy = (char *) xrealloc (stack_copy, (stack_copy_size = i)); - if (stack_copy) + char *stack; + size_t stack_size; + if (&stack_top_variable < stack_bottom) + { + stack = &stack_top_variable; + stack_size = stack_bottom - &stack_top_variable; + } + else + { + stack = stack_bottom; + stack_size = &stack_top_variable - stack_bottom; + } + if (stack_size <= MAX_SAVE_STACK) + { + if (stack_copy_size < stack_size) { - if ((EMACS_INT) (&stack_top_variable - stack_bottom) > 0) - memcpy (stack_copy, stack_bottom, i); - else - memcpy (stack_copy, &stack_top_variable, i); + stack_copy = (char *) xrealloc (stack_copy, stack_size); + stack_copy_size = stack_size; } + memcpy (stack_copy, stack, stack_size); } } #endif /* MAX_SAVE_STACK > 0 */ === modified file 'src/callint.c' --- src/callint.c 2011-03-23 10:06:57 +0000 +++ src/callint.c 2011-03-27 02:12:36 +0000 @@ -265,8 +265,9 @@ recorded as a call to the function named callint_argfuns[varies[i]]. */ int *varies; - register int i, j; - int count, foo; + register size_t i, j; + size_t count; + int foo; char prompt1[100]; char *tem1; int arg_from_tty = 0; === modified file 'src/callproc.c' --- src/callproc.c 2011-03-18 05:56:46 +0000 +++ src/callproc.c 2011-03-27 09:07:38 +0000 @@ -177,7 +177,7 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again. usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { Lisp_Object infile, buffer, current_dir, path; volatile int display_p_volatile; @@ -189,6 +189,7 @@ char buf[CALLPROC_BUFFER_SIZE_MAX]; int bufsize = CALLPROC_BUFFER_SIZE_MIN; int count = SPECPDL_INDEX (); + volatile USE_SAFE_ALLOCA; const unsigned char **volatile new_argv_volatile; register const unsigned char **new_argv; @@ -221,7 +222,7 @@ /* Decide the coding-system for giving arguments. */ { Lisp_Object val, *args2; - int i; + size_t i; /* If arguments are supplied, we may have to encode them. */ if (nargs >= 5) @@ -242,7 +243,7 @@ val = Qraw_text; else { - args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); + SAFE_ALLOCA (args2, Lisp_Object *, (nargs + 1) * sizeof *args2); args2[0] = Qcall_process; for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; coding_systems = Ffind_operation_coding_system (nargs + 1, args2); @@ -372,11 +373,12 @@ && SREF (path, 1) == ':') path = Fsubstring (path, make_number (2), Qnil); - new_argv_volatile = new_argv = (const unsigned char **) - alloca (max (2, nargs - 2) * sizeof (char *)); + SAFE_ALLOCA (new_argv, const unsigned char **, + (nargs > 4 ? nargs - 2 : 2) * sizeof *new_argv); + new_argv_volatile = new_argv; if (nargs > 4) { - register int i; + register size_t i; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; GCPRO5 (infile, buffer, current_dir, path, error_file); @@ -643,9 +645,9 @@ { if (EQ (coding_systems, Qt)) { - int i; + size_t i; - args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); + SAFE_ALLOCA (args2, Lisp_Object *, (nargs + 1) * sizeof *args2); args2[0] = Qcall_process; for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; coding_systems @@ -809,6 +811,7 @@ when exiting. */ call_process_exited = 1; + SAFE_FREE (); unbind_to (count, Qnil); if (synch_process_termsig) @@ -864,7 +867,7 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again. usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &rest ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { struct gcpro gcpro1; Lisp_Object filename_string; @@ -873,7 +876,7 @@ /* Qt denotes we have not yet called Ffind_operation_coding_system. */ Lisp_Object coding_systems; Lisp_Object val, *args2; - int i; + size_t i; char *tempfile; Lisp_Object tmpdir, pattern; @@ -897,30 +900,35 @@ #endif } - pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir); - tempfile = (char *) alloca (SBYTES (pattern) + 1); - memcpy (tempfile, SDATA (pattern), SBYTES (pattern) + 1); - coding_systems = Qt; + { + USE_SAFE_ALLOCA; + pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir); + SAFE_ALLOCA (tempfile, char *, SBYTES (pattern) + 1); + memcpy (tempfile, SDATA (pattern), SBYTES (pattern) + 1); + coding_systems = Qt; #ifdef HAVE_MKSTEMP - { - int fd; + { + int fd; - BLOCK_INPUT; - fd = mkstemp (tempfile); - UNBLOCK_INPUT; - if (fd == -1) - report_file_error ("Failed to open temporary file", - Fcons (Vtemp_file_name_pattern, Qnil)); - else - close (fd); - } + BLOCK_INPUT; + fd = mkstemp (tempfile); + UNBLOCK_INPUT; + if (fd == -1) + report_file_error ("Failed to open temporary file", + Fcons (Vtemp_file_name_pattern, Qnil)); + else + close (fd); + } #else - mktemp (tempfile); + mktemp (tempfile); #endif - filename_string = build_string (tempfile); - GCPRO1 (filename_string); + filename_string = build_string (tempfile); + GCPRO1 (filename_string); + SAFE_FREE (); + } + start = args[0]; end = args[1]; /* Decide coding-system of the contents of the temporary file. */ @@ -930,11 +938,13 @@ val = Qraw_text; else { - args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); + USE_SAFE_ALLOCA; + SAFE_ALLOCA (args2, Lisp_Object *, (nargs + 1) * sizeof *args2); args2[0] = Qcall_process_region; for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; coding_systems = Ffind_operation_coding_system (nargs + 1, args2); val = CONSP (coding_systems) ? XCDR (coding_systems) : Qnil; + SAFE_FREE (); } val = complement_process_encoding_system (val); === modified file 'src/character.c' --- src/character.c 2011-03-28 22:41:01 +0000 +++ src/character.c 2011-03-29 23:35:49 +0000 @@ -890,9 +890,10 @@ doc: /* Concatenate all the argument characters and make the result a string. usage: (string &rest CHARACTERS) */) - (int n, Lisp_Object *args) + (size_t n, Lisp_Object *args) { - int i, c; + size_t i; + int c; unsigned char *buf, *p; Lisp_Object str; USE_SAFE_ALLOCA; @@ -915,9 +916,10 @@ DEFUN ("unibyte-string", Funibyte_string, Sunibyte_string, 0, MANY, 0, doc: /* Concatenate all the argument bytes and make the result a unibyte string. usage: (unibyte-string &rest BYTES) */) - (int n, Lisp_Object *args) + (size_t n, Lisp_Object *args) { - int i, c; + size_t i; + int c; unsigned char *buf, *p; Lisp_Object str; USE_SAFE_ALLOCA; === modified file 'src/charset.c' --- src/charset.c 2011-03-08 00:46:23 +0000 +++ src/charset.c 2011-03-27 02:12:36 +0000 @@ -845,7 +845,7 @@ Sdefine_charset_internal, charset_arg_max, MANY, 0, doc: /* For internal use only. usage: (define-charset-internal ...) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { /* Charset attr vector. */ Lisp_Object attrs; @@ -2171,11 +2171,12 @@ 1, MANY, 0, doc: /* Assign higher priority to the charsets given as arguments. usage: (set-charset-priority &rest charsets) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { Lisp_Object new_head, old_list, arglist[2]; Lisp_Object list_2022, list_emacs_mule; - int i, id; + size_t i; + int id; old_list = Fcopy_sequence (Vcharset_ordered_list); new_head = Qnil; === modified file 'src/chartab.c' --- src/chartab.c 2011-03-08 08:13:36 +0000 +++ src/chartab.c 2011-03-27 08:15:26 +0000 @@ -215,7 +215,6 @@ struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); int depth = XINT (tbl->depth); int min_char = XINT (tbl->min_char); - int max_char = min_char + chartab_chars[depth - 1] - 1; int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx; Lisp_Object val; @@ -244,8 +243,9 @@ break; } } - while ((c = min_char + (chartab_idx + 1) * chartab_chars[depth]) <= max_char - && *to >= c) + while (((c = (chartab_idx + 1) * chartab_chars[depth]) + < chartab_chars[depth - 1]) + && (c += min_char) <= *to) { Lisp_Object this_val; === modified file 'src/cm.c' --- src/cm.c 2011-03-19 22:46:50 +0000 +++ src/cm.c 2011-03-23 08:06:21 +0000 @@ -214,8 +214,9 @@ } totalcost = c * deltay; if (doit) - while (--deltay >= 0) + do emacs_tputs (tty, p, 1, cmputc); + while (0 < --deltay); x: if ((deltax = dstx - srcx) == 0) goto done; @@ -296,8 +297,9 @@ } totalcost += c * deltax; if (doit) - while (--deltax >= 0) + do emacs_tputs (tty, p, 1, cmputc); + while (0 < --deltax); done: return totalcost; } === modified file 'src/coding.c' --- src/coding.c 2011-03-28 22:41:01 +0000 +++ src/coding.c 2011-03-29 23:35:49 +0000 @@ -9299,7 +9299,7 @@ contents of BUFFER instead of reading the file. usage: (find-operation-coding-system OPERATION ARGUMENTS...) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { Lisp_Object operation, target_idx, target, val; register Lisp_Object chain; @@ -9308,17 +9308,17 @@ error ("Too few arguments"); operation = args[0]; if (!SYMBOLP (operation) - || !INTEGERP (target_idx = Fget (operation, Qtarget_idx))) + || !NATNUMP (target_idx = Fget (operation, Qtarget_idx))) error ("Invalid first argument"); - if (nargs < 1 + XINT (target_idx)) + if (nargs < 1 + XFASTINT (target_idx)) error ("Too few arguments for operation: %s", SDATA (SYMBOL_NAME (operation))); - target = args[XINT (target_idx) + 1]; + target = args[XFASTINT (target_idx) + 1]; if (!(STRINGP (target) || (EQ (operation, Qinsert_file_contents) && CONSP (target) && STRINGP (XCAR (target)) && BUFFERP (XCDR (target))) || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) - error ("Invalid %dth argument", XINT (target_idx) + 1); + error ("Invalid %dth argument", XFASTINT (target_idx) + 1); if (CONSP (target)) target = XCAR (target); @@ -9375,9 +9375,9 @@ all but the first one are ignored. usage: (set-coding-system-priority &rest coding-systems) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { - int i, j; + size_t i, j; int changed[coding_category_max]; enum coding_category priorities[coding_category_max]; @@ -9420,7 +9420,7 @@ /* Update `coding-category-list'. */ Vcoding_category_list = Qnil; - for (i = coding_category_max - 1; i >= 0; i--) + for (i = coding_category_max; i-- > 0; ) Vcoding_category_list = Fcons (AREF (Vcoding_category_table, priorities[i]), Vcoding_category_list); @@ -9481,7 +9481,7 @@ Sdefine_coding_system_internal, coding_arg_max, MANY, 0, doc: /* For internal use only. usage: (define-coding-system-internal ...) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { Lisp_Object name; Lisp_Object spec_vec; /* [ ATTRS ALIASE EOL_TYPE ] */ === modified file 'src/data.c' --- src/data.c 2011-03-27 02:27:11 +0000 +++ src/data.c 2011-03-27 02:32:40 +0000 @@ -2474,13 +2474,13 @@ Amin }; -static Lisp_Object float_arith_driver (double, int, enum arithop, - int, Lisp_Object *); +static Lisp_Object float_arith_driver (double, size_t, enum arithop, + size_t, Lisp_Object *); static Lisp_Object -arith_driver (enum arithop code, int nargs, register Lisp_Object *args) +arith_driver (enum arithop code, size_t nargs, register Lisp_Object *args) { register Lisp_Object val; - register int argnum; + register size_t argnum; register EMACS_INT accum = 0; register EMACS_INT next; @@ -2562,7 +2562,8 @@ #define isnan(x) ((x) != (x)) static Lisp_Object -float_arith_driver (double accum, register int argnum, enum arithop code, int nargs, register Lisp_Object *args) +float_arith_driver (double accum, register size_t argnum, enum arithop code, + size_t nargs, register Lisp_Object *args) { register Lisp_Object val; double next; @@ -2624,7 +2625,7 @@ DEFUN ("+", Fplus, Splus, 0, MANY, 0, doc: /* Return sum of any number of arguments, which are numbers or markers. usage: (+ &rest NUMBERS-OR-MARKERS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return arith_driver (Aadd, nargs, args); } @@ -2634,7 +2635,7 @@ With one arg, negates it. With more than one arg, subtracts all but the first from the first. usage: (- &optional NUMBER-OR-MARKER &rest MORE-NUMBERS-OR-MARKERS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return arith_driver (Asub, nargs, args); } @@ -2642,7 +2643,7 @@ DEFUN ("*", Ftimes, Stimes, 0, MANY, 0, doc: /* Return product of any number of arguments, which are numbers or markers. usage: (* &rest NUMBERS-OR-MARKERS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return arith_driver (Amult, nargs, args); } @@ -2651,9 +2652,9 @@ doc: /* Return first argument divided by all the remaining arguments. The arguments must be numbers or markers. usage: (/ DIVIDEND DIVISOR &rest DIVISORS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { - int argnum; + size_t argnum; for (argnum = 2; argnum < nargs; argnum++) if (FLOATP (args[argnum])) return float_arith_driver (0, 0, Adiv, nargs, args); @@ -2735,7 +2736,7 @@ doc: /* Return largest of all the arguments (which must be numbers or markers). The value is always a number; markers are converted to numbers. usage: (max NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return arith_driver (Amax, nargs, args); } @@ -2744,7 +2745,7 @@ doc: /* Return smallest of all the arguments (which must be numbers or markers). The value is always a number; markers are converted to numbers. usage: (min NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return arith_driver (Amin, nargs, args); } @@ -2753,7 +2754,7 @@ doc: /* Return bitwise-and of all the arguments. Arguments may be integers, or markers converted to integers. usage: (logand &rest INTS-OR-MARKERS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return arith_driver (Alogand, nargs, args); } @@ -2762,7 +2763,7 @@ doc: /* Return bitwise-or of all the arguments. Arguments may be integers, or markers converted to integers. usage: (logior &rest INTS-OR-MARKERS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return arith_driver (Alogior, nargs, args); } @@ -2771,7 +2772,7 @@ doc: /* Return bitwise-exclusive-or of all the arguments. Arguments may be integers, or markers converted to integers. usage: (logxor &rest INTS-OR-MARKERS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return arith_driver (Alogxor, nargs, args); } === modified file 'src/dbusbind.c' --- src/dbusbind.c 2011-03-14 03:25:51 +0000 +++ src/dbusbind.c 2011-03-27 02:12:36 +0000 @@ -1051,7 +1051,7 @@ => "i686" usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TIMEOUT &rest ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { Lisp_Object bus, service, path, interface, method; Lisp_Object result; @@ -1063,7 +1063,7 @@ DBusError derror; unsigned int dtype; int timeout = -1; - int i = 5; + size_t i = 5; char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH]; /* Check parameters. */ @@ -1116,7 +1116,7 @@ { XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); - XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-4, + XD_DEBUG_MESSAGE ("Parameter%lu %s %s", (unsigned long) (i-4), SDATA (format2 ("%s", args[i], Qnil)), SDATA (format2 ("%s", args[i+1], Qnil))); ++i; @@ -1124,7 +1124,7 @@ else { XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); - XD_DEBUG_MESSAGE ("Parameter%d %s", i-4, + XD_DEBUG_MESSAGE ("Parameter%lu %s", (unsigned long) (i-4), SDATA (format2 ("%s", args[i], Qnil))); } @@ -1233,7 +1233,7 @@ -| i686 usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLER &optional :timeout TIMEOUT &rest ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { Lisp_Object bus, service, path, interface, method, handler; Lisp_Object result; @@ -1243,7 +1243,7 @@ DBusMessageIter iter; unsigned int dtype; int timeout = -1; - int i = 6; + size_t i = 6; char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH]; /* Check parameters. */ @@ -1298,7 +1298,7 @@ { XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); - XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-4, + XD_DEBUG_MESSAGE ("Parameter%lu %s %s", (unsigned long) (i-4), SDATA (format2 ("%s", args[i], Qnil)), SDATA (format2 ("%s", args[i+1], Qnil))); ++i; @@ -1306,7 +1306,7 @@ else { XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); - XD_DEBUG_MESSAGE ("Parameter%d %s", i-4, + XD_DEBUG_MESSAGE ("Parameter%lu %s", (unsigned long) (i - 4), SDATA (format2 ("%s", args[i], Qnil))); } @@ -1357,7 +1357,7 @@ This is an internal function, it shall not be used outside dbus.el. usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { Lisp_Object bus, serial, service; struct gcpro gcpro1, gcpro2, gcpro3; @@ -1365,7 +1365,7 @@ DBusMessage *dmessage; DBusMessageIter iter; unsigned int dtype; - int i; + size_t i; char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH]; /* Check parameters. */ @@ -1405,7 +1405,7 @@ { XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); - XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-2, + XD_DEBUG_MESSAGE ("Parameter%lu %s %s", (unsigned long) (i-2), SDATA (format2 ("%s", args[i], Qnil)), SDATA (format2 ("%s", args[i+1], Qnil))); ++i; @@ -1413,7 +1413,7 @@ else { XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); - XD_DEBUG_MESSAGE ("Parameter%d %s", i-2, + XD_DEBUG_MESSAGE ("Parameter%lu %s", (unsigned long) (i-2), SDATA (format2 ("%s", args[i], Qnil))); } @@ -1445,7 +1445,7 @@ This is an internal function, it shall not be used outside dbus.el. usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { Lisp_Object bus, serial, service; struct gcpro gcpro1, gcpro2, gcpro3; @@ -1453,7 +1453,7 @@ DBusMessage *dmessage; DBusMessageIter iter; unsigned int dtype; - int i; + size_t i; char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH]; /* Check parameters. */ @@ -1494,7 +1494,7 @@ { XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); - XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-2, + XD_DEBUG_MESSAGE ("Parameter%lu %s %s", (unsigned long) (i-2), SDATA (format2 ("%s", args[i], Qnil)), SDATA (format2 ("%s", args[i+1], Qnil))); ++i; @@ -1502,7 +1502,7 @@ else { XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); - XD_DEBUG_MESSAGE ("Parameter%d %s", i-2, + XD_DEBUG_MESSAGE ("Parameter%lu %s", (unsigned long) (i-2), SDATA (format2 ("%s", args[i], Qnil))); } @@ -1557,7 +1557,7 @@ "org.gnu.Emacs.FileManager" "FileModified" "/home/albinus/.emacs") usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { Lisp_Object bus, service, path, interface, signal; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; @@ -1565,7 +1565,7 @@ DBusMessage *dmessage; DBusMessageIter iter; unsigned int dtype; - int i; + size_t i; char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH]; /* Check parameters. */ @@ -1609,7 +1609,7 @@ { XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); - XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-4, + XD_DEBUG_MESSAGE ("Parameter%lu %s %s", (unsigned long) (i-4), SDATA (format2 ("%s", args[i], Qnil)), SDATA (format2 ("%s", args[i+1], Qnil))); ++i; @@ -1617,7 +1617,7 @@ else { XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); - XD_DEBUG_MESSAGE ("Parameter%d %s", i-4, + XD_DEBUG_MESSAGE ("Parameter%lu %s", (unsigned long) (i-4), SDATA (format2 ("%s", args[i], Qnil))); } @@ -1885,11 +1885,11 @@ => :already-owner. usage: (dbus-register-service BUS SERVICE &rest FLAGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { Lisp_Object bus, service; DBusConnection *connection; - unsigned int i; + size_t i; unsigned int value; unsigned int flags = 0; int result; @@ -1985,13 +1985,13 @@ `dbus-unregister-object' for removing the registration. usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { Lisp_Object bus, service, path, interface, signal, handler; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6; Lisp_Object uname, key, key1, value; DBusConnection *connection; - int i; + size_t i; char rule[DBUS_MAXIMUM_MATCH_RULE_LENGTH]; char x[DBUS_MAXIMUM_MATCH_RULE_LENGTH]; DBusError derror; @@ -2061,7 +2061,8 @@ if (!NILP (args[i])) { CHECK_STRING (args[i]); - sprintf (x, ",arg%d='%s'", i-6, SDATA (args[i])); + sprintf (x, ",arg%lu='%s'", (unsigned long) (i-6), + SDATA (args[i])); strcat (rule, x); } === modified file 'src/dispnew.c' --- src/dispnew.c 2011-03-27 02:27:11 +0000 +++ src/dispnew.c 2011-03-29 06:57:40 +0000 @@ -3590,7 +3590,10 @@ struct glyph_row *row, *end; struct glyph_row *mode_line_row; struct glyph_row *header_line_row; - int yb, changed_p = 0, mouse_face_overwritten_p = 0, n_updated; + int yb, changed_p = 0, mouse_face_overwritten_p = 0; +#if ! PERIODIC_PREEMPTION_CHECKING + int n_updated = 0; +#endif rif->update_window_begin_hook (w); yb = window_text_bottom_y (w); @@ -3643,7 +3646,7 @@ } /* Update the rest of the lines. */ - for (n_updated = 0; row < end && (force_p || !input_pending); ++row) + for (; row < end && (force_p || !input_pending); ++row) if (row->enabled_p) { int vpos = MATRIX_ROW_VPOS (row, desired_matrix); === modified file 'src/editfns.c' --- src/editfns.c 2011-03-28 22:41:01 +0000 +++ src/editfns.c 2011-03-30 00:17:26 +0000 @@ -101,7 +101,7 @@ void (*) (Lisp_Object, EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT, int), - int, int, Lisp_Object *); + int, size_t, Lisp_Object *); static Lisp_Object subst_char_in_region_unwind (Lisp_Object); static Lisp_Object subst_char_in_region_unwind_1 (Lisp_Object); static void transpose_markers (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT, @@ -1871,7 +1871,7 @@ year values as low as 1901 do work. usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { time_t value; struct tm tm; @@ -2207,9 +2207,9 @@ void (*insert_from_string_func) (Lisp_Object, EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT, int), - int inherit, int nargs, Lisp_Object *args) + int inherit, size_t nargs, Lisp_Object *args) { - register int argnum; + register size_t argnum; register Lisp_Object val; for (argnum = 0; argnum < nargs; argnum++) @@ -2272,7 +2272,7 @@ and insert the result. usage: (insert &rest ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { general_insert_function (insert, insert_from_string, 0, nargs, args); return Qnil; @@ -2291,7 +2291,7 @@ to unibyte for insertion. usage: (insert-and-inherit &rest ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { general_insert_function (insert_and_inherit, insert_from_string, 1, nargs, args); @@ -2308,7 +2308,7 @@ to unibyte for insertion. usage: (insert-before-markers &rest ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { general_insert_function (insert_before_markers, insert_from_string_before_markers, 0, @@ -2327,7 +2327,7 @@ to unibyte for insertion. usage: (insert-before-markers-and-inherit &rest ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { general_insert_function (insert_before_markers_and_inherit, insert_from_string_before_markers, 1, @@ -3399,7 +3399,7 @@ also `current-message'. usage: (message FORMAT-STRING &rest ARGS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { if (NILP (args[0]) || (STRINGP (args[0]) @@ -3427,7 +3427,7 @@ message; let the minibuffer contents show. usage: (message-box FORMAT-STRING &rest ARGS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { if (NILP (args[0])) { @@ -3444,12 +3444,12 @@ if (FRAME_WINDOW_P (XFRAME (selected_frame)) || FRAME_MSDOS_P (XFRAME (selected_frame))) { - Lisp_Object pane, menu, obj; + Lisp_Object pane, menu; struct gcpro gcpro1; pane = Fcons (Fcons (build_string ("OK"), Qt), Qnil); GCPRO1 (pane); menu = Fcons (val, pane); - obj = Fx_popup_dialog (Qt, menu, Qt); + Fx_popup_dialog (Qt, menu, Qt); UNGCPRO; return val; } @@ -3484,7 +3484,7 @@ message; let the minibuffer contents show. usage: (message-or-box FORMAT-STRING &rest ARGS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { #ifdef HAVE_MENUS if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) @@ -3508,14 +3508,14 @@ Remaining arguments form a sequence of PROPERTY VALUE pairs for text properties to add to the result. usage: (propertize STRING &rest PROPERTIES) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { Lisp_Object properties, string; struct gcpro gcpro1, gcpro2; - int i; + size_t i; /* Number of args must be odd. */ - if ((nargs & 1) == 0 || nargs < 1) + if ((nargs & 1) == 0) error ("Wrong number of arguments"); properties = string = Qnil; @@ -3590,10 +3590,10 @@ specifier truncates the string to the given width. usage: (format STRING &rest OBJECTS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { - register int n; /* The number of the next arg to substitute */ - register EMACS_INT total; /* An estimate of the final length */ + register size_t n; /* The number of the next arg to substitute */ + register size_t total; /* An estimate of the final length */ char *buf, *p; register char *format, *end, *format_start; int nchars; @@ -3669,8 +3669,8 @@ /* Allocate the info and discarded tables. */ { - int nbytes = (nargs+1) * sizeof *info; - int i; + size_t nbytes = (nargs+1) * sizeof *info; + size_t i; if (!info) info = (struct info *) alloca (nbytes); memset (info, 0, nbytes); === modified file 'src/eval.c' --- src/eval.c 2011-03-28 20:26:35 +0000 +++ src/eval.c 2011-03-30 00:39:12 +0000 @@ -38,9 +38,9 @@ struct backtrace *next; Lisp_Object *function; Lisp_Object *args; /* Points to vector of args. */ - int nargs; /* Length of vector. - If nargs is UNEVALLED, args points to slot holding - list of unevalled args. */ + size_t nargs; /* Length of vector. + If nargs is (size_t) UNEVALLED, args points + to slot holding list of unevalled args. */ char evalargs; /* Nonzero means call value of debugger when done with this operation. */ char debug_on_exit; @@ -111,7 +111,7 @@ int handling_signal; -static Lisp_Object funcall_lambda (Lisp_Object, int, Lisp_Object*); +static Lisp_Object funcall_lambda (Lisp_Object, size_t, Lisp_Object*); static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN; static int interactive_p (int); static Lisp_Object apply_lambda (Lisp_Object, Lisp_Object, int); @@ -553,7 +553,7 @@ looking at several frames for special forms. Skip past them. */ while (btp && (EQ (*btp->function, Qbytecode) - || btp->nargs == UNEVALLED)) + || btp->nargs == (size_t) UNEVALLED)) btp = btp->next; /* `btp' now points at the frame of the innermost function that isn't @@ -959,7 +959,7 @@ Lisp_Object *temps, tem; register Lisp_Object elt, varlist; int count = SPECPDL_INDEX (); - register int argnum; + register size_t argnum; struct gcpro gcpro1, gcpro2; USE_SAFE_ALLOCA; @@ -1508,8 +1508,8 @@ and ARGS as second argument. */ Lisp_Object -internal_condition_case_n (Lisp_Object (*bfun) (int, Lisp_Object*), - int nargs, +internal_condition_case_n (Lisp_Object (*bfun) (size_t, Lisp_Object *), + size_t nargs, Lisp_Object *args, Lisp_Object handlers, Lisp_Object (*hfun) (Lisp_Object)) @@ -2201,7 +2201,7 @@ { /* Pass a vector of evaluated arguments. */ Lisp_Object *vals; - register int argnum = 0; + register size_t argnum = 0; USE_SAFE_ALLOCA; SAFE_ALLOCA_LISP (vals, XINT (numargs)); @@ -2330,9 +2330,9 @@ Then return the value FUNCTION returns. Thus, (apply '+ 1 2 '(3 4)) returns 10. usage: (apply FUNCTION &rest ARGUMENTS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { - register int i, numargs; + register size_t i, numargs; register Lisp_Object spread_arg; register Lisp_Object *funcall_args; Lisp_Object fun, retval; @@ -2372,7 +2372,7 @@ if (numargs < XSUBR (fun)->min_args || (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args < numargs)) goto funcall; /* Let funcall get the error. */ - else if (XSUBR (fun)->max_args > numargs) + else if (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args > numargs) { /* Avoid making funcall cons up a yet another new vector of arguments by explicitly supplying nil's for optional values. */ @@ -2413,12 +2413,8 @@ /* Run hook variables in various ways. */ -Lisp_Object run_hook_with_args (int, Lisp_Object *, - Lisp_Object (*funcall) - (int nargs, Lisp_Object *args)); - static Lisp_Object -funcall_nil (int nargs, Lisp_Object *args) +funcall_nil (size_t nargs, Lisp_Object *args) { Ffuncall (nargs, args); return Qnil; @@ -2439,10 +2435,10 @@ Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. usage: (run-hooks &rest HOOKS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { Lisp_Object hook[1]; - register int i; + register size_t i; for (i = 0; i < nargs; i++) { @@ -2468,7 +2464,7 @@ Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. usage: (run-hook-with-args HOOK &rest ARGS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return run_hook_with_args (nargs, args, funcall_nil); } @@ -2488,13 +2484,13 @@ Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. usage: (run-hook-with-args-until-success HOOK &rest ARGS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return run_hook_with_args (nargs, args, Ffuncall); } static Lisp_Object -funcall_not (int nargs, Lisp_Object *args) +funcall_not (size_t nargs, Lisp_Object *args) { return NILP (Ffuncall (nargs, args)) ? Qt : Qnil; } @@ -2513,13 +2509,13 @@ Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. usage: (run-hook-with-args-until-failure HOOK &rest ARGS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return NILP (run_hook_with_args (nargs, args, funcall_not)) ? Qt : Qnil; } static Lisp_Object -run_hook_wrapped_funcall (int nargs, Lisp_Object *args) +run_hook_wrapped_funcall (size_t nargs, Lisp_Object *args) { Lisp_Object tmp = args[0], ret; args[0] = args[1]; @@ -2537,11 +2533,11 @@ As soon as a call to WRAP-FUNCTION returns non-nil, `run-hook-wrapped' aborts and returns that value. usage: (run-hook-wrapped HOOK WRAP-FUNCTION &rest ARGS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return run_hook_with_args (nargs, args, run_hook_wrapped_funcall); } - + /* ARGS[0] should be a hook symbol. Call each of the functions in the hook value, passing each of them as arguments all the rest of ARGS (all NARGS - 1 elements). @@ -2550,8 +2546,8 @@ except that it isn't necessary to gcpro ARGS[0]. */ Lisp_Object -run_hook_with_args (int nargs, Lisp_Object *args, - Lisp_Object (*funcall) (int nargs, Lisp_Object *args)) +run_hook_with_args (size_t nargs, Lisp_Object *args, + Lisp_Object (*funcall) (size_t nargs, Lisp_Object *args)) { Lisp_Object sym, val, ret = Qnil; struct gcpro gcpro1, gcpro2, gcpro3; @@ -2791,16 +2787,16 @@ Return the value that function returns. Thus, (funcall 'cons 'x 'y) returns (x . y). usage: (funcall FUNCTION &rest ARGUMENTS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { Lisp_Object fun, original_fun; Lisp_Object funcar; - int numargs = nargs - 1; + size_t numargs = nargs - 1; Lisp_Object lisp_numargs; Lisp_Object val; struct backtrace backtrace; register Lisp_Object *internal_args; - register int i; + register size_t i; QUIT; if ((consing_since_gc > gc_cons_threshold @@ -2953,21 +2949,21 @@ apply_lambda (Lisp_Object fun, Lisp_Object args, int eval_flag) { Lisp_Object args_left; - Lisp_Object numargs; + size_t numargs; register Lisp_Object *arg_vector; struct gcpro gcpro1, gcpro2, gcpro3; - register int i; + register size_t i; register Lisp_Object tem; USE_SAFE_ALLOCA; - numargs = Flength (args); - SAFE_ALLOCA_LISP (arg_vector, XINT (numargs)); + numargs = XINT (Flength (args)); + SAFE_ALLOCA_LISP (arg_vector, numargs); args_left = args; GCPRO3 (*arg_vector, args_left, fun); gcpro1.nvars = 0; - for (i = 0; i < XINT (numargs);) + for (i = 0; i < numargs; ) { tem = Fcar (args_left), args_left = Fcdr (args_left); if (eval_flag) tem = Feval (tem); @@ -2983,7 +2979,7 @@ backtrace_list->nargs = i; } backtrace_list->evalargs = 0; - tem = funcall_lambda (fun, XINT (numargs), arg_vector); + tem = funcall_lambda (fun, numargs, arg_vector); /* Do the debug-on-exit now, while arg_vector still exists. */ if (backtrace_list->debug_on_exit) @@ -2999,11 +2995,13 @@ FUN must be either a lambda-expression or a compiled-code object. */ static Lisp_Object -funcall_lambda (Lisp_Object fun, int nargs, register Lisp_Object *arg_vector) +funcall_lambda (Lisp_Object fun, size_t nargs, + register Lisp_Object *arg_vector) { Lisp_Object val, syms_left, next; int count = SPECPDL_INDEX (); - int i, optional, rest; + size_t i; + int optional, rest; if (CONSP (fun)) { @@ -3323,7 +3321,6 @@ (void) { register struct backtrace *backlist = backtrace_list; - register int i; Lisp_Object tail; Lisp_Object tem; struct gcpro gcpro1; @@ -3338,7 +3335,7 @@ while (backlist) { write_string (backlist->debug_on_exit ? "* " : " ", 2); - if (backlist->nargs == UNEVALLED) + if (backlist->nargs == (size_t) UNEVALLED) { Fprin1 (Fcons (*backlist->function, *backlist->args), Qnil); write_string ("\n", -1); @@ -3348,11 +3345,12 @@ tem = *backlist->function; Fprin1 (tem, Qnil); /* This can QUIT. */ write_string ("(", -1); - if (backlist->nargs == MANY) + if (backlist->nargs == (size_t) MANY) { + int i; for (tail = *backlist->args, i = 0; !NILP (tail); - tail = Fcdr (tail), i++) + tail = Fcdr (tail), i = 1) { if (i) write_string (" ", -1); Fprin1 (Fcar (tail), Qnil); @@ -3360,6 +3358,7 @@ } else { + size_t i; for (i = 0; i < backlist->nargs; i++) { if (i) write_string (" ", -1); @@ -3389,7 +3388,7 @@ (Lisp_Object nframes) { register struct backtrace *backlist = backtrace_list; - register int i; + register EMACS_INT i; Lisp_Object tem; CHECK_NATNUM (nframes); @@ -3400,11 +3399,11 @@ if (!backlist) return Qnil; - if (backlist->nargs == UNEVALLED) + if (backlist->nargs == (size_t) UNEVALLED) return Fcons (Qnil, Fcons (*backlist->function, *backlist->args)); else { - if (backlist->nargs == MANY) + if (backlist->nargs == (size_t) MANY) tem = *backlist->args; else tem = Flist (backlist->nargs, backlist->args); @@ -3418,17 +3417,18 @@ mark_backtrace (void) { register struct backtrace *backlist; - register int i; + register size_t i; for (backlist = backtrace_list; backlist; backlist = backlist->next) { mark_object (*backlist->function); - if (backlist->nargs == UNEVALLED || backlist->nargs == MANY) - i = 0; + if (backlist->nargs == (size_t) UNEVALLED + || backlist->nargs == (size_t) MANY) + i = 1; else - i = backlist->nargs - 1; - for (; i >= 0; i--) + i = backlist->nargs; + while (i--) mark_object (backlist->args[i]); } } === modified file 'src/fns.c' --- src/fns.c 2011-03-16 07:49:54 +0000 +++ src/fns.c 2011-03-27 02:12:36 +0000 @@ -348,7 +348,7 @@ return i1 < SCHARS (s2) ? Qt : Qnil; } -static Lisp_Object concat (int nargs, Lisp_Object *args, +static Lisp_Object concat (size_t nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_special); /* ARGSUSED */ @@ -378,7 +378,7 @@ Each argument may be a list, vector or string. The last argument is not copied, just used as the tail of the new list. usage: (append &rest SEQUENCES) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return concat (nargs, args, Lisp_Cons, 1); } @@ -388,7 +388,7 @@ The result is a string whose elements are the elements of all the arguments. Each argument may be a string or a list or vector of characters (integers). usage: (concat &rest SEQUENCES) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return concat (nargs, args, Lisp_String, 0); } @@ -398,7 +398,7 @@ The result is a vector whose elements are the elements of all the arguments. Each argument may be a list, vector or string. usage: (vconcat &rest SEQUENCES) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { return concat (nargs, args, Lisp_Vectorlike, 0); } @@ -446,7 +446,8 @@ }; static Lisp_Object -concat (int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_special) +concat (size_t nargs, Lisp_Object *args, + enum Lisp_Type target_type, int last_special) { Lisp_Object val; register Lisp_Object tail; @@ -455,7 +456,7 @@ EMACS_INT toindex_byte = 0; register EMACS_INT result_len; register EMACS_INT result_len_byte; - register int argnum; + register size_t argnum; Lisp_Object last_tail; Lisp_Object prev; int some_multibyte; @@ -2232,9 +2233,9 @@ doc: /* Concatenate any number of lists by altering them. Only the last argument is not altered, and need not be a list. usage: (nconc &rest LISTS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { - register int argnum; + register size_t argnum; register Lisp_Object tail, tem, val; val = tail = Qnil; @@ -2763,7 +2764,7 @@ doc: /* Apply the value of WIDGET's PROPERTY to the widget itself. ARGS are passed as extra arguments to the function. usage: (widget-apply WIDGET PROPERTY &rest ARGS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { /* This function can GC. */ Lisp_Object newargs[3]; @@ -3367,7 +3368,7 @@ /* Function prototypes. */ static struct Lisp_Hash_Table *check_hash_table (Lisp_Object); -static int get_key_arg (Lisp_Object, int, Lisp_Object *, char *); +static size_t get_key_arg (Lisp_Object, size_t, Lisp_Object *, char *); static void maybe_resize_hash_table (struct Lisp_Hash_Table *); static int cmpfn_eql (struct Lisp_Hash_Table *, Lisp_Object, unsigned, Lisp_Object, unsigned); @@ -3422,27 +3423,23 @@ /* Find KEY in ARGS which has size NARGS. Don't consider indices for which USED[I] is non-zero. If found at index I in ARGS, set USED[I] and USED[I + 1] to 1, and return I + 1. Otherwise return - -1. This function is used to extract a keyword/argument pair from + 0. This function is used to extract a keyword/argument pair from a DEFUN parameter list. */ -static int -get_key_arg (Lisp_Object key, int nargs, Lisp_Object *args, char *used) +static size_t +get_key_arg (Lisp_Object key, size_t nargs, Lisp_Object *args, char *used) { - int i; - - for (i = 0; i < nargs - 1; ++i) - if (!used[i] && EQ (args[i], key)) - break; - - if (i >= nargs - 1) - i = -1; - else - { - used[i++] = 1; - used[i] = 1; - } - - return i; + size_t i; + + for (i = 1; i < nargs; i++) + if (!used[i - 1] && EQ (args[i - 1], key)) + { + used[i - 1] = 1; + used[i] = 1; + return i; + } + + return 0; } @@ -4290,12 +4287,12 @@ is nil. usage: (make-hash-table &rest KEYWORD-ARGS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { Lisp_Object test, size, rehash_size, rehash_threshold, weak; Lisp_Object user_test, user_hash; char *used; - int i; + size_t i; /* The vector `used' is used to keep track of arguments that have been consumed. */ @@ -4304,7 +4301,7 @@ /* See if there's a `:test TEST' among the arguments. */ i = get_key_arg (QCtest, nargs, args, used); - test = i < 0 ? Qeql : args[i]; + test = i ? args[i] : Qeql; if (!EQ (test, Qeq) && !EQ (test, Qeql) && !EQ (test, Qequal)) { /* See if it is a user-defined test. */ @@ -4321,7 +4318,7 @@ /* See if there's a `:size SIZE' argument. */ i = get_key_arg (QCsize, nargs, args, used); - size = i < 0 ? Qnil : args[i]; + size = i ? args[i] : Qnil; if (NILP (size)) size = make_number (DEFAULT_HASH_SIZE); else if (!INTEGERP (size) || XINT (size) < 0) @@ -4329,7 +4326,7 @@ /* Look for `:rehash-size SIZE'. */ i = get_key_arg (QCrehash_size, nargs, args, used); - rehash_size = i < 0 ? make_float (DEFAULT_REHASH_SIZE) : args[i]; + rehash_size = i ? args[i] : make_float (DEFAULT_REHASH_SIZE); if (!NUMBERP (rehash_size) || (INTEGERP (rehash_size) && XINT (rehash_size) <= 0) || XFLOATINT (rehash_size) <= 1.0) @@ -4337,7 +4334,7 @@ /* Look for `:rehash-threshold THRESHOLD'. */ i = get_key_arg (QCrehash_threshold, nargs, args, used); - rehash_threshold = i < 0 ? make_float (DEFAULT_REHASH_THRESHOLD) : args[i]; + rehash_threshold = i ? args[i] : make_float (DEFAULT_REHASH_THRESHOLD); if (!FLOATP (rehash_threshold) || XFLOATINT (rehash_threshold) <= 0.0 || XFLOATINT (rehash_threshold) > 1.0) @@ -4345,7 +4342,7 @@ /* Look for `:weakness WEAK'. */ i = get_key_arg (QCweakness, nargs, args, used); - weak = i < 0 ? Qnil : args[i]; + weak = i ? args[i] : Qnil; if (EQ (weak, Qt)) weak = Qkey_and_value; if (!NILP (weak) === modified file 'src/font.c' --- src/font.c 2011-03-16 21:23:37 +0000 +++ src/font.c 2011-03-27 02:12:36 +0000 @@ -3831,10 +3831,10 @@ language system must contain `mark' feature. usage: (font-spec ARGS...) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { Lisp_Object spec = font_make_spec (); - int i; + size_t i; for (i = 0; i < nargs; i += 2) { === modified file 'src/frame.c' --- src/frame.c 2011-03-23 10:06:57 +0000 +++ src/frame.c 2011-03-27 02:12:36 +0000 @@ -2902,7 +2902,7 @@ /* Record in these vectors all the parms specified. */ Lisp_Object *parms; Lisp_Object *values; - int i, p; + size_t i, p; int left_no_change = 0, top_no_change = 0; int icon_left_no_change = 0, icon_top_no_change = 0; int size_changed = 0; @@ -2975,7 +2975,7 @@ } /* Now process them in reverse of specified order. */ - for (i--; i >= 0; i--) + while (i-- != 0) { Lisp_Object prop, val; === modified file 'src/image.c' --- src/image.c 2011-03-25 15:39:59 +0000 +++ src/image.c 2011-03-27 08:15:26 +0000 @@ -6753,7 +6753,7 @@ TIFF *tiff; int width, height, x, y, count; uint32 *buf; - int rc, rc2; + int rc; XImagePtr ximg; tiff_memory_source memsrc; Lisp_Object image; @@ -6841,8 +6841,8 @@ rc = fn_TIFFReadRGBAImage (tiff, width, height, buf, 0); /* Count the number of images in the file. */ - for (count = 1, rc2 = 1; rc2; count++) - rc2 = fn_TIFFSetDirectory (tiff, count); + for (count = 1; fn_TIFFSetDirectory (tiff, count); count++) + continue; if (count > 1) img->data.lisp_val = Fcons (Qcount, === modified file 'src/keyboard.c' --- src/keyboard.c 2011-03-28 20:26:35 +0000 +++ src/keyboard.c 2011-03-29 23:35:49 +0000 @@ -201,8 +201,8 @@ /* Last size recorded for a current buffer which is not a minibuffer. */ static EMACS_INT last_non_minibuf_size; -/* Total number of times read_char has returned. */ -int num_input_events; +/* Total number of times read_char has returned, modulo SIZE_MAX + 1. */ +size_t num_input_events; /* Value of num_nonmacro_input_events as of last auto save. */ @@ -1269,7 +1269,7 @@ /* This is the actual command reading loop, sans error-handling encapsulation. */ -static int read_key_sequence (Lisp_Object *, int, Lisp_Object, +static int read_key_sequence (Lisp_Object *, size_t, Lisp_Object, int, int, int); void safe_run_hooks (Lisp_Object); static void adjust_point_for_property (EMACS_INT, int); @@ -1862,7 +1862,7 @@ } static Lisp_Object -safe_run_hook_funcall (int nargs, Lisp_Object *args) +safe_run_hook_funcall (size_t nargs, Lisp_Object *args) { eassert (nargs == 1); if (CONSP (Vinhibit_quit)) @@ -6004,10 +6004,10 @@ This doesn't use any caches. */ static int -parse_modifiers_uncached (Lisp_Object symbol, int *modifier_end) +parse_modifiers_uncached (Lisp_Object symbol, EMACS_INT *modifier_end) { Lisp_Object name; - int i; + EMACS_INT i; int modifiers; CHECK_SYMBOL (symbol); @@ -6017,7 +6017,7 @@ for (i = 0; i+2 <= SBYTES (name); ) { - int this_mod_end = 0; + EMACS_INT this_mod_end = 0; int this_mod = 0; /* See if the name continues with a modifier word. @@ -6214,7 +6214,7 @@ return elements; else { - int end; + EMACS_INT end; int modifiers = parse_modifiers_uncached (symbol, &end); Lisp_Object unmodified; Lisp_Object mask; @@ -8793,7 +8793,7 @@ The return value is non-zero if the remapping actually took place. */ static int -keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey, +keyremap_step (Lisp_Object *keybuf, size_t bufsize, volatile keyremap *fkey, int input, int doit, int *diff, Lisp_Object prompt) { Lisp_Object next, key; @@ -8886,7 +8886,7 @@ from the selected window's buffer. */ static int -read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, +read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt, int dont_downcase_last, int can_return_switch_frame, int fix_current_buffer) { @@ -9404,80 +9404,84 @@ last_real_key_start = t - 1; } - /* Key sequences beginning with mouse clicks are - read using the keymaps in the buffer clicked on, - not the current buffer. If we're at the - beginning of a key sequence, switch buffers. */ - if (last_real_key_start == 0 - && WINDOWP (window) - && BUFFERP (XWINDOW (window)->buffer) - && XBUFFER (XWINDOW (window)->buffer) != current_buffer) - { - XVECTOR (raw_keybuf)->contents[raw_keybuf_count++] = key; - keybuf[t] = key; - mock_input = t + 1; - - /* Arrange to go back to the original buffer once we're - done reading the key sequence. Note that we can't - use save_excursion_{save,restore} here, because they - save point as well as the current buffer; we don't - want to save point, because redisplay may change it, - to accommodate a Fset_window_start or something. We - don't want to do this at the top of the function, - because we may get input from a subprocess which - wants to change the selected window and stuff (say, - emacsclient). */ - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - - if (! FRAME_LIVE_P (XFRAME (selected_frame))) - Fkill_emacs (Qnil); - set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); - orig_local_map = get_local_map (PT, current_buffer, - Qlocal_map); - orig_keymap = get_local_map (PT, current_buffer, Qkeymap); - goto replay_sequence; - } - - /* For a mouse click, get the local text-property keymap - of the place clicked on, rather than point. */ - if (last_real_key_start == 0 - && CONSP (XCDR (key)) - && ! localized_local_map) - { - Lisp_Object map_here, start, pos; - - localized_local_map = 1; - start = EVENT_START (key); - - if (CONSP (start) && POSN_INBUFFER_P (start)) - { - pos = POSN_BUFFER_POSN (start); - if (INTEGERP (pos) - && XINT (pos) >= BEGV - && XINT (pos) <= ZV) + if (last_real_key_start == 0) + { + /* Key sequences beginning with mouse clicks are + read using the keymaps in the buffer clicked on, + not the current buffer. If we're at the + beginning of a key sequence, switch buffers. */ + if (WINDOWP (window) + && BUFFERP (XWINDOW (window)->buffer) + && XBUFFER (XWINDOW (window)->buffer) != current_buffer) + { + XVECTOR (raw_keybuf)->contents[raw_keybuf_count++] = key; + keybuf[t] = key; + mock_input = t + 1; + + /* Arrange to go back to the original buffer once we're + done reading the key sequence. Note that we can't + use save_excursion_{save,restore} here, because they + save point as well as the current buffer; we don't + want to save point, because redisplay may change it, + to accommodate a Fset_window_start or something. We + don't want to do this at the top of the function, + because we may get input from a subprocess which + wants to change the selected window and stuff (say, + emacsclient). */ + record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + + if (! FRAME_LIVE_P (XFRAME (selected_frame))) + Fkill_emacs (Qnil); + set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); + orig_local_map = get_local_map (PT, current_buffer, + Qlocal_map); + orig_keymap = get_local_map (PT, current_buffer, + Qkeymap); + goto replay_sequence; + } + + /* For a mouse click, get the local text-property keymap + of the place clicked on, rather than point. */ + if (CONSP (XCDR (key)) + && ! localized_local_map) + { + Lisp_Object map_here, start, pos; + + localized_local_map = 1; + start = EVENT_START (key); + + if (CONSP (start) && POSN_INBUFFER_P (start)) { - map_here = get_local_map (XINT (pos), - current_buffer, Qlocal_map); - if (!EQ (map_here, orig_local_map)) - { - orig_local_map = map_here; - ++localized_local_map; - } - - map_here = get_local_map (XINT (pos), - current_buffer, Qkeymap); - if (!EQ (map_here, orig_keymap)) - { - orig_keymap = map_here; - ++localized_local_map; - } - - if (localized_local_map > 1) - { - keybuf[t] = key; - mock_input = t + 1; - - goto replay_sequence; + pos = POSN_BUFFER_POSN (start); + if (INTEGERP (pos) + && XINT (pos) >= BEGV + && XINT (pos) <= ZV) + { + map_here = get_local_map (XINT (pos), + current_buffer, + Qlocal_map); + if (!EQ (map_here, orig_local_map)) + { + orig_local_map = map_here; + ++localized_local_map; + } + + map_here = get_local_map (XINT (pos), + current_buffer, + Qkeymap); + if (!EQ (map_here, orig_keymap)) + { + orig_keymap = map_here; + ++localized_local_map; + } + + if (localized_local_map > 1) + { + keybuf[t] = key; + mock_input = t + 1; + + goto replay_sequence; + } } } } @@ -11602,12 +11606,12 @@ last_point_position_window = Qnil; { - const struct event_head *p; + int i; + int len = sizeof (head_table) / sizeof (head_table[0]); - for (p = head_table; - p < head_table + (sizeof (head_table) / sizeof (head_table[0])); - p++) + for (i = 0; i < len; i++) { + const struct event_head *p = &head_table[i]; *p->var = intern_c_string (p->name); staticpro (p->var); Fput (*p->var, Qevent_kind, *p->kind); === modified file 'src/keyboard.h' --- src/keyboard.h 2011-03-27 02:27:11 +0000 +++ src/keyboard.h 2011-03-27 02:32:40 +0000 @@ -194,8 +194,8 @@ /* Nonzero in the single-kboard state, 0 in the any-kboard state. */ extern int single_kboard; -/* Total number of times read_char has returned. */ -extern int num_input_events; +/* Total number of times read_char has returned, modulo SIZE_MAX + 1. */ +extern size_t num_input_events; /* Nonzero means polling for input is temporarily suppressed. */ extern int poll_suppress_count; === modified file 'src/lisp.h' --- src/lisp.h 2011-03-28 22:41:01 +0000 +++ src/lisp.h 2011-03-29 23:35:49 +0000 @@ -964,7 +964,7 @@ Lisp_Object (*a7) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); Lisp_Object (*a8) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); Lisp_Object (*aUNEVALLED) (Lisp_Object args); - Lisp_Object (*aMANY) (int, Lisp_Object *); + Lisp_Object (*aMANY) (size_t, Lisp_Object *); } function; short min_args, max_args; const char *symbol_name; @@ -1809,7 +1809,7 @@ /* Note that the weird token-substitution semantics of ANSI C makes this work for MANY and UNEVALLED. */ -#define DEFUN_ARGS_MANY (int, Lisp_Object *) +#define DEFUN_ARGS_MANY (size_t, Lisp_Object *) #define DEFUN_ARGS_UNEVALLED (Lisp_Object) #define DEFUN_ARGS_0 (void) #define DEFUN_ARGS_1 (Lisp_Object) @@ -2079,7 +2079,7 @@ volatile Lisp_Object *var; /* Number of consecutive protected variables. */ - int nvars; + size_t nvars; #ifdef DEBUG_GCPRO int level; @@ -2830,9 +2830,9 @@ EXFUN (Frun_hook_with_args, MANY); EXFUN (Frun_hook_with_args_until_failure, MANY); extern void run_hook_with_args_2 (Lisp_Object, Lisp_Object, Lisp_Object); -extern Lisp_Object run_hook_with_args (int nargs, Lisp_Object *args, +extern Lisp_Object run_hook_with_args (size_t nargs, Lisp_Object *args, Lisp_Object (*funcall) - (int nargs, Lisp_Object *args)); + (size_t nargs, Lisp_Object *args)); EXFUN (Fprogn, UNEVALLED); EXFUN (Finteractive_p, 0); EXFUN (Fthrow, 2) NO_RETURN; @@ -2863,7 +2863,7 @@ extern Lisp_Object internal_condition_case (Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object)); extern Lisp_Object internal_condition_case_1 (Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)); extern Lisp_Object internal_condition_case_2 (Lisp_Object (*) (Lisp_Object, Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)); -extern Lisp_Object internal_condition_case_n (Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object)); +extern Lisp_Object internal_condition_case_n (Lisp_Object (*) (size_t, Lisp_Object *), size_t, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object)); extern void specbind (Lisp_Object, Lisp_Object); extern void record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object); extern Lisp_Object unbind_to (int, Lisp_Object); @@ -2873,7 +2873,7 @@ extern Lisp_Object un_autoload (Lisp_Object); EXFUN (Ffetch_bytecode, 1); extern void init_eval_once (void); -extern Lisp_Object safe_call (int, Lisp_Object *); +extern Lisp_Object safe_call (size_t, Lisp_Object *); extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object); extern void init_eval (void); === modified file 'src/menu.c' --- src/menu.c 2011-01-26 08:36:39 +0000 +++ src/menu.c 2011-03-29 06:58:36 +0000 @@ -662,13 +662,12 @@ else if (EQ (XVECTOR (menu_items)->contents[i], Qt)) { /* Create a new pane. */ - Lisp_Object pane_name, prefix; + Lisp_Object pane_name; const char *pane_string; panes_seen++; pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; - prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; #ifdef HAVE_NTGUI if (STRINGP (pane_name)) === modified file 'src/process.c' --- src/process.c 2011-03-27 02:27:11 +0000 +++ src/process.c 2011-03-27 02:32:40 +0000 @@ -1512,11 +1512,11 @@ syntax. usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) - (int nargs, register Lisp_Object *args) + (size_t nargs, register Lisp_Object *args) { Lisp_Object buffer, name, program, proc, current_dir, tem; register unsigned char **new_argv; - register int i; + register size_t i; int count = SPECPDL_INDEX (); buffer = args[1]; @@ -1722,7 +1722,7 @@ new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *)); new_argv[nargs - 2] = 0; - for (i = nargs - 3; i >= 0; i--) + for (i = nargs - 2; i-- != 0; ) { new_argv[i] = SDATA (XCAR (tem)); tem = XCDR (tem); @@ -2681,7 +2681,7 @@ \(serial-process-configure :port "\\\\.\\COM13" :bytesize 7) usage: (serial-process-configure &rest ARGS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { struct Lisp_Process *p; Lisp_Object contact = Qnil; @@ -2799,7 +2799,7 @@ \(make-serial-process :port "/dev/tty.BlueConsole-SPP-1" :speed nil) usage: (make-serial-process &rest ARGS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { int fd = -1; Lisp_Object proc, contact, port; @@ -3077,7 +3077,7 @@ information, is available via the `process-contact' function. usage: (make-network-process &rest ARGS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { Lisp_Object proc; Lisp_Object contact; @@ -3393,7 +3393,8 @@ for (lres = res; lres; lres = lres->ai_next) { - int optn, optbits; + size_t optn; + int optbits; #ifdef WINDOWSNT retry_connect: === modified file 'src/syntax.c' --- src/syntax.c 2011-03-16 21:47:59 +0000 +++ src/syntax.c 2011-03-27 08:21:49 +0000 @@ -3265,9 +3265,9 @@ = (curlevel == levelstart) ? -1 : (curlevel - 1)->last; state.location = from; state.levelstarts = Qnil; - while (--curlevel >= levelstart) - state.levelstarts = Fcons (make_number (curlevel->last), - state.levelstarts); + while (curlevel > levelstart) + state.levelstarts = Fcons (make_number ((--curlevel)->last), + state.levelstarts); immediate_quit = 0; *stateptr = state; === modified file 'src/term.c' --- src/term.c 2011-03-23 10:06:57 +0000 +++ src/term.c 2011-03-27 08:15:26 +0000 @@ -1952,7 +1952,7 @@ it->pixel_width = len; it->nglyphs = len; - if (len > 0 && it->glyph_row) + if (it->glyph_row) append_glyphless_glyph (it, face_id, str); } === modified file 'src/unexelf.c' --- src/unexelf.c 2011-03-17 02:09:36 +0000 +++ src/unexelf.c 2011-03-30 00:19:27 +0000 @@ -651,7 +651,9 @@ int n, nn; int old_bss_index, old_sbss_index, old_plt_index; int old_data_index, new_data2_index; +#if defined _SYSTYPE_SYSV || defined __sgi int old_mdebug_index; +#endif struct stat stat_buf; int old_file_size; @@ -695,8 +697,10 @@ /* Find the mdebug section, if any. */ +#if defined _SYSTYPE_SYSV || defined __sgi old_mdebug_index = find_section (".mdebug", old_section_names, old_name, old_file_h, old_section_h, 1); +#endif /* Find the old .bss section. Figure out parameters of the new data2 and bss sections. */ === modified file 'src/window.c' --- src/window.c 2011-03-23 10:06:57 +0000 +++ src/window.c 2011-03-29 06:59:27 +0000 @@ -2978,14 +2978,10 @@ while (total_shrink > total_removed) { int nonzero_sizes = 0; - int nonzero_idx = -1; for (i = 0; i < nchildren; ++i) if (new_sizes[i] > 0) - { - ++nonzero_sizes; - nonzero_idx = i; - } + ++nonzero_sizes; for (i = 0; i < nchildren; ++i) if (new_sizes[i] > min_sizes[i]) === modified file 'src/xdisp.c' --- src/xdisp.c 2011-03-28 22:41:01 +0000 +++ src/xdisp.c 2011-03-29 23:35:49 +0000 @@ -2180,7 +2180,7 @@ redisplay during the evaluation. */ Lisp_Object -safe_call (int nargs, Lisp_Object *args) +safe_call (size_t nargs, Lisp_Object *args) { Lisp_Object val; @@ -14638,8 +14638,6 @@ if (CHARPOS (new_start) <= CHARPOS (start)) { - int first_row_y; - /* Don't use this method if the display starts with an ellipsis displayed for invisible text. It's not easy to handle that case below, and it's certainly not worth the effort since this is @@ -14654,7 +14652,6 @@ text. Note that it.vpos == 0 if or if not there is a header-line; it's not the same as the MATRIX_ROW_VPOS! */ start_display (&it, w, new_start); - first_row_y = it.current_y; w->cursor.vpos = -1; last_text_row = last_reused_text_row = NULL; @@ -16383,7 +16380,7 @@ DEFUN ("trace-to-stderr", Ftrace_to_stderr, Strace_to_stderr, 1, MANY, "", doc: /* Like `format', but print result to stderr. usage: (trace-to-stderr STRING &rest OBJECTS) */) - (int nargs, Lisp_Object *args) + (size_t nargs, Lisp_Object *args) { Lisp_Object s = Fformat (nargs, args); fprintf (stderr, "%s", SDATA (s)); @@ -22751,7 +22748,6 @@ int ch = COMPOSITION_GLYPH (cmp, i); int face_id; struct face *this_face; - int this_boff; if (ch == '\t') ch = ' '; @@ -22763,9 +22759,6 @@ pcm = NULL; else { - this_boff = font->baseline_offset; - if (font->vertical_centering) - this_boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff; get_char_face_and_encoding (it->f, ch, face_id, &char2b, it->multibyte_p, 0); pcm = get_per_char_metric (it->f, font, &char2b); @@ -24968,10 +24961,9 @@ CONSP (hotspot)) && (hotspot = XCDR (hotspot), CONSP (hotspot))) { - Lisp_Object area_id, plist; + Lisp_Object plist; - area_id = XCAR (hotspot); - /* Could check AREA_ID to see if we enter/leave this hot-spot. + /* Could check XCAR (hotspot) to see if we enter/leave this hot-spot. If so, we could look for mouse-enter, mouse-leave properties in PLIST (and do something...). */ hotspot = XCDR (hotspot); @@ -25306,10 +25298,10 @@ CONSP (hotspot)) && (hotspot = XCDR (hotspot), CONSP (hotspot))) { - Lisp_Object area_id, plist; + Lisp_Object plist; - area_id = XCAR (hotspot); - /* Could check AREA_ID to see if we enter/leave this hot-spot. + /* Could check XCAR (hotspot) to see if we enter/leave + this hot-spot. If so, we could look for mouse-enter, mouse-leave properties in PLIST (and do something...). */ hotspot = XCDR (hotspot); === modified file 'src/xselect.c' --- src/xselect.c 2011-03-10 01:36:58 +0000 +++ src/xselect.c 2011-03-24 04:17:44 +0000 @@ -2190,7 +2190,8 @@ ***********************************************************************/ /* Check that lisp values are of correct type for x_fill_property_data. That is, number, string or a cons with two numbers (low and high 16 - bit parts of a 32 bit number). */ + bit parts of a 32 bit number). Return the number of items in DATA, + or -1 if there is an error. */ int x_check_property_data (Lisp_Object data) @@ -2198,15 +2199,16 @@ Lisp_Object iter; int size = 0; - for (iter = data; CONSP (iter) && size != -1; iter = XCDR (iter), ++size) + for (iter = data; CONSP (iter); iter = XCDR (iter)) { Lisp_Object o = XCAR (iter); if (! NUMBERP (o) && ! STRINGP (o) && ! CONSP (o)) - size = -1; + return -1; else if (CONSP (o) && (! NUMBERP (XCAR (o)) || ! NUMBERP (XCDR (o)))) - size = -1; + return -1; + size++; } return size; === modified file 'src/xterm.c' --- src/xterm.c 2011-03-27 02:27:11 +0000 +++ src/xterm.c 2011-03-27 08:15:26 +0000 @@ -9121,7 +9121,7 @@ unknown reason, the call to XtMapWidget is completely ignored. Mapping the widget a second time works. */ - if (!FRAME_VISIBLE_P (f) && --retry_count > 0) + if (!FRAME_VISIBLE_P (f) && --retry_count != 0) goto retry; } } @@ -9726,7 +9726,7 @@ for (; *name1 != '\0' && *name1 == *name2; name1++, name2++) { if (*name1 == ':') - seen_colon++; + seen_colon = 1; if (seen_colon && *name1 == '.') return 1; } ------------------------------------------------------------ revno: 103775 committer: Ken Manheimer branch nick: trunk timestamp: Tue 2011-03-29 14:26:01 -0400 message: * allout.el (allout-hide-by-annotation, allout-flag-region): Reduce possibility of overlay leakage by making them volatile. * allout-widgets.el (allout-widgets-tally): Define as nil so the hash is not shared between buffers. Mode initialization is responsible for giving it a useful starting value. (allout-item-span): Reduce possibility of overlay leakage by making them volatile. (allout-widgets-count-buttons-in-region): Add diagnostic function for tracking down overlay leaks. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-29 13:23:38 +0000 +++ lisp/ChangeLog 2011-03-29 18:26:01 +0000 @@ -1,3 +1,16 @@ +2011-03-29 Ken Manheimer + + * allout.el (allout-hide-by-annotation, allout-flag-region): + Reduce possibility of overlay leakage by making them volatile. + + * allout-widgets.el (allout-widgets-tally): Define as nil so the + hash is not shared between buffers. Mode initialization is + responsible for giving it a useful starting value. + (allout-item-span): Reduce possibility of overlay leakage by + making them volatile. + (allout-widgets-count-buttons-in-region): Add diagnostic function + for tracking down button overlay leaks. + 2011-03-29 Leo Liu * ido.el (ido-read-internal): Use the default history var === modified file 'lisp/allout-widgets.el' --- lisp/allout-widgets.el 2011-03-11 18:46:12 +0000 +++ lisp/allout-widgets.el 2011-03-29 18:26:01 +0000 @@ -238,7 +238,7 @@ decreases as obsolete widgets are garbage collected." :type 'boolean :group 'allout-widgets-developer) -(defvar allout-widgets-tally (make-hash-table :test 'eq :weakness 'key) +(defvar allout-widgets-tally nil "Hash-table of existing allout widgets, for debugging. Table is maintained iff `allout-widgets-maintain-tally' is non-nil. @@ -2100,6 +2100,7 @@ (cond ((not overlay) (when start (setq overlay (make-overlay start end nil t nil)) (overlay-put overlay 'button item-widget) + (overlay-put overlay 'evaporate t) (widget-put item-widget :span-overlay overlay) t)) ;; report: @@ -2343,6 +2344,19 @@ (while (consp list) (push (pop list) res)) (prog1 (nreverse res) (setcdr res list))) (car list))) +;;;_ . allout-widgets-count-buttons-in-region (start end) +(defun allout-widgets-count-buttons-in-region (start end) + "Debugging/diagnostic tool - count overlays with 'button' property in region." + (interactive "r") + (setq start (or start (point-min)) + end (or end (point-max))) + (if (> start end) (let ((interim start)) (setq start end end interim))) + (let ((button-overlays (delq nil + (mapcar (function (lambda (o) + (if (overlay-get o 'button) + o))) + (overlays-in start end))))) + (length button-overlays))) ;;;_ : Run unit tests: (defun allout-widgets-run-unit-tests () === modified file 'lisp/allout.el' --- lisp/allout.el 2011-03-16 19:03:06 +0000 +++ lisp/allout.el 2011-03-29 18:26:01 +0000 @@ -4489,8 +4489,9 @@ ;; advance to just after end of this annotation: (setq next (allout-next-single-char-property-change (point) 'allout-was-hidden nil end)) - (overlay-put (make-overlay prev next nil 'front-advance) - 'category 'allout-exposure-category) + (let ((o (make-overlay prev next nil 'front-advance))) + (overlay-put o 'category 'allout-exposure-category) + (overlay-put o 'evaporate t)) (allout-deannotate-hidden prev next) (setq prev next) (if next (goto-char next))))) ------------------------------------------------------------ revno: 103774 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2011-03-29 16:00:16 +0200 message: src/scroll.c, src/w32.c: Trivial whitespace changes. diff: === modified file 'src/scroll.c' --- src/scroll.c 2011-03-22 07:48:10 +0000 +++ src/scroll.c 2011-03-29 14:00:16 +0000 @@ -239,7 +239,9 @@ of lines. */ static void -do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix, struct matrix_elt *matrix, int window_size, int unchanged_at_top) +do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix, + struct matrix_elt *matrix, int window_size, + int unchanged_at_top) { struct matrix_elt *p; int i, j, k; @@ -831,7 +833,9 @@ such a line will have little weight. */ int -scrolling_max_lines_saved (int start, int end, int *oldhash, int *newhash, int *cost) +scrolling_max_lines_saved (int start, int end, + int *oldhash, int *newhash, + int *cost) { struct { int hash; int count; } lines[01000]; register int i, h; @@ -920,7 +924,8 @@ overhead and multiply factor values */ static void -line_ins_del (FRAME_PTR frame, int ov1, int pf1, int ovn, int pfn, register int *ov, register int *mf) +line_ins_del (FRAME_PTR frame, int ov1, int pf1, int ovn, int pfn, + register int *ov, register int *mf) { register EMACS_INT i; register EMACS_INT frame_lines = FRAME_LINES (frame); === modified file 'src/w32.c' --- src/w32.c 2011-03-28 03:29:18 +0000 +++ src/w32.c 2011-03-29 14:00:16 +0000 @@ -1505,6 +1505,7 @@ } char *get_emacs_configuration (void); + void init_environment (char ** argv) { @@ -1591,25 +1592,25 @@ If not, then we can try to default to the appdata directory under the user's profile, which is more likely to be writable. */ if (stat ("C:/.emacs", &ignored) < 0) - { - HRESULT profile_result; - /* Dynamically load ShGetFolderPath, as it won't exist on versions - of Windows 95 and NT4 that have not been updated to include - MSIE 5. */ - ShGetFolderPath_fn get_folder_path; - get_folder_path = (ShGetFolderPath_fn) - GetProcAddress (GetModuleHandle ("shell32.dll"), "SHGetFolderPathA"); - - if (get_folder_path != NULL) - { - profile_result = get_folder_path (NULL, CSIDL_APPDATA, NULL, - 0, default_home); - - /* If we can't get the appdata dir, revert to old behavior. */ - if (profile_result == S_OK) - env_vars[0].def_value = default_home; - } - } + { + HRESULT profile_result; + /* Dynamically load ShGetFolderPath, as it won't exist on versions + of Windows 95 and NT4 that have not been updated to include + MSIE 5. */ + ShGetFolderPath_fn get_folder_path; + get_folder_path = (ShGetFolderPath_fn) + GetProcAddress (GetModuleHandle ("shell32.dll"), "SHGetFolderPathA"); + + if (get_folder_path != NULL) + { + profile_result = get_folder_path (NULL, CSIDL_APPDATA, NULL, + 0, default_home); + + /* If we can't get the appdata dir, revert to old behavior. */ + if (profile_result == S_OK) + env_vars[0].def_value = default_home; + } + } /* Get default locale info and use it for LANG. */ if (GetLocaleInfo (LOCALE_USER_DEFAULT, @@ -2082,42 +2083,42 @@ info = lookup_volume_info (root_dir); if (info == NULL || ! VOLINFO_STILL_VALID (root_dir, info)) - { - char name[ 256 ]; - DWORD serialnum; - DWORD maxcomp; - DWORD flags; - char type[ 256 ]; - - /* Info is not cached, or is stale. */ - if (!GetVolumeInformation (root_dir, - name, sizeof (name), - &serialnum, - &maxcomp, - &flags, - type, sizeof (type))) - return NULL; - - /* Cache the volume information for future use, overwriting existing - entry if present. */ - if (info == NULL) - { - info = (volume_info_data *) xmalloc (sizeof (volume_info_data)); - add_volume_info (root_dir, info); - } - else - { - xfree (info->name); - xfree (info->type); - } - - info->name = xstrdup (name); - info->serialnum = serialnum; - info->maxcomp = maxcomp; - info->flags = flags; - info->type = xstrdup (type); - info->timestamp = GetTickCount (); - } + { + char name[ 256 ]; + DWORD serialnum; + DWORD maxcomp; + DWORD flags; + char type[ 256 ]; + + /* Info is not cached, or is stale. */ + if (!GetVolumeInformation (root_dir, + name, sizeof (name), + &serialnum, + &maxcomp, + &flags, + type, sizeof (type))) + return NULL; + + /* Cache the volume information for future use, overwriting existing + entry if present. */ + if (info == NULL) + { + info = (volume_info_data *) xmalloc (sizeof (volume_info_data)); + add_volume_info (root_dir, info); + } + else + { + xfree (info->name); + xfree (info->type); + } + + info->name = xstrdup (name); + info->serialnum = serialnum; + info->maxcomp = maxcomp; + info->flags = flags; + info->type = xstrdup (type); + info->timestamp = GetTickCount (); + } return info; } ------------------------------------------------------------ revno: 103773 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2011-03-29 13:23:38 +0000 message: Merge changes made in Gnus trunk. mm-view.el (mm-display-inline-fontify): Use `set-normal-mode' with local variables disabled rather than `normal-mode'. imap.el (imap-shell-open, imap-process-connection-type): Use imap-process-connection-type for 'shell' streams as well as Kerberos, SSL, other subprocesses. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-29 08:25:31 +0000 +++ lisp/ChangeLog 2011-03-29 13:23:38 +0000 @@ -3,6 +3,12 @@ * ido.el (ido-read-internal): Use the default history var minibuffer-history if no HISTORY is specified. +2011-03-28 Brian T. Sniffen (tiny change) + + * net/imap.el (imap-shell-open, imap-process-connection-type): Use + imap-process-connection-type for 'shell' streams as well as + Kerberos, SSL, other subprocesses. + 2011-03-28 Leo Liu * abbrev.el (abbrev-table-empty-p): New function. === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-03-26 23:18:42 +0000 +++ lisp/gnus/ChangeLog 2011-03-29 13:23:38 +0000 @@ -1,3 +1,8 @@ +2011-03-29 Julien Danjou + + * mm-view.el (mm-display-inline-fontify): Use `set-normal-mode' with + local variables disabled rather than `normal-mode'. + 2011-03-26 Chong Yidong * proto-stream.el: Changes preparatory to merging open-protocol-stream === modified file 'lisp/gnus/mm-view.el' --- lisp/gnus/mm-view.el 2011-03-22 13:40:41 +0000 +++ lisp/gnus/mm-view.el 2011-03-29 13:23:38 +0000 @@ -603,9 +603,10 @@ ;; I find font-lock a bit too verbose. (font-lock-verbose nil)) (setq buffer-file-name (mm-handle-filename handle)) + (set (make-local-variable 'enable-local-variables) nil) (if mode (funcall mode) - (normal-mode)) + (set-auto-mode)) ;; The mode function might have already turned on font-lock. (unless (symbol-value 'font-lock-mode) (font-lock-fontify-buffer))) === modified file 'lisp/net/imap.el' --- lisp/net/imap.el 2011-02-18 07:44:39 +0000 +++ lisp/net/imap.el 2011-03-29 13:23:38 +0000 @@ -211,7 +211,7 @@ :type '(repeat string)) (defcustom imap-process-connection-type nil - "*Value for `process-connection-type' to use for Kerberos4, GSSAPI and SSL. + "*Value for `process-connection-type' to use for Kerberos4, GSSAPI, shell, and SSL. The `process-connection-type' variable controls the type of device used to communicate with subprocesses. Values are nil to use a pipe, or t or `pty' to use a pty. The value has no effect if the @@ -770,6 +770,7 @@ (let* ((port (or port imap-default-port)) (coding-system-for-read imap-coding-system-for-read) (coding-system-for-write imap-coding-system-for-write) + (process-connection-type imap-process-connection-type) (process (start-process name buffer shell-file-name shell-command-switch (format-spec ------------------------------------------------------------ revno: 103772 committer: Leo Liu branch nick: trunk timestamp: Tue 2011-03-29 16:25:31 +0800 message: Add to minibuffer-history if HISOTRY is nil in ido.el It is broken by the change on 2011-03-21. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-28 14:34:32 +0000 +++ lisp/ChangeLog 2011-03-29 08:25:31 +0000 @@ -1,3 +1,8 @@ +2011-03-29 Leo Liu + + * ido.el (ido-read-internal): Use the default history var + minibuffer-history if no HISTORY is specified. + 2011-03-28 Leo Liu * abbrev.el (abbrev-table-empty-p): New function. === modified file 'lisp/ido.el' --- lisp/ido.el 2011-03-25 00:42:26 +0000 +++ lisp/ido.el 2011-03-29 08:25:31 +0000 @@ -2151,7 +2151,7 @@ (t (setq done t)))))) - (and history (add-to-history history ido-selected)) + (add-to-history (or history 'minibuffer-history) ido-selected) ido-selected)) (defun ido-edit-input () ------------------------------------------------------------ revno: 103771 committer: Glenn Morris branch nick: trunk timestamp: Mon 2011-03-28 20:33:22 -0700 message: * INSTALL.BZR: Tiny re-wording. diff: === modified file 'INSTALL.BZR' --- INSTALL.BZR 2011-03-25 07:14:31 +0000 +++ INSTALL.BZR 2011-03-29 03:33:22 +0000 @@ -17,7 +17,7 @@ necessary tools. The first time you build, there are a couple of extra steps. -First, generate the `configure' script: +First, generate the `configure' script and some related files: $ ./autogen.sh ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.