Mercurial > emacs
changeset 109237:148f49fd0955
Merge from mainline.
author | Katsumi Yamaoka <katsumi@flagship2> |
---|---|
date | Wed, 07 Jul 2010 12:15:48 +0000 |
parents | 6a29de15d7fb (current diff) 2f63c33b2618 (diff) |
children | 7be7159afb6f |
files | |
diffstat | 33 files changed, 927 insertions(+), 1224 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Jul 06 12:12:41 2010 +0000 +++ b/ChangeLog Wed Jul 07 12:15:48 2010 +0000 @@ -1,3 +1,7 @@ +2010-07-07 Dan Nicolaescu <dann@ics.uci.edu> + + * configure.in (getenv): Remove K&R declaration. + 2010-07-02 Jan Djärv <jan.h.d@swipnet.se> * configure.in: Remove define __P.
--- a/configure.in Tue Jul 06 12:12:41 2010 +0000 +++ b/configure.in Wed Jul 07 12:15:48 2010 +0000 @@ -3540,11 +3540,6 @@ #define my_strftime nstrftime /* for strftime.c */ -/* Some of the files of Emacs which are intended for use with other - programs assume that if you have a config.h file, you must declare - the type of getenv. */ -extern char *getenv (); - /* These default definitions are good for almost all machines. The exceptions override them in m/MACHINE.h. */
--- a/lisp/ChangeLog Tue Jul 06 12:12:41 2010 +0000 +++ b/lisp/ChangeLog Wed Jul 07 12:15:48 2010 +0000 @@ -1,3 +1,29 @@ +2010-07-07 Agustín Martín <agustin.martin@hispalinux.es> + + * ispell.el (ispell-alternate-dictionary): Use file-readable-p. + Return nil if no word-list is found at default locations. + (ispell-complete-word-dict): Default to nil. + (ispell-command-loop): Use 'word-list' when using lookup-words. + (lookup-words): Use ispell-complete-word-dict or + ispell-alternate-dictionary. Check for word-list availability + and handle errors if needed with better messages (Bug#6539). + (ispell-complete-word): Use ispell-complete-word-dict or + ispell-alternate-dictionary. + +2010-07-07 Glenn Morris <rgm@gnu.org> + + * play/zone.el (top-level): Do not require timer, tabify, or cl. + (zone-shift-left): Ignore intangibility, and any errors from + forward-char. + (zone-shift-right): Remove no-op end-of-line. Ignore intangibility. + (zone-pgm-putz-with-case): Use upcase-region rather than inserting, + deleting, and copying text properties. + (zone-line-specs, zone-pgm-stress): Check forward-line exit status. + (zone-pgm-rotate): Handle odd buffers like that of gomoku, where getting + to point-max is hard. + (zone-fret, zone-fill-out-screen): Replace cl's do with dotimes. + (zone-fill-out-screen): Ignore intangibility. + 2010-07-05 Chong Yidong <cyd@stupidchicken.com> * menu-bar.el (menu-bar-mode):
--- a/lisp/play/zone.el Tue Jul 06 12:12:41 2010 +0000 +++ b/lisp/play/zone.el Wed Jul 07 12:15:48 2010 +0000 @@ -1,7 +1,7 @@ ;;; zone.el --- idle display hacks -;; Copyright (C) 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Free Software Foundation, Inc. ;; Author: Victor Zandy <zandy@cs.wisc.edu> ;; Maintainer: Thien-Thi Nguyen <ttn@gnu.org> @@ -40,10 +40,6 @@ ;;; Code: -(require 'timer) -(require 'tabify) -(eval-when-compile (require 'cl)) - (defvar zone-timer nil "The timer we use to decide when to zone out, or nil if none.") @@ -210,19 +206,20 @@ (insert s))) (defun zone-shift-left () - (let (s) + (let ((inhibit-point-motion-hooks t) + s) (while (not (eobp)) (unless (eolp) (setq s (buffer-substring (point) (1+ (point)))) (delete-char 1) (end-of-line) (insert s)) - (forward-char 1)))) + (ignore-errors (forward-char 1))))) (defun zone-shift-right () (goto-char (point-max)) - (end-of-line) - (let (s) + (let ((inhibit-point-motion-hooks t) + s) (while (not (bobp)) (unless (bolp) (setq s (buffer-substring (1- (point)) (point))) @@ -348,15 +345,8 @@ (let ((np (+ 2 (random 5))) (pm (point-max))) (while (< np pm) - (goto-char np) - (let ((prec (preceding-char)) - (props (text-properties-at (1- (point))))) - (insert (if (zerop (random 2)) - (upcase prec) - (downcase prec))) - (set-text-properties (1- (point)) (point) props)) - (backward-char 2) - (delete-char 1) + (funcall (if (zerop (random 2)) 'upcase-region + 'downcase-region) (1- np) np) (setq np (+ np (1+ (random 5)))))) (goto-char (point-min)) (sit-for 0 2))) @@ -365,13 +355,14 @@ ;;;; rotating (defun zone-line-specs () - (let (ret) + (let ((ok t) + ret) (save-excursion (goto-char (window-start)) - (while (< (point) (window-end)) + (while (and ok (< (point) (window-end))) (when (looking-at "[\t ]*\\([^\n]+\\)") (setq ret (cons (cons (match-beginning 1) (match-end 1)) ret))) - (forward-line 1))) + (setq ok (zerop (forward-line 1))))) ret)) (defun zone-pgm-rotate (&optional random-style) @@ -404,6 +395,7 @@ (setq cut 1 paste 2) (setq cut 2 paste 1)) (goto-char (aref ent cut)) + (setq aamt (min aamt (- (point-max) (point)))) (setq txt (buffer-substring (point) (+ (point) aamt))) (delete-char aamt) (goto-char (aref ent paste)) @@ -447,19 +439,19 @@ (hmm (cond ((string-match "[a-z]" c-string) (upcase c-string)) ((string-match "[A-Z]" c-string) (downcase c-string)) - (t (propertize " " 'display `(space :width ,cw-ceil)))))) - (do ((i 0 (1+ i)) - (wait 0.5 (* wait 0.8))) - ((= i 20)) + (t (propertize " " 'display `(space :width ,cw-ceil))))) + (wait 0.5)) + (dotimes (i 20) (goto-char pos) (delete-char 1) (insert (if (= 0 (% i 2)) hmm c-string)) - (zone-park/sit-for wbeg wait)) + (zone-park/sit-for wbeg (setq wait (* wait 0.8)))) (delete-char -1) (insert c-string))) (defun zone-fill-out-screen (width height) (let ((start (window-start)) - (line (make-string width 32))) + (line (make-string width 32)) + (inhibit-point-motion-hooks t)) (goto-char start) ;; fill out rectangular ws block (while (progn (end-of-line) @@ -473,8 +465,7 @@ (let ((nl (- height (count-lines (point-min) (point))))) (when (> nl 0) (setq line (concat line "\n")) - (do ((i 0 (1+ i))) - ((= i nl)) + (dotimes (i nl) (insert line)))) (goto-char start) (recenter 0) @@ -587,11 +578,12 @@ (defun zone-pgm-stress () (goto-char (point-min)) - (let (lines) - (while (< (point) (point-max)) + (let ((ok t) + lines) + (while (and ok (< (point) (point-max))) (let ((p (point))) - (forward-line 1) - (setq lines (cons (buffer-substring p (point)) lines)))) + (setq ok (zerop (forward-line 1)) + lines (cons (buffer-substring p (point)) lines)))) (sit-for 5) (zone-hiding-modeline (let ((msg "Zoning... (zone-pgm-stress)")) @@ -671,7 +663,8 @@ (setq c (point)) (move-to-column 9) (setq col (cons (buffer-substring (point) c) col)) - (end-of-line 0) +; (let ((inhibit-point-motion-hooks t)) + (end-of-line 0);) (forward-char -10)) (let ((life-patterns (vector (if (and col (search-forward "@" max t))
--- a/lisp/textmodes/ispell.el Tue Jul 06 12:12:41 2010 +0000 +++ b/lisp/textmodes/ispell.el Wed Jul 07 12:15:48 2010 +0000 @@ -357,21 +357,21 @@ :group 'ispell) (defcustom ispell-alternate-dictionary - (cond ((file-exists-p "/usr/dict/web2") "/usr/dict/web2") - ((file-exists-p "/usr/share/dict/web2") "/usr/share/dict/web2") - ((file-exists-p "/usr/dict/words") "/usr/dict/words") - ((file-exists-p "/usr/lib/dict/words") "/usr/lib/dict/words") - ((file-exists-p "/usr/share/dict/words") "/usr/share/dict/words") - ((file-exists-p "/usr/share/lib/dict/words") + (cond ((file-readable-p "/usr/dict/web2") "/usr/dict/web2") + ((file-readable-p "/usr/share/dict/web2") "/usr/share/dict/web2") + ((file-readable-p "/usr/dict/words") "/usr/dict/words") + ((file-readable-p "/usr/lib/dict/words") "/usr/lib/dict/words") + ((file-readable-p "/usr/share/dict/words") "/usr/share/dict/words") + ((file-readable-p "/usr/share/lib/dict/words") "/usr/share/lib/dict/words") - ((file-exists-p "/sys/dict") "/sys/dict") - (t "/usr/dict/words")) - "*Alternate dictionary for spelling help." + ((file-readable-p "/sys/dict") "/sys/dict")) + "*Alternate plain word-list dictionary for spelling help." :type '(choice file (const :tag "None" nil)) :group 'ispell) -(defcustom ispell-complete-word-dict ispell-alternate-dictionary - "*Dictionary used for word completion." +(defcustom ispell-complete-word-dict nil + "*Plain word-list dictionary used for word completion if +different from `ispell-alternate-dictionary'." :type '(choice file (const :tag "None" nil)) :group 'ispell) @@ -2049,10 +2049,11 @@ (erase-buffer) (setq count ?0 skipped 0 - mode-line-format + mode-line-format ;; setup the *Choices* buffer with valid data. (concat "-- %b -- word: " new-word - " -- dict: " - ispell-alternate-dictionary) + " -- word-list: " + (or ispell-complete-word-dict + ispell-alternate-dictionary)) miss (lookup-words new-word) choices miss line ispell-choices-win-default-height) @@ -2267,11 +2268,20 @@ search for the words (usually egrep). Optional second argument contains the dictionary to use; the default is -`ispell-alternate-dictionary'." +`ispell-alternate-dictionary', overriden by `ispell-complete-word-dict' +if defined." ;; We don't use the filter for this function, rather the result is written ;; into a buffer. Hence there is no need to save the filter values. (if (null lookup-dict) - (setq lookup-dict ispell-alternate-dictionary)) + (setq lookup-dict (or ispell-complete-word-dict + ispell-alternate-dictionary))) + + (if lookup-dict + (unless (file-readable-p lookup-dict) + (error "lookup-words error: Unreadable or missing plain word-list %s." + lookup-dict)) + (error (concat "lookup-words error: No plain word-list found at system default " + "locations. Customize `ispell-alternate-dictionary' to set yours."))) (let* ((process-connection-type ispell-use-ptys-p) (wild-p (string-match "\\*" word)) @@ -3342,7 +3352,8 @@ (lookup-words (concat (and interior-frag "*") word (if (or interior-frag (null ispell-look-p)) "*")) - ispell-complete-word-dict))) + (or ispell-complete-word-dict + ispell-alternate-dictionary)))) (cond ((eq possibilities t) (message "No word to complete")) ((null possibilities)
--- a/src/ChangeLog Tue Jul 06 12:12:41 2010 +0000 +++ b/src/ChangeLog Wed Jul 07 12:15:48 2010 +0000 @@ -1,3 +1,41 @@ +2010-07-07 Juanma Barranquero <lekktu@gmail.com> + + * coding.c, sysdep.c: Convert some more functions to standard C. + +2010-07-07 Juanma Barranquero <lekktu@gmail.com> + + * coding.c (decode_coding_gap, encode_coding_gap, decode_coding_object) + (encode_coding_object): Use SPECPDL_INDEX. + (syms_of_coding): Use DOS_NT. + +2010-07-07 Dan Nicolaescu <dann@ics.uci.edu> + + * intervals.h (interval): Use EMACS_UINT instead of unsigned EMACS_INT. + + Make the function member of Lisp_Subr use standard C prototypes. + * lisp.h (struct Lisp_Subr): Use a union for the function member. + (DECL_ALIGN): Add a cast for the function. + * eval.c (Feval, Ffuncall): Use the proper type for each type + function call. + +2010-07-06 Chong Yidong <cyd@stupidchicken.com> + + * fringe.c (draw_fringe_bitmap_1): Use lookup_named_face to get + fringe face id, so face-remapping-alist works (Bug#6091). + +2010-07-06 Juanma Barranquero <lekktu@gmail.com> + + * w32.c, w32console.c, w32fns.c, w32font.c, w32heap.c, w32inevt.c + * w32menu.c, w32proc.c, w32reg.c, w32select.c, w32term.c + * w32uniscribe.c, w32xfns.c: Convert function definitions to standard C. + +2010-07-06 Andreas Schwab <schwab@linux-m68k.org> + + * xterm.c (x_get_keysym_name): Change type of parameter to int. + * lisp.h: Declare x_get_keysym_name. + * keyboard.c (modify_event_symbol): Don't declare + x_get_keysym_name here. + 2010-07-06 Dan Nicolaescu <dann@ics.uci.edu> * ecrt0.c: Revert conversion to standard C.
--- a/src/coding.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/coding.c Wed Jul 07 12:15:48 2010 +0000 @@ -154,9 +154,8 @@ #if 0 static int -detect_coding_XXX (coding, detect_info) - struct coding_system *coding; - struct coding_detection_info *detect_info; +detect_coding_XXX (struct coding_system *coding, + struct coding_detection_info *detect_info) { const unsigned char *src = coding->source; const unsigned char *src_end = coding->source + coding->src_bytes; @@ -203,8 +202,7 @@ #if 0 static void -decode_coding_XXXX (coding) - struct coding_system *coding; +decode_coding_XXXX (struct coding_system *coding) { const unsigned char *src = coding->source + coding->consumed; const unsigned char *src_end = coding->source + coding->src_bytes; @@ -261,8 +259,7 @@ Below is a template of these functions. */ #if 0 static void -encode_coding_XXX (coding) - struct coding_system *coding; +encode_coding_XXX (struct coding_system *coding) { int multibytep = coding->dst_multibyte; int *charbuf = coding->charbuf; @@ -1165,7 +1162,8 @@ } static void -coding_alloc_by_making_gap (struct coding_system *coding, EMACS_INT gap_head_used, EMACS_INT bytes) +coding_alloc_by_making_gap (struct coding_system *coding, + EMACS_INT gap_head_used, EMACS_INT bytes) { if (EQ (coding->src_object, coding->dst_object)) { @@ -1194,7 +1192,8 @@ static unsigned char * -alloc_destination (struct coding_system *coding, EMACS_INT nbytes, unsigned char *dst) +alloc_destination (struct coding_system *coding, EMACS_INT nbytes, + unsigned char *dst) { EMACS_INT offset = dst - coding->destination; @@ -1292,7 +1291,8 @@ #define UTF_8_BOM_3 0xBF static int -detect_coding_utf_8 (struct coding_system *coding, struct coding_detection_info *detect_info) +detect_coding_utf_8 (struct coding_system *coding, + struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base; const unsigned char *src_end = coding->source + coding->src_bytes; @@ -1423,8 +1423,6 @@ } CODING_UTF_8_BOM (coding) = utf_without_bom; - - while (1) { int c, c1, c2, c3, c4, c5; @@ -1447,7 +1445,7 @@ { c = - c1; } - else if (UTF_8_1_OCTET_P(c1)) + else if (UTF_8_1_OCTET_P (c1)) { if (eol_crlf && c1 == '\r') ONE_MORE_BYTE (byte_after_cr); @@ -1610,7 +1608,8 @@ static int -detect_coding_utf_16 (struct coding_system *coding, struct coding_detection_info *detect_info) +detect_coding_utf_16 (struct coding_system *coding, + struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base = src; const unsigned char *src_end = coding->source + coding->src_bytes; @@ -1962,7 +1961,8 @@ else return 0. */ static int -detect_coding_emacs_mule (struct coding_system *coding, struct coding_detection_info *detect_info) +detect_coding_emacs_mule (struct coding_system *coding, + struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base; const unsigned char *src_end = coding->source + coding->src_bytes; @@ -2050,7 +2050,9 @@ -1. If SRC is too short, return -2. */ int -emacs_mule_char (struct coding_system *coding, const unsigned char *src, int *nbytes, int *nchars, int *id, struct composition_status *cmp_status) +emacs_mule_char (struct coding_system *coding, const unsigned char *src, + int *nbytes, int *nchars, int *id, + struct composition_status *cmp_status) { const unsigned char *src_end = coding->source + coding->src_bytes; const unsigned char *src_base = src; @@ -2187,7 +2189,7 @@ (3) alt&rule composition: 0x80 0xF5 BYTES CHARS | ALT RULE ... ALT CHAR ... and these old form: - + (4) relative composition: 0x80 | MSEQ ... MSEQ (5) rulebase composition: 0x80 0xFF | MSEQ MRULE ... MSEQ @@ -2368,7 +2370,8 @@ static int -emacs_mule_finish_composition (int *charbuf, struct composition_status *cmp_status) +emacs_mule_finish_composition (int *charbuf, + struct composition_status *cmp_status) { int idx = - cmp_status->length; int new_chars; @@ -3048,7 +3051,8 @@ If it is, return 1, else return 0. */ static int -detect_coding_iso_2022 (struct coding_system *coding, struct coding_detection_info *detect_info) +detect_coding_iso_2022 (struct coding_system *coding, + struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base = src; const unsigned char *src_end = coding->source + coding->src_bytes; @@ -4284,7 +4288,7 @@ #define ENCODE_ISO_CHARACTER(charset, c) \ do { \ - int code = ENCODE_CHAR ((charset),(c)); \ + int code = ENCODE_CHAR ((charset), (c)); \ \ if (CHARSET_DIMENSION (charset) == 1) \ ENCODE_ISO_CHARACTER_DIMENSION1 ((charset), code); \ @@ -4298,7 +4302,9 @@ Return new DST. */ unsigned char * -encode_invocation_designation (struct charset *charset, struct coding_system *coding, unsigned char *dst, int *p_nchars) +encode_invocation_designation (struct charset *charset, + struct coding_system *coding, + unsigned char *dst, int *p_nchars) { int multibytep = coding->dst_multibyte; int produced_chars = *p_nchars; @@ -4410,7 +4416,8 @@ find all the necessary designations. */ static unsigned char * -encode_designation_at_bol (struct coding_system *coding, int *charbuf, int *charbuf_end, unsigned char *dst) +encode_designation_at_bol (struct coding_system *coding, int *charbuf, + int *charbuf_end, unsigned char *dst) { struct charset *charset; /* Table of charsets to be designated to each graphic register. */ @@ -4650,7 +4657,8 @@ CATEGORY_MASK_SJIS, else return 0. */ static int -detect_coding_sjis (struct coding_system *coding, struct coding_detection_info *detect_info) +detect_coding_sjis (struct coding_system *coding, + struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base; const unsigned char *src_end = coding->source + coding->src_bytes; @@ -4706,7 +4714,8 @@ CATEGORY_MASK_BIG5, else return 0. */ static int -detect_coding_big5 (struct coding_system *coding, struct coding_detection_info *detect_info) +detect_coding_big5 (struct coding_system *coding, + struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base; const unsigned char *src_end = coding->source + coding->src_bytes; @@ -5144,7 +5153,8 @@ CATEGORY_MASK_CCL, else return 0. */ static int -detect_coding_ccl (struct coding_system *coding, struct coding_detection_info *detect_info) +detect_coding_ccl (struct coding_system *coding, + struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base; const unsigned char *src_end = coding->source + coding->src_bytes; @@ -5423,7 +5433,8 @@ is, return 1, else return 0. */ static int -detect_coding_charset (struct coding_system *coding, struct coding_detection_info *detect_info) +detect_coding_charset (struct coding_system *coding, + struct coding_detection_info *detect_info) { const unsigned char *src = coding->source, *src_base; const unsigned char *src_end = coding->source + coding->src_bytes; @@ -6168,7 +6179,8 @@ #define MAX_EOL_CHECK_COUNT 3 static int -detect_eol (const unsigned char *source, EMACS_INT src_bytes, enum coding_category category) +detect_eol (const unsigned char *source, EMACS_INT src_bytes, + enum coding_category category) { const unsigned char *src = source, *src_end = src + src_bytes; unsigned char c; @@ -6704,7 +6716,8 @@ static int -produce_chars (struct coding_system *coding, Lisp_Object translation_table, int last_block) +produce_chars (struct coding_system *coding, Lisp_Object translation_table, + int last_block) { unsigned char *dst = coding->destination + coding->produced; unsigned char *dst_end = coding->destination + coding->dst_bytes; @@ -7174,7 +7187,9 @@ return BUF. */ static INLINE int * -handle_composition_annotation (EMACS_INT pos, EMACS_INT limit, struct coding_system *coding, int *buf, EMACS_INT *stop) +handle_composition_annotation (EMACS_INT pos, EMACS_INT limit, + struct coding_system *coding, int *buf, + EMACS_INT *stop) { EMACS_INT start, end; Lisp_Object prop; @@ -7255,7 +7270,9 @@ property value is non-nil (limiting by LIMIT), and return BUF. */ static INLINE int * -handle_charset_annotation (EMACS_INT pos, EMACS_INT limit, struct coding_system *coding, int *buf, EMACS_INT *stop) +handle_charset_annotation (EMACS_INT pos, EMACS_INT limit, + struct coding_system *coding, int *buf, + EMACS_INT *stop) { Lisp_Object val, next; int id; @@ -7275,7 +7292,8 @@ static void -consume_chars (struct coding_system *coding, Lisp_Object translation_table, int max_lookup) +consume_chars (struct coding_system *coding, Lisp_Object translation_table, + int max_lookup) { int *buf = coding->charbuf; int *buf_end = coding->charbuf + coding->charbuf_size; @@ -7560,9 +7578,10 @@ } int -decode_coding_gap (struct coding_system *coding, EMACS_INT chars, EMACS_INT bytes) -{ - int count = specpdl_ptr - specpdl; +decode_coding_gap (struct coding_system *coding, + EMACS_INT chars, EMACS_INT bytes) +{ + int count = SPECPDL_INDEX (); Lisp_Object attrs; code_conversion_save (0, 0); @@ -7605,9 +7624,10 @@ } int -encode_coding_gap (struct coding_system *coding, EMACS_INT chars, EMACS_INT bytes) -{ - int count = specpdl_ptr - specpdl; +encode_coding_gap (struct coding_system *coding, + EMACS_INT chars, EMACS_INT bytes) +{ + int count = SPECPDL_INDEX (); code_conversion_save (0, 0); @@ -7658,14 +7678,13 @@ */ void -decode_coding_object (coding, src_object, from, from_byte, to, to_byte, - dst_object) - struct coding_system *coding; - Lisp_Object src_object; - EMACS_INT from, from_byte, to, to_byte; - Lisp_Object dst_object; -{ - int count = specpdl_ptr - specpdl; +decode_coding_object (struct coding_system *coding, + Lisp_Object src_object, + EMACS_INT from, EMACS_INT from_byte, + EMACS_INT to, EMACS_INT to_byte, + Lisp_Object dst_object) +{ + int count = SPECPDL_INDEX (); unsigned char *destination; EMACS_INT dst_bytes; EMACS_INT chars = to - from; @@ -7849,14 +7868,13 @@ void -encode_coding_object (coding, src_object, from, from_byte, to, to_byte, - dst_object) - struct coding_system *coding; - Lisp_Object src_object; - EMACS_INT from, from_byte, to, to_byte; - Lisp_Object dst_object; -{ - int count = specpdl_ptr - specpdl; +encode_coding_object (struct coding_system *coding, + Lisp_Object src_object, + EMACS_INT from, EMACS_INT from_byte, + EMACS_INT to, EMACS_INT to_byte, + Lisp_Object dst_object) +{ + int count = SPECPDL_INDEX (); EMACS_INT chars = to - from; EMACS_INT bytes = to_byte - from_byte; Lisp_Object attrs; @@ -8162,13 +8180,10 @@ detect only text-format. */ Lisp_Object -detect_coding_system (src, src_chars, src_bytes, highest, multibytep, - coding_system) - const unsigned char *src; - EMACS_INT src_chars, src_bytes; - int highest; - int multibytep; - Lisp_Object coding_system; +detect_coding_system (const unsigned char *src, + EMACS_INT src_chars, EMACS_INT src_bytes, + int highest, int multibytep, + Lisp_Object coding_system) { const unsigned char *src_end = src + src_bytes; Lisp_Object attrs, eol_type; @@ -8922,7 +8937,9 @@ Lisp_Object -code_convert_region (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object dst_object, int encodep, int norecord) +code_convert_region (Lisp_Object start, Lisp_Object end, + Lisp_Object coding_system, Lisp_Object dst_object, + int encodep, int norecord) { struct coding_system coding; EMACS_INT from, from_byte, to, to_byte; @@ -9061,7 +9078,8 @@ ENCODE_FILE, thus we ignore character composition. */ Lisp_Object -code_convert_string_norecord (Lisp_Object string, Lisp_Object coding_system, int encodep) +code_convert_string_norecord (Lisp_Object string, Lisp_Object coding_system, + int encodep) { return code_convert_string (string, coding_system, Qt, encodep, 0, 1); } @@ -10096,7 +10114,7 @@ DEFUN ("coding-system-put", Fcoding_system_put, Scoding_system_put, 3, 3, 0, doc: /* Change value in CODING-SYSTEM's property list PROP to VAL. */) - (coding_system, prop, val) + (coding_system, prop, val) Lisp_Object coding_system, prop, val; { Lisp_Object spec, attrs; @@ -10194,7 +10212,7 @@ 1, 1, 0, doc: /* Return the base of CODING-SYSTEM. Any alias or subsidiary coding system is not a base coding system. */) - (coding_system) + (coding_system) Lisp_Object coding_system; { Lisp_Object spec, attrs; @@ -10854,7 +10872,7 @@ for (i = 0; i < coding_category_max; i++) Fset (AREF (Vcoding_category_table, i), Qno_conversion); } -#if defined (MSDOS) || defined (WINDOWSNT) +#if defined (DOS_NT) system_eol_type = Qdos; #else system_eol_type = Qunix;
--- a/src/config.in Tue Jul 06 12:12:41 2010 +0000 +++ b/src/config.in Wed Jul 07 12:15:48 2010 +0000 @@ -1107,11 +1107,6 @@ #define my_strftime nstrftime /* for strftime.c */ -/* Some of the files of Emacs which are intended for use with other - programs assume that if you have a config.h file, you must declare - the type of getenv. */ -extern char *getenv (); - /* These default definitions are good for almost all machines. The exceptions override them in m/MACHINE.h. */
--- a/src/eval.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/eval.c Wed Jul 07 12:15:48 2010 +0000 @@ -2330,7 +2330,7 @@ if (XSUBR (fun)->max_args == UNEVALLED) { backtrace.evalargs = 0; - val = (*XSUBR (fun)->function) (args_left); + val = (XSUBR (fun)->function.a1) (args_left); goto done; } @@ -2356,7 +2356,7 @@ backtrace.args = vals; backtrace.nargs = XINT (numargs); - val = (*XSUBR (fun)->function) (XINT (numargs), vals); + val = (XSUBR (fun)->function.am) (XINT (numargs), vals); UNGCPRO; goto done; } @@ -2380,40 +2380,40 @@ switch (i) { case 0: - val = (*XSUBR (fun)->function) (); + val = (XSUBR (fun)->function.a0) (); goto done; case 1: - val = (*XSUBR (fun)->function) (argvals[0]); + val = (XSUBR (fun)->function.a1) (argvals[0]); goto done; case 2: - val = (*XSUBR (fun)->function) (argvals[0], argvals[1]); + val = (XSUBR (fun)->function.a2) (argvals[0], argvals[1]); goto done; case 3: - val = (*XSUBR (fun)->function) (argvals[0], argvals[1], - argvals[2]); + val = (XSUBR (fun)->function.a3) (argvals[0], argvals[1], + argvals[2]); goto done; case 4: - val = (*XSUBR (fun)->function) (argvals[0], argvals[1], - argvals[2], argvals[3]); + val = (XSUBR (fun)->function.a4) (argvals[0], argvals[1], + argvals[2], argvals[3]); goto done; case 5: - val = (*XSUBR (fun)->function) (argvals[0], argvals[1], argvals[2], - argvals[3], argvals[4]); + val = (XSUBR (fun)->function.a5) (argvals[0], argvals[1], argvals[2], + argvals[3], argvals[4]); goto done; case 6: - val = (*XSUBR (fun)->function) (argvals[0], argvals[1], argvals[2], - argvals[3], argvals[4], argvals[5]); + val = (XSUBR (fun)->function.a6) (argvals[0], argvals[1], argvals[2], + argvals[3], argvals[4], argvals[5]); goto done; case 7: - val = (*XSUBR (fun)->function) (argvals[0], argvals[1], argvals[2], - argvals[3], argvals[4], argvals[5], - argvals[6]); + val = (XSUBR (fun)->function.a7) (argvals[0], argvals[1], argvals[2], + argvals[3], argvals[4], argvals[5], + argvals[6]); goto done; case 8: - val = (*XSUBR (fun)->function) (argvals[0], argvals[1], argvals[2], - argvals[3], argvals[4], argvals[5], - argvals[6], argvals[7]); + val = (XSUBR (fun)->function.a8) (argvals[0], argvals[1], argvals[2], + argvals[3], argvals[4], argvals[5], + argvals[6], argvals[7]); goto done; default: @@ -3011,7 +3011,7 @@ if (XSUBR (fun)->max_args == MANY) { - val = (*XSUBR (fun)->function) (numargs, args + 1); + val = (XSUBR (fun)->function.am) (numargs, args + 1); goto done; } @@ -3027,44 +3027,44 @@ switch (XSUBR (fun)->max_args) { case 0: - val = (*XSUBR (fun)->function) (); + val = (XSUBR (fun)->function.a0) (); goto done; case 1: - val = (*XSUBR (fun)->function) (internal_args[0]); + val = (XSUBR (fun)->function.a1) (internal_args[0]); goto done; case 2: - val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1]); + val = (XSUBR (fun)->function.a2) (internal_args[0], internal_args[1]); goto done; case 3: - val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1], - internal_args[2]); + val = (XSUBR (fun)->function.a3) (internal_args[0], internal_args[1], + internal_args[2]); goto done; case 4: - val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1], - internal_args[2], internal_args[3]); + val = (XSUBR (fun)->function.a4) (internal_args[0], internal_args[1], + internal_args[2], internal_args[3]); goto done; case 5: - val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1], - internal_args[2], internal_args[3], - internal_args[4]); + val = (XSUBR (fun)->function.a5) (internal_args[0], internal_args[1], + internal_args[2], internal_args[3], + internal_args[4]); goto done; case 6: - val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1], - internal_args[2], internal_args[3], - internal_args[4], internal_args[5]); + val = (XSUBR (fun)->function.a6) (internal_args[0], internal_args[1], + internal_args[2], internal_args[3], + internal_args[4], internal_args[5]); goto done; case 7: - val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1], - internal_args[2], internal_args[3], - internal_args[4], internal_args[5], - internal_args[6]); + val = (XSUBR (fun)->function.a7) (internal_args[0], internal_args[1], + internal_args[2], internal_args[3], + internal_args[4], internal_args[5], + internal_args[6]); goto done; case 8: - val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1], - internal_args[2], internal_args[3], - internal_args[4], internal_args[5], - internal_args[6], internal_args[7]); + val = (XSUBR (fun)->function.a8) (internal_args[0], internal_args[1], + internal_args[2], internal_args[3], + internal_args[4], internal_args[5], + internal_args[6], internal_args[7]); goto done; default:
--- a/src/fringe.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/fringe.c Wed Jul 07 12:15:48 2010 +0000 @@ -576,11 +576,10 @@ if (face_id == DEFAULT_FACE_ID) { - Lisp_Object face; - - if ((face = fringe_faces[which], NILP (face)) - || (face_id = lookup_derived_face (f, face, FRINGE_FACE_ID, 0), - face_id < 0)) + Lisp_Object face = fringe_faces[which]; + face_id = NILP (face) ? lookup_named_face (f, Qfringe, 0) + : lookup_derived_face (f, face, FRINGE_FACE_ID, 0); + if (face_id < 0) face_id = FRINGE_FACE_ID; }
--- a/src/image.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/image.c Wed Jul 07 12:15:48 2010 +0000 @@ -157,7 +157,7 @@ unsigned long plane_mask, int format) { /* TODO: not sure what this function is supposed to do.. */ - ns_retain_object(pixmap); + ns_retain_object (pixmap); return pixmap; } @@ -165,7 +165,7 @@ unsigned long XGetPixel (XImagePtr ximage, int x, int y) { - return ns_get_pixel(ximage, x, y); + return ns_get_pixel (ximage, x, y); } /* use with imgs created by ns_image_for_XPM; alpha set to 1; @@ -173,7 +173,7 @@ void XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel) { - ns_put_pixel(ximage, x, y, pixel); + ns_put_pixel (ximage, x, y, pixel); } #endif /* HAVE_NS */ @@ -274,7 +274,7 @@ #endif /* HAVE_NTGUI */ #ifdef HAVE_NS - void *bitmap = ns_image_from_XBM(bits, width, height); + void *bitmap = ns_image_from_XBM (bits, width, height); if (!bitmap) return -1; #endif @@ -319,7 +319,7 @@ #ifdef HAVE_NS int id; - void *bitmap = ns_image_from_file(file); + void *bitmap = ns_image_from_file (file); if (!bitmap) return -1; @@ -330,8 +330,8 @@ dpyinfo->bitmaps[id - 1].refcount = 1; dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (SBYTES (file) + 1); dpyinfo->bitmaps[id - 1].depth = 1; - dpyinfo->bitmaps[id - 1].height = ns_image_width(bitmap); - dpyinfo->bitmaps[id - 1].width = ns_image_height(bitmap); + dpyinfo->bitmaps[id - 1].height = ns_image_width (bitmap); + dpyinfo->bitmaps[id - 1].width = ns_image_height (bitmap); strcpy (dpyinfo->bitmaps[id - 1].file, SDATA (file)); return id; #endif @@ -399,7 +399,7 @@ #endif /* HAVE_NTGUI */ #ifdef HAVE_NS - ns_release_object(bm->img); + ns_release_object (bm->img); #endif if (bm->file) @@ -1211,10 +1211,10 @@ #elif defined (HAVE_NS) #define Destroy_Image(ximg, dummy) \ - ns_release_object(ximg) + ns_release_object (ximg) #define Free_Pixmap(display, pixmap) \ - ns_release_object(pixmap) + ns_release_object (pixmap) #else @@ -2099,7 +2099,7 @@ #endif /* HAVE_NTGUI */ #ifdef HAVE_NS - *pixmap = ns_image_for_XPM(width, height, depth); + *pixmap = ns_image_for_XPM (width, height, depth); if (*pixmap == 0) { *ximg = NULL; @@ -2131,7 +2131,7 @@ xfree (ximg); #endif /* HAVE_NTGUI */ #ifdef HAVE_NS - ns_release_object(ximg); + ns_release_object (ximg); #endif /* HAVE_NS */ } } @@ -2162,7 +2162,7 @@ #ifdef HAVE_NS xassert (ximg == pixmap); - ns_retain_object(ximg); + ns_retain_object (ximg); #endif } @@ -2619,7 +2619,7 @@ convert_mono_to_color_image (f, img, fg, bg); #elif defined (HAVE_NS) - img->pixmap = ns_image_from_XBM(data, img->width, img->height); + img->pixmap = ns_image_from_XBM (data, img->width, img->height); #else img->pixmap @@ -2982,7 +2982,7 @@ invertedBits = bits; nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * img->height; - bits = (char *) alloca(nbytes); + bits = (char *) alloca (nbytes); for (i = 0; i < nbytes; i++) bits[i] = XBM_BIT_SHUFFLE (invertedBits[i]); } @@ -3859,7 +3859,7 @@ if (!(end - s >= 9 && memcmp (s, "/* XPM */", 9) == 0)) goto failure; s += 9; - match(); + match (); expect_ident ("static"); expect_ident ("char"); expect ('*'); @@ -4009,8 +4009,8 @@ (!EQ (color_val, Qt) ? PIX_MASK_DRAW : (have_mask = 1, PIX_MASK_RETAIN))); #else - if (EQ(color_val, Qt)) - ns_set_alpha(ximg, x, y, 0); + if (EQ (color_val, Qt)) + ns_set_alpha (ximg, x, y, 0); #endif } if (y + 1 < height) @@ -4897,7 +4897,7 @@ ? PIX_MASK_DRAW : PIX_MASK_RETAIN)); #else if (XGetPixel (ximg, x, y) == bg) - ns_set_alpha(ximg, x, y, 0); + ns_set_alpha (ximg, x, y, 0); #endif /* HAVE_NS */ #ifndef HAVE_NS /* Fill in the background_transparent field while we have the mask handy. */ @@ -6485,9 +6485,9 @@ static int jpeg_load (struct frame *f, struct image *img) { - return ns_load_image(f, img, - image_spec_value (img->spec, QCfile, NULL), - image_spec_value (img->spec, QCdata, NULL)); + return ns_load_image (f, img, + image_spec_value (img->spec, QCfile, NULL), + image_spec_value (img->spec, QCdata, NULL)); } #endif /* HAVE_NS */ @@ -6912,9 +6912,9 @@ static int tiff_load (struct frame *f, struct image *img) { - return ns_load_image(f, img, - image_spec_value (img->spec, QCfile, NULL), - image_spec_value (img->spec, QCdata, NULL)); + return ns_load_image (f, img, + image_spec_value (img->spec, QCfile, NULL), + image_spec_value (img->spec, QCdata, NULL)); } #endif /* HAVE_NS */ @@ -7342,9 +7342,9 @@ static int gif_load (struct frame *f, struct image *img) { - return ns_load_image(f, img, - image_spec_value (img->spec, QCfile, NULL), - image_spec_value (img->spec, QCdata, NULL)); + return ns_load_image (f, img, + image_spec_value (img->spec, QCfile, NULL), + image_spec_value (img->spec, QCdata, NULL)); } #endif /* HAVE_NS */ @@ -7666,7 +7666,7 @@ background.pixel = FRAME_BACKGROUND_PIXEL (f); x_query_color (f, &background); #else - ns_query_color(FRAME_BACKGROUND_COLOR (f), &background, 1); + ns_query_color (FRAME_BACKGROUND_COLOR (f), &background, 1); #endif }
--- a/src/intervals.h Tue Jul 06 12:12:41 2010 +0000 +++ b/src/intervals.h Wed Jul 07 12:15:48 2010 +0000 @@ -28,8 +28,8 @@ { /* The first group of entries deal with the tree structure. */ - unsigned EMACS_INT total_length; /* Length of myself and both children. */ - unsigned EMACS_INT position; /* Cache of interval's character position. */ + EMACS_UINT total_length; /* Length of myself and both children. */ + EMACS_UINT position; /* Cache of interval's character position. */ /* This field is usually updated simultaneously with an interval traversal, there is no guarantee
--- a/src/keyboard.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/keyboard.c Wed Jul 07 12:15:48 2010 +0000 @@ -6581,7 +6581,6 @@ #ifdef HAVE_WINDOW_SYSTEM if (NILP (value)) { - extern char *x_get_keysym_name (KeySym keysym); char *name = x_get_keysym_name (symbol_num); if (name) value = intern (name);
--- a/src/lisp.h Tue Jul 06 12:12:41 2010 +0000 +++ b/src/lisp.h Wed Jul 07 12:15:48 2010 +0000 @@ -965,7 +965,18 @@ struct Lisp_Subr { EMACS_UINT size; - Lisp_Object (*function) (); + union { + Lisp_Object (*a0) (void); + Lisp_Object (*a1) (Lisp_Object); + Lisp_Object (*a2) (Lisp_Object, Lisp_Object); + Lisp_Object (*a3) (Lisp_Object, Lisp_Object, Lisp_Object); + Lisp_Object (*a4) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); + Lisp_Object (*a5) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); + Lisp_Object (*a6) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); + 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 (*am) (int, Lisp_Object *); + } function; short min_args, max_args; const char *symbol_name; char *intspec; @@ -1768,7 +1779,7 @@ Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ DECL_ALIGN (struct Lisp_Subr, sname) = \ { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ - fnname, minargs, maxargs, lname, intspec, 0}; \ + (Lisp_Object(*)(void)) fnname, minargs, maxargs, lname, intspec, 0}; \ Lisp_Object fnname /* Note that the weird token-substitution semantics of ANSI C makes @@ -3469,6 +3480,11 @@ extern void syms_of_xterm (void); #endif /* HAVE_X_WINDOWS */ +#ifdef HAVE_WINDOW_SYSTEM +/* Defined in xterm.c, nsterm.m, w32term.c */ +extern char *x_get_keysym_name (int); +#endif /* HAVE_WINDOW_SYSTEM */ + #ifdef MSDOS /* Defined in msdos.c */ EXFUN (Fmsdos_downcase_filename, 1);
--- a/src/process.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/process.c Wed Jul 07 12:15:48 2010 +0000 @@ -3003,7 +3003,7 @@ p->inherit_coding_system_flag = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); - Fserial_process_configure(nargs, args); + Fserial_process_configure (nargs, args); specpdl_ptr = specpdl + specpdl_count; @@ -3401,7 +3401,7 @@ ret = getaddrinfo (SDATA (host), portstring, &hints, &res); if (ret) #ifdef HAVE_GAI_STRERROR - error ("%s/%s %s", SDATA (host), portstring, gai_strerror(ret)); + error ("%s/%s %s", SDATA (host), portstring, gai_strerror (ret)); #else error ("%s/%s getaddrinfo error %d", SDATA (host), portstring, ret); #endif @@ -3900,7 +3900,7 @@ again: ifaces += 25; - buf_size = ifaces * sizeof(ifreqs[0]); + buf_size = ifaces * sizeof (ifreqs[0]); ifreqs = (struct ifreq *)xrealloc(ifreqs, buf_size); if (!ifreqs) { @@ -4362,7 +4362,7 @@ int i; args[0] = build_string ("%x:%x:%x:%x:%x:%x:%x:%x"); for (i = 0; i < 8; i++) - args[i+1] = make_number (ntohs(ip6[i])); + args[i+1] = make_number (ntohs (ip6[i])); host = Fformat (9, args); service = make_number (ntohs (saddr.in.sin_port)); @@ -5164,23 +5164,23 @@ /* getsockopt(,,SO_ERROR,,) is said to hang on some systems. So only use it on systems where it is known to work. */ { - int xlen = sizeof(xerrno); - if (getsockopt(channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen)) + int xlen = sizeof (xerrno); + if (getsockopt (channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen)) xerrno = errno; } #else { struct sockaddr pname; - int pnamelen = sizeof(pname); + int pnamelen = sizeof (pname); /* If connection failed, getpeername will fail. */ xerrno = 0; - if (getpeername(channel, &pname, &pnamelen) < 0) + if (getpeername (channel, &pname, &pnamelen) < 0) { /* Obtain connect failure code through error slippage. */ char dummy; xerrno = errno; - if (errno == ENOTCONN && read(channel, &dummy, 1) < 0) + if (errno == ENOTCONN && read (channel, &dummy, 1) < 0) xerrno = errno; } } @@ -6336,7 +6336,7 @@ CHECK_SYMBOL (sigcode); name = SDATA (SYMBOL_NAME (sigcode)); - if (!strncmp(name, "SIG", 3) || !strncmp(name, "sig", 3)) + if (!strncmp (name, "SIG", 3) || !strncmp (name, "sig", 3)) name += 3; if (0) @@ -7252,7 +7252,7 @@ processes. As such, we only change the default value. */ if (initialized) { - char *release = get_operating_system_release(); + char *release = get_operating_system_release (); if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION && release[1] == '.')) { Vprocess_connection_type = Qnil;
--- a/src/sysdep.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/sysdep.c Wed Jul 07 12:15:48 2010 +0000 @@ -182,7 +182,7 @@ Any other returned value must be freed with free. This is used only when get_current_dir_name is not defined on the system. */ char* -get_current_dir_name () +get_current_dir_name (void) { char *buf; char *pwd; @@ -363,7 +363,8 @@ #ifndef subprocesses -wait_without_blocking () +void +wait_without_blocking (void) { croak ("wait_without_blocking"); synch_process_alive = 0; @@ -800,7 +801,7 @@ void unrequest_sigio (void) -{ +{ if (noninteractive) return; @@ -820,7 +821,7 @@ #ifndef MSDOS void -request_sigio () +request_sigio (void) { if (noninteractive || read_socket_hook) return; @@ -829,7 +830,7 @@ } void -unrequest_sigio () +unrequest_sigio (void) { if (noninteractive || read_socket_hook) return; @@ -1019,10 +1020,10 @@ if (!tty_out->output) return; /* The tty is suspended. */ - + if (! tty_out->old_tty) tty_out->old_tty = (struct emacs_tty *) xmalloc (sizeof (struct emacs_tty)); - + EMACS_GET_TTY (fileno (tty_out->input), tty_out->old_tty); tty = *tty_out->old_tty; @@ -1080,7 +1081,7 @@ means that the interrupt and quit feature must be disabled on secondary ttys, or we would not even see the keypress. - + Note that even though emacsclient could have special code to pass SIGINT to Emacs, we should _not_ enable interrupt/quit keys for emacsclient frames. This means @@ -1098,7 +1099,7 @@ tty.main.c_cc[VSWTCH] = CDISABLE; /* Turn off shell layering use of C-z */ #endif /* VSWTCH */ - + #if defined (__mips__) || defined (HAVE_TCATTR) #ifdef VSUSP tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off mips handling of C-z. */ @@ -1189,9 +1190,9 @@ tty.tchars.t_startc = '\021'; tty.tchars.t_stopc = '\023'; } - + tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | tty_out->old_tty.lmode; - + #endif /* HAVE_TCHARS */ #endif /* not HAVE_TERMIO */ @@ -1411,11 +1412,11 @@ if (!tty_out->output) return; /* The tty is suspended. */ - + /* Go to and clear the last line of the terminal. */ cmgoto (tty_out, FrameRows (tty_out) - 1, 0); - + /* Code adapted from tty_clear_end_of_line. */ if (tty_out->TS_clr_line) { @@ -1425,16 +1426,16 @@ { /* have to do it the hard way */ int i; tty_turn_off_insert (tty_out); - + for (i = curX (tty_out); i < FrameCols (tty_out) - 1; i++) { fputc (' ', tty_out->output); } } - + cmgoto (tty_out, FrameRows (tty_out) - 1, 0); fflush (tty_out->output); - + if (tty_out->terminal->reset_terminal_modes_hook) tty_out->terminal->reset_terminal_modes_hook (tty_out->terminal); @@ -1645,7 +1646,7 @@ struct addrinfo hints; int ret; - memset (&hints, 0, sizeof(hints)); + memset (&hints, 0, sizeof (hints)); hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_CANONNAME; @@ -1757,8 +1758,8 @@ int read_alarm_should_throw; -SIGTYPE -select_alarm () +void +select_alarm (int ignore) { select_alarmed = 1; signal (SIGALRM, SIG_IGN); @@ -1770,13 +1771,12 @@ #ifndef WINDOWSNT /* Only rfds are checked. */ int -sys_select (nfds, rfds, wfds, efds, timeout) - int nfds; - SELECT_TYPE *rfds, *wfds, *efds; - EMACS_TIME *timeout; +sys_select (int nfds, + SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, + EMACS_TIME *timeout) { /* XXX This needs to be updated for multi-tty support. Is there - anybody who needs to emulate select these days? */ + anybody who needs to emulate select these days? */ int ravail = 0; SELECT_TYPE orfds; int timeoutval; @@ -1907,7 +1907,7 @@ waiting for at least one character. */ void -read_input_waiting () +read_input_waiting (void) { /* XXX This needs to be updated for multi-tty support. Is there anybody who needs to emulate select these days? */ @@ -2421,11 +2421,10 @@ #ifndef HAVE_GETWD char * -getwd (pathname) - char *pathname; +getwd (char *pathname) { char *npath, *spath; - extern char *getcwd (); + extern char *getcwd (char *, size_t); BLOCK_INPUT; /* getcwd uses malloc */ spath = npath = getcwd ((char *) 0, MAXPATHLEN); @@ -2454,9 +2453,8 @@ #ifndef HAVE_RENAME -rename (from, to) - const char *from; - const char *to; +int +rename (const char *from, const char *to) { if (access (from, 0) == 0) { @@ -2476,7 +2474,8 @@ /* HPUX curses library references perror, but as far as we know it won't be called. Anyway this definition will do for now. */ -perror () +void +perror (void) { } #endif /* HPUX and not HAVE_PERROR */ @@ -2489,9 +2488,8 @@ * until we are, then close the unsuccessful ones. */ -dup2 (oldd, newd) - int oldd; - int newd; +int +dup2 (int oldd, int newd) { register int fd, ret; @@ -2525,11 +2523,9 @@ /* ARGSUSED */ int -gettimeofday (tp, tzp) - struct timeval *tp; - struct timezone *tzp; +gettimeofday (struct timeval *tp, struct timezone *tzp) { - extern long time (); + extern long time (long); tp->tv_sec = time ((long *)0); tp->tv_usec = 0; @@ -2616,9 +2612,7 @@ * Make a directory. */ int -mkdir (dpath, dmode) - char *dpath; - int dmode; +mkdir (char *dpath, int dmode) { int cpid, status, fd; struct stat statbuf; @@ -2676,8 +2670,7 @@ #ifndef HAVE_RMDIR int -rmdir (dpath) - char *dpath; +rmdir (char *dpath) { int cpid, status, fd; struct stat statbuf; @@ -2724,8 +2717,7 @@ #ifndef HAVE_STRSIGNAL char * -strsignal (code) - int code; +strsignal (int code) { char *signame = 0; @@ -2741,7 +2733,8 @@ #ifdef HAVE_TERMIOS /* For make-serial-process */ -int serial_open (char *port) +int +serial_open (char *port) { int fd = -1; @@ -2774,7 +2767,8 @@ #if !defined (HAVE_CFMAKERAW) /* Workaround for targets which are missing cfmakeraw. */ /* Pasted from man page. */ -static void cfmakeraw (struct termios *termios_p) +static void +cfmakeraw (struct termios *termios_p) { termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); termios_p->c_oflag &= ~OPOST; @@ -2786,7 +2780,8 @@ #if !defined (HAVE_CFSETSPEED) /* Workaround for targets which are missing cfsetspeed. */ -static int cfsetspeed (struct termios *termios_p, speed_t vitesse) +static int +cfsetspeed (struct termios *termios_p, speed_t vitesse) { return (cfsetispeed (termios_p, vitesse) + cfsetospeed (termios_p, vitesse)); @@ -2796,7 +2791,7 @@ /* For serial-process-configure */ void serial_configure (struct Lisp_Process *p, - Lisp_Object contact) + Lisp_Object contact) { Lisp_Object childp2 = Qnil; Lisp_Object tem = Qnil; @@ -2839,7 +2834,7 @@ CHECK_NUMBER (tem); if (XINT (tem) != 7 && XINT (tem) != 8) error (":bytesize must be nil (8), 7, or 8"); - summary[0] = XINT(tem) + '0'; + summary[0] = XINT (tem) + '0'; #if defined (CSIZE) && defined (CS7) && defined (CS8) attr.c_cflag &= ~CSIZE; attr.c_cflag |= ((XINT (tem) == 7) ? CS7 : CS8); @@ -2997,7 +2992,7 @@ #elif !defined (WINDOWSNT) && !defined (MSDOS) Lisp_Object -list_system_processes () +list_system_processes (void) { return Qnil; } @@ -3196,7 +3191,7 @@ procfn_end = fn + strlen (fn); strcpy (procfn_end, "/stat"); fd = emacs_open (fn, O_RDONLY, 0); - if (fd >= 0 && (nread = emacs_read (fd, procbuf, sizeof(procbuf) - 1)) > 0) + if (fd >= 0 && (nread = emacs_read (fd, procbuf, sizeof (procbuf) - 1)) > 0) { procbuf[nread] = '\0'; p = procbuf; @@ -3457,7 +3452,7 @@ strcpy (procfn_end, "/psinfo"); fd = emacs_open (fn, O_RDONLY, 0); if (fd >= 0 - && (nread = read (fd, (char*)&pinfo, sizeof(struct psinfo)) > 0)) + && (nread = read (fd, (char*)&pinfo, sizeof (struct psinfo)) > 0)) { attrs = Fcons (Fcons (Qppid, make_fixnum_or_float (pinfo.pr_ppid)), attrs); attrs = Fcons (Fcons (Qpgrp, make_fixnum_or_float (pinfo.pr_pgid)), attrs);
--- a/src/w32.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32.c Wed Jul 07 12:15:48 2010 +0000 @@ -148,7 +148,7 @@ typedef HRESULT (WINAPI * ShGetFolderPath_fn) (IN HWND, IN int, IN HANDLE, IN DWORD, OUT char *); -void globals_of_w32 (); +void globals_of_w32 (void); static DWORD get_rid (PSID); extern Lisp_Object Vw32_downcase_file_names; @@ -308,15 +308,15 @@ /* ** A utility function ** */ static BOOL -is_windows_9x () +is_windows_9x (void) { static BOOL s_b_ret=0; OSVERSIONINFO os_ver; if (g_b_init_is_windows_9x == 0) { g_b_init_is_windows_9x = 1; - ZeroMemory(&os_ver, sizeof(OSVERSIONINFO)); - os_ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + ZeroMemory (&os_ver, sizeof (OSVERSIONINFO)); + os_ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); if (GetVersionEx (&os_ver)) { s_b_ret = (os_ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS); @@ -329,12 +329,12 @@ Returns a list of three integers if the times are provided by the OS (NT derivatives), otherwise it returns the result of current-time. */ Lisp_Object -w32_get_internal_run_time () +w32_get_internal_run_time (void) { if (get_process_times_fn) { FILETIME create, exit, kernel, user; - HANDLE proc = GetCurrentProcess(); + HANDLE proc = GetCurrentProcess (); if ((*get_process_times_fn) (proc, &create, &exit, &kernel, &user)) { LARGE_INTEGER user_int, kernel_int, total; @@ -753,7 +753,7 @@ lpSystemInfo->dwNumberOfProcessors = -1; } -BOOL WINAPI get_system_times( +BOOL WINAPI get_system_times ( LPFILETIME lpIdleTime, LPFILETIME lpKernelTime, LPFILETIME lpUserTime) @@ -1035,13 +1035,13 @@ }; unsigned -getuid () +getuid (void) { return dflt_passwd.pw_uid; } unsigned -geteuid () +geteuid (void) { /* I could imagine arguing for checking to see whether the user is in the Administrators group and returning a UID of 0 for that @@ -1050,13 +1050,13 @@ } unsigned -getgid () +getgid (void) { return dflt_passwd.pw_gid; } unsigned -getegid () +getegid (void) { return getgid (); } @@ -1091,7 +1091,7 @@ } void -init_user_info () +init_user_info (void) { /* Find the user's real name by opening the process token and looking up the name associated with the user-sid in that token. @@ -1207,7 +1207,7 @@ } int -random () +random (void) { /* rand () on NT gives us 15 random bits...hack together 30 bits. */ return ((rand () << 15) | rand ()); @@ -1225,9 +1225,7 @@ case path name components to lower case. */ static void -normalize_filename (fp, path_sep) - register char *fp; - char path_sep; +normalize_filename (register char *fp, char path_sep) { char sep; char *elem; @@ -1283,16 +1281,14 @@ /* Destructively turn backslashes into slashes. */ void -dostounix_filename (p) - register char *p; +dostounix_filename (register char *p) { normalize_filename (p, '/'); } /* Destructively turn slashes into backslashes. */ void -unixtodos_filename (p) - register char *p; +unixtodos_filename (register char *p) { normalize_filename (p, '\\'); } @@ -1301,9 +1297,7 @@ (From msdos.c...probably should figure out a way to share it, although this code isn't going to ever change.) */ int -crlf_to_lf (n, buf) - register int n; - register unsigned char *buf; +crlf_to_lf (register int n, register unsigned char *buf) { unsigned char *np = buf; unsigned char *startp = buf; @@ -1520,9 +1514,7 @@ #define REG_ROOT "SOFTWARE\\GNU\\Emacs" LPBYTE -w32_get_resource (key, lpdwtype) - char *key; - LPDWORD lpdwtype; +w32_get_resource (char *key, LPDWORD lpdwtype) { LPBYTE lpvalue; HKEY hrootkey = NULL; @@ -1642,7 +1634,7 @@ {"LANG", NULL}, }; -#define N_ENV_VARS sizeof(dflt_envvars)/sizeof(dflt_envvars[0]) +#define N_ENV_VARS sizeof (dflt_envvars)/sizeof (dflt_envvars[0]) /* We need to copy dflt_envvars[] and work on the copy because we don't want the dumped Emacs to inherit the values of @@ -1715,7 +1707,7 @@ for (p = modname; *p; p++) if (*p == '\\') *p = '/'; - _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname); + _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname); _putenv (strdup (buf)); } /* Handle running emacs from the build directory: src/oo-spd/i386/ */ @@ -1739,7 +1731,7 @@ for (p = modname; *p; p++) if (*p == '\\') *p = '/'; - _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname); + _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname); _putenv (strdup (buf)); } } @@ -1767,12 +1759,12 @@ char buf1[SET_ENV_BUF_SIZE], buf2[SET_ENV_BUF_SIZE]; if (dwType == REG_EXPAND_SZ) - ExpandEnvironmentStrings ((LPSTR) lpval, buf1, sizeof(buf1)); + ExpandEnvironmentStrings ((LPSTR) lpval, buf1, sizeof (buf1)); else if (dwType == REG_SZ) strcpy (buf1, lpval); if (dwType == REG_EXPAND_SZ || dwType == REG_SZ) { - _snprintf (buf2, sizeof(buf2)-1, "%s=%s", env_vars[i].name, + _snprintf (buf2, sizeof (buf2)-1, "%s=%s", env_vars[i].name, buf1); _putenv (strdup (buf2)); } @@ -2115,7 +2107,7 @@ involve network access, and so is extremely quick). */ /* Map drive letter to UNC if remote. */ - if ( isalpha( root_dir[0] ) && !fixed[ DRIVE_INDEX( root_dir[0] ) ] ) + if (isalpha (root_dir[0]) && !fixed[DRIVE_INDEX (root_dir[0])]) { char remote_name[ 256 ]; char drive[3] = { root_dir[0], ':' }; @@ -2514,8 +2506,8 @@ nr.lpComment = NULL; nr.lpProvider = NULL; - result = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_DISK, - RESOURCEUSAGE_CONNECTABLE, &nr, &henum); + result = WNetOpenEnum (RESOURCE_GLOBALNET, RESOURCETYPE_DISK, + RESOURCEUSAGE_CONNECTABLE, &nr, &henum); if (result == NO_ERROR) return henum; @@ -2691,7 +2683,7 @@ } FILE * -sys_fopen(const char * path, const char * mode) +sys_fopen (const char * path, const char * mode) { int fd; int oflag; @@ -2778,7 +2770,7 @@ data.wid.dwStreamId = BACKUP_LINK; data.wid.dwStreamAttributes = 0; - data.wid.Size.LowPart = wlen * sizeof(WCHAR); + data.wid.Size.LowPart = wlen * sizeof (WCHAR); data.wid.Size.HighPart = 0; data.wid.dwStreamNameSize = 0; @@ -2980,7 +2972,7 @@ } while (0) static void -initialize_utc_base () +initialize_utc_base (void) { /* Determine the delta between 1-Jan-1601 and 1-Jan-1970. */ SYSTEMTIME st; @@ -3191,7 +3183,7 @@ char name[UNLEN+1]; DWORD name_len = sizeof (name); char domain[1024]; - DWORD domain_len = sizeof(domain); + DWORD domain_len = sizeof (domain); char *mp = NULL; int use_dflt = 0; int result; @@ -3666,7 +3658,7 @@ /* Helper wrapper functions. */ -HANDLE WINAPI create_toolhelp32_snapshot( +HANDLE WINAPI create_toolhelp32_snapshot ( DWORD Flags, DWORD Ignored) { @@ -3686,7 +3678,7 @@ return (s_pfn_Create_Toolhelp32_Snapshot (Flags, Ignored)); } -BOOL WINAPI process32_first( +BOOL WINAPI process32_first ( HANDLE hSnapshot, LPPROCESSENTRY32 lppe) { @@ -3706,7 +3698,7 @@ return (s_pfn_Process32_First (hSnapshot, lppe)); } -BOOL WINAPI process32_next( +BOOL WINAPI process32_next ( HANDLE hSnapshot, LPPROCESSENTRY32 lppe) { @@ -3904,7 +3896,7 @@ } Lisp_Object -list_system_processes () +list_system_processes (void) { struct gcpro gcpro1; Lisp_Object proclist = Qnil; @@ -3995,8 +3987,7 @@ } static Lisp_Object -ltime (time_sec, time_usec) - long time_sec, time_usec; +ltime (long time_sec, long time_usec) { return list3 (make_number ((time_sec >> 16) & 0xffff), make_number (time_sec & 0xffff), @@ -4006,18 +3997,17 @@ #define U64_TO_LISP_TIME(time) ltime ((time) / 1000000L, (time) % 1000000L) static int -process_times (h_proc, ctime, etime, stime, utime, ttime, pcpu) - HANDLE h_proc; - Lisp_Object *ctime, *etime, *stime, *utime, *ttime; - double *pcpu; +process_times (HANDLE h_proc, Lisp_Object *ctime, Lisp_Object *etime, + Lisp_Object *stime, Lisp_Object *utime, Lisp_Object *ttime, + double *pcpu) { FILETIME ft_creation, ft_exit, ft_kernel, ft_user, ft_current; ULONGLONG tem1, tem2, tem3, tem; if (!h_proc || !get_process_times_fn - || !(*get_process_times_fn)(h_proc, &ft_creation, &ft_exit, - &ft_kernel, &ft_user)) + || !(*get_process_times_fn) (h_proc, &ft_creation, &ft_exit, + &ft_kernel, &ft_user)) return 0; GetSystemTimeAsFileTime (&ft_current); @@ -4059,8 +4049,7 @@ } Lisp_Object -system_process_attributes (pid) - Lisp_Object pid; +system_process_attributes (Lisp_Object pid) { struct gcpro gcpro1, gcpro2, gcpro3; Lisp_Object attrs = Qnil; @@ -4459,34 +4448,34 @@ if ((pfn_##fn = (void *) GetProcAddress (winsock_lib, #fn)) == NULL) \ goto fail; - LOAD_PROC( WSAStartup ); - LOAD_PROC( WSASetLastError ); - LOAD_PROC( WSAGetLastError ); - LOAD_PROC( WSAEventSelect ); - LOAD_PROC( WSACreateEvent ); - LOAD_PROC( WSACloseEvent ); - LOAD_PROC( socket ); - LOAD_PROC( bind ); - LOAD_PROC( connect ); - LOAD_PROC( ioctlsocket ); - LOAD_PROC( recv ); - LOAD_PROC( send ); - LOAD_PROC( closesocket ); - LOAD_PROC( shutdown ); - LOAD_PROC( htons ); - LOAD_PROC( ntohs ); - LOAD_PROC( inet_addr ); - LOAD_PROC( gethostname ); - LOAD_PROC( gethostbyname ); - LOAD_PROC( getservbyname ); - LOAD_PROC( getpeername ); - LOAD_PROC( WSACleanup ); - LOAD_PROC( setsockopt ); - LOAD_PROC( listen ); - LOAD_PROC( getsockname ); - LOAD_PROC( accept ); - LOAD_PROC( recvfrom ); - LOAD_PROC( sendto ); + LOAD_PROC (WSAStartup); + LOAD_PROC (WSASetLastError); + LOAD_PROC (WSAGetLastError); + LOAD_PROC (WSAEventSelect); + LOAD_PROC (WSACreateEvent); + LOAD_PROC (WSACloseEvent); + LOAD_PROC (socket); + LOAD_PROC (bind); + LOAD_PROC (connect); + LOAD_PROC (ioctlsocket); + LOAD_PROC (recv); + LOAD_PROC (send); + LOAD_PROC (closesocket); + LOAD_PROC (shutdown); + LOAD_PROC (htons); + LOAD_PROC (ntohs); + LOAD_PROC (inet_addr); + LOAD_PROC (gethostname); + LOAD_PROC (gethostbyname); + LOAD_PROC (getservbyname); + LOAD_PROC (getpeername); + LOAD_PROC (WSACleanup); + LOAD_PROC (setsockopt); + LOAD_PROC (listen); + LOAD_PROC (getsockname); + LOAD_PROC (accept); + LOAD_PROC (recvfrom); + LOAD_PROC (sendto); #undef LOAD_PROC /* specify version 1.1 of winsock */ @@ -4526,7 +4515,7 @@ normal system codes where they overlap (non-overlapping definitions are already in <sys/socket.h> */ static void -set_errno () +set_errno (void) { if (winsock_lib == NULL) h_errno = EINVAL; @@ -4548,7 +4537,7 @@ } static void -check_errno () +check_errno (void) { if (h_errno == 0 && winsock_lib != NULL) pfn_WSASetLastError (0); @@ -4631,7 +4620,7 @@ }; char * -sys_strerror(int error_no) +sys_strerror (int error_no) { int i; static char unknown_msg[40]; @@ -4643,7 +4632,7 @@ if (_wsa_errlist[i].errnum == error_no) return _wsa_errlist[i].msg; - sprintf(unknown_msg, "Unidentified error: %d", error_no); + sprintf (unknown_msg, "Unidentified error: %d", error_no); return unknown_msg; } @@ -4662,7 +4651,7 @@ int socket_to_fd (SOCKET s); int -sys_socket(int af, int type, int protocol) +sys_socket (int af, int type, int protocol) { SOCKET s; @@ -4865,7 +4854,7 @@ } struct hostent * -sys_gethostbyname(const char * name) +sys_gethostbyname (const char * name) { struct hostent * host; @@ -4883,7 +4872,7 @@ } struct servent * -sys_getservbyname(const char * name, const char * proto) +sys_getservbyname (const char * name, const char * proto) { struct servent * serv; @@ -5038,7 +5027,7 @@ int sys_recvfrom (int s, char * buf, int len, int flags, - struct sockaddr * from, int * fromlen) + struct sockaddr * from, int * fromlen) { if (winsock_lib == NULL) { @@ -5536,8 +5525,8 @@ int res = pfn_recv (SOCK_HANDLE (fd), buffer, count, 0); if (res == SOCKET_ERROR) { - DebPrint(("sys_read.recv failed with error %d on socket %ld\n", - pfn_WSAGetLastError (), SOCK_HANDLE (fd))); + DebPrint (("sys_read.recv failed with error %d on socket %ld\n", + pfn_WSAGetLastError (), SOCK_HANDLE (fd))); set_errno (); return -1; } @@ -5693,8 +5682,8 @@ if (nchars == SOCKET_ERROR) { - DebPrint(("sys_write.send failed with error %d on socket %ld\n", - pfn_WSAGetLastError (), SOCK_HANDLE (fd))); + DebPrint (("sys_write.send failed with error %d on socket %ld\n", + pfn_WSAGetLastError (), SOCK_HANDLE (fd))); set_errno (); } } @@ -5733,7 +5722,7 @@ } static void -check_windows_init_file () +check_windows_init_file (void) { extern int noninteractive, inhibit_window_system; @@ -5789,7 +5778,7 @@ } void -term_ntproc () +term_ntproc (void) { #ifdef HAVE_SOCKETS /* shutdown the socket interface if necessary */ @@ -5800,7 +5789,7 @@ } void -init_ntproc () +init_ntproc (void) { #ifdef HAVE_SOCKETS /* Initialise the socket interface now if available and requested by @@ -5908,7 +5897,8 @@ shutdown_handler ensures that buffers' autosave files are up to date when the user logs off, or the system shuts down. */ -BOOL WINAPI shutdown_handler(DWORD type) +BOOL WINAPI +shutdown_handler (DWORD type) { /* Ctrl-C and Ctrl-Break are already suppressed, so don't handle them. */ if (type == CTRL_CLOSE_EVENT /* User closes console window. */ @@ -5929,7 +5919,7 @@ initialized is non zero (see the function main in emacs.c). */ void -globals_of_w32 () +globals_of_w32 (void) { HMODULE kernel32 = GetModuleHandle ("kernel32.dll"); @@ -5967,14 +5957,15 @@ console apps. This actually applies to Emacs in both console and GUI modes, since we had to fool windows into thinking emacs is a console application to get console mode to work. */ - SetConsoleCtrlHandler(shutdown_handler, TRUE); + SetConsoleCtrlHandler (shutdown_handler, TRUE); /* "None" is the default group name on standalone workstations. */ strcpy (dflt_group_name, "None"); } /* For make-serial-process */ -int serial_open (char *port) +int +serial_open (char *port) { HANDLE hnd; child_process *cp; @@ -6014,7 +6005,7 @@ /* For serial-process-configure */ void serial_configure (struct Lisp_Process *p, - Lisp_Object contact) + Lisp_Object contact) { Lisp_Object childp2 = Qnil; Lisp_Object tem = Qnil;
--- a/src/w32console.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32console.c Wed Jul 07 12:15:48 2010 +0000 @@ -42,13 +42,13 @@ #include "w32inevt.h" /* from window.c */ -extern Lisp_Object Frecenter (); +extern Lisp_Object Frecenter (Lisp_Object); /* from keyboard.c */ -extern int detect_input_pending (); +extern int detect_input_pending (void); /* from sysdep.c */ -extern int read_input_pending (); +extern int read_input_pending (void); static void w32con_move_cursor (struct frame *f, int row, int col); static void w32con_clear_to_end (struct frame *f); @@ -68,7 +68,7 @@ static COORD cursor_coords; static HANDLE prev_screen, cur_screen; static WORD char_attr_normal; -static DWORD prev_console_mode; +static DWORD prev_console_mode; #ifndef USE_SEPARATE_SCREEN static CONSOLE_CURSOR_INFO prev_console_cursor; @@ -268,7 +268,8 @@ /* If start is zero insert blanks instead of a string at start ?. */ static void -w32con_insert_glyphs (struct frame *f, register struct glyph *start, register int len) +w32con_insert_glyphs (struct frame *f, register struct glyph *start, + register int len) { scroll_line (f, len, RIGHT); @@ -286,7 +287,7 @@ } } -extern unsigned char *encode_terminal_code (struct glyph *, int, +extern unsigned char *encode_terminal_code (struct glyph *, int, struct coding_system *); static void @@ -438,7 +439,7 @@ FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r); /* Now that the screen is clear, put the cursor at the top. */ SetConsoleCursorPosition (cur_screen, dest); - + #ifdef USE_SEPARATE_SCREEN SetConsoleActiveScreenBuffer (prev_screen); #else @@ -492,7 +493,7 @@ ***********************************************************************/ void -sys_tputs (char *str, int nlines, int (*outfun)(int)) +sys_tputs (char *str, int nlines, int (*outfun) (int)) { } @@ -511,13 +512,13 @@ int cost = 0; int -evalcost (char c) +evalcost (int c) { return c; } int -cmputc (char c) +cmputc (int c) { return c; } @@ -551,9 +552,7 @@ /* Turn appearances of face FACE_ID on tty frame F on. */ static WORD -w32_face_attributes (f, face_id) - struct frame *f; - int face_id; +w32_face_attributes (struct frame *f, int face_id) { WORD char_attr; struct face *face = FACE_FROM_ID (f, face_id); @@ -609,8 +608,6 @@ return Qunspecified; /* meaning the default */ } -typedef int (*term_hook) (); - void initialize_w32_display (struct terminal *term) { @@ -618,19 +615,19 @@ term->rif = 0; /* No window based redisplay on the console. */ term->cursor_to_hook = w32con_move_cursor; - term->raw_cursor_to_hook = w32con_move_cursor; - term->clear_to_end_hook = w32con_clear_to_end; - term->clear_frame_hook = w32con_clear_frame; + term->raw_cursor_to_hook = w32con_move_cursor; + term->clear_to_end_hook = w32con_clear_to_end; + term->clear_frame_hook = w32con_clear_frame; term->clear_end_of_line_hook = w32con_clear_end_of_line; - term->ins_del_lines_hook = w32con_ins_del_lines; - term->insert_glyphs_hook = w32con_insert_glyphs; - term->write_glyphs_hook = w32con_write_glyphs; - term->delete_glyphs_hook = w32con_delete_glyphs; + term->ins_del_lines_hook = w32con_ins_del_lines; + term->insert_glyphs_hook = w32con_insert_glyphs; + term->write_glyphs_hook = w32con_write_glyphs; + term->delete_glyphs_hook = w32con_delete_glyphs; term->ring_bell_hook = w32_sys_ring_bell; - term->reset_terminal_modes_hook = w32con_reset_terminal_modes; + term->reset_terminal_modes_hook = w32con_reset_terminal_modes; term->set_terminal_modes_hook = w32con_set_terminal_modes; - term->set_terminal_window_hook = w32con_set_terminal_window; - term->update_begin_hook = w32con_update_begin; + term->set_terminal_window_hook = w32con_set_terminal_window; + term->update_begin_hook = w32con_update_begin; term->update_end_hook = w32con_update_end; term->read_socket_hook = w32_console_read_socket; @@ -674,8 +671,8 @@ /* Respect setting of LINES and COLUMNS environment variables. */ { - char * lines = getenv("LINES"); - char * columns = getenv("COLUMNS"); + char * lines = getenv ("LINES"); + char * columns = getenv ("COLUMNS"); if (lines != NULL && columns != NULL) { @@ -775,7 +772,7 @@ } void -syms_of_ntterm () +syms_of_ntterm (void) { DEFVAR_BOOL ("w32-use-full-screen-buffer", &w32_use_full_screen_buffer,
--- a/src/w32fns.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32fns.c Wed Jul 07 12:15:48 2010 +0000 @@ -69,11 +69,11 @@ #define FOF_NO_CONNECTED_ELEMENTS 0x2000 #endif -void syms_of_w32fns (); -void globals_of_w32fns (); - -extern void free_frame_menubar (); -extern double atof (); +void syms_of_w32fns (void); +void globals_of_w32fns (void); + +extern void free_frame_menubar (struct frame *); +extern double atof (const char *); extern int w32_console_toggle_lock_key (int, Lisp_Object); extern void w32_menu_display_help (HWND, HMENU, UINT, UINT); extern void w32_free_menu_strings (HWND); @@ -316,7 +316,7 @@ static int menubar_in_use = 0; /* From w32uniscribe.c */ -extern void syms_of_w32uniscribe (); +extern void syms_of_w32uniscribe (void); extern int uniscribe_available; /* Function prototypes for hourglass support. */ @@ -327,7 +327,7 @@ /* Error if we are not connected to MS-Windows. */ void -check_w32 () +check_w32 (void) { if (! w32_in_use) error ("MS-Windows not in use or not initialized"); @@ -337,7 +337,7 @@ You should not call this unless HAVE_MENUS is defined. */ int -have_menus_p () +have_menus_p (void) { return w32_in_use; } @@ -346,8 +346,7 @@ and checking validity for W32. */ FRAME_PTR -check_x_frame (frame) - Lisp_Object frame; +check_x_frame (Lisp_Object frame) { FRAME_PTR f; @@ -365,8 +364,7 @@ the first display on the list. */ struct w32_display_info * -check_x_display_info (frame) - Lisp_Object frame; +check_x_display_info (Lisp_Object frame) { if (NILP (frame)) { @@ -397,9 +395,7 @@ /* This function can be called during GC, so use GC_xxx type test macros. */ struct frame * -x_window_to_frame (dpyinfo, wdesc) - struct w32_display_info *dpyinfo; - HWND wdesc; +x_window_to_frame (struct w32_display_info *dpyinfo, HWND wdesc) { Lisp_Object tail, frame; struct frame *f; @@ -449,9 +445,7 @@ not Emacs's own window. */ void -x_real_positions (f, xptr, yptr) - FRAME_PTR f; - int *xptr, *yptr; +x_real_positions (FRAME_PTR f, int *xptr, int *yptr) { POINT pt; RECT rect; @@ -790,8 +784,7 @@ } static Lisp_Object -w32_to_x_color (rgb) - Lisp_Object rgb; +w32_to_x_color (Lisp_Object rgb) { Lisp_Object color; @@ -810,8 +803,7 @@ } static Lisp_Object -w32_color_map_lookup (colorname) - char *colorname; +w32_color_map_lookup (char *colorname) { Lisp_Object tail, ret = Qnil; @@ -843,8 +835,7 @@ static void -add_system_logical_colors_to_map (system_colors) - Lisp_Object *system_colors; +add_system_logical_colors_to_map (Lisp_Object *system_colors) { HKEY colors_key; @@ -892,8 +883,7 @@ static Lisp_Object -x_to_w32_color (colorname) - char * colorname; +x_to_w32_color (char * colorname) { register Lisp_Object ret = Qnil; @@ -1204,9 +1194,7 @@ /* Gamma-correct COLOR on frame F. */ void -gamma_correct (f, color) - struct frame *f; - COLORREF *color; +gamma_correct (struct frame *f, COLORREF *color) { if (f->gamma) { @@ -1223,11 +1211,7 @@ If ALLOC is nonzero, allocate a new colormap cell. */ int -w32_defined_color (f, color, color_def, alloc) - FRAME_PTR f; - char *color; - XColor *color_def; - int alloc; +w32_defined_color (FRAME_PTR f, char *color, XColor *color_def, int alloc) { register Lisp_Object tem; COLORREF w32_color_ref; @@ -1299,10 +1283,7 @@ ARG says. */ int -x_decode_color (f, arg, def) - FRAME_PTR f; - Lisp_Object arg; - int def; +x_decode_color (FRAME_PTR f, Lisp_Object arg, int def) { XColor cdef; @@ -1336,9 +1317,7 @@ in the standard place; do not attempt to change the window. */ void -x_set_foreground_color (f, arg, oldval) - struct frame *f; - Lisp_Object arg, oldval; +x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { struct w32_output *x = f->output_data.w32; PIX_TYPE fg, old_fg; @@ -1359,9 +1338,7 @@ } void -x_set_background_color (f, arg, oldval) - struct frame *f; - Lisp_Object arg, oldval; +x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { FRAME_BACKGROUND_PIXEL (f) = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); @@ -1379,9 +1356,7 @@ } void -x_set_mouse_color (f, arg, oldval) - struct frame *f; - Lisp_Object arg, oldval; +x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { Cursor cursor, nontext_cursor, mode_cursor, hand_cursor; int count; @@ -1528,9 +1503,7 @@ } void -x_set_cursor_color (f, arg, oldval) - struct frame *f; - Lisp_Object arg, oldval; +x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { unsigned long fore_pixel, pixel; @@ -1577,9 +1550,7 @@ F has a window. */ void -x_set_border_pixel (f, pix) - struct frame *f; - int pix; +x_set_border_pixel (struct frame *f, int pix) { f->output_data.w32->border_pixel = pix; @@ -1598,9 +1569,7 @@ F has a window; it must be redone when the window is created. */ void -x_set_border_color (f, arg, oldval) - struct frame *f; - Lisp_Object arg, oldval; +x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { int pix; @@ -1612,9 +1581,7 @@ void -x_set_cursor_type (f, arg, oldval) - FRAME_PTR f; - Lisp_Object arg, oldval; +x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) { set_frame_cursor_types (f, arg); @@ -1623,9 +1590,7 @@ } void -x_set_icon_type (f, arg, oldval) - struct frame *f; - Lisp_Object arg, oldval; +x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { int result; @@ -1652,9 +1617,7 @@ } void -x_set_icon_name (f, arg, oldval) - struct frame *f; - Lisp_Object arg, oldval; +x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { if (STRINGP (arg)) { @@ -1702,9 +1665,7 @@ void -x_set_menu_bar_lines (f, value, oldval) - struct frame *f; - Lisp_Object value, oldval; +x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) { int nlines; int olines = FRAME_MENU_BAR_LINES (f); @@ -1747,9 +1708,7 @@ The frame's height doesn't change. */ void -x_set_tool_bar_lines (f, value, oldval) - struct frame *f; - Lisp_Object value, oldval; +x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) { int delta, nlines, root_height; Lisp_Object root_window; @@ -1829,10 +1788,7 @@ F->explicit_name is set, ignore the new name; otherwise, set it. */ void -x_set_name (f, name, explicit) - struct frame *f; - Lisp_Object name; - int explicit; +x_set_name (struct frame *f, Lisp_Object name, int explicit) { /* Make sure that requests from lisp code override requests from Emacs redisplay code. */ @@ -1887,9 +1843,7 @@ specified a name for the frame; the name will override any set by the redisplay code. */ void -x_explicitly_set_name (f, arg, oldval) - FRAME_PTR f; - Lisp_Object arg, oldval; +x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) { x_set_name (f, arg, 1); } @@ -1898,9 +1852,7 @@ name; names set this way will never override names set by the user's lisp code. */ void -x_implicitly_set_name (f, arg, oldval) - FRAME_PTR f; - Lisp_Object arg, oldval; +x_implicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) { x_set_name (f, arg, 0); } @@ -1909,9 +1861,7 @@ If NAME is nil, use the frame name as the title. */ void -x_set_title (f, name, old_name) - struct frame *f; - Lisp_Object name, old_name; +x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name) { /* Don't change the title if it's already NAME. */ if (EQ (name, f->title)) @@ -1936,8 +1886,8 @@ } -void x_set_scroll_bar_default_width (f) - struct frame *f; +void +x_set_scroll_bar_default_width (struct frame *f) { int wid = FRAME_COLUMN_WIDTH (f); @@ -1965,11 +1915,10 @@ return cursor; } -extern LRESULT CALLBACK w32_wnd_proc (); +extern LRESULT CALLBACK w32_wnd_proc (HWND, UINT, WPARAM, LPARAM); static BOOL -w32_init_class (hinst) - HINSTANCE hinst; +w32_init_class (HINSTANCE hinst) { WNDCLASS wc; @@ -1988,9 +1937,7 @@ } static HWND -w32_createscrollbar (f, bar) - struct frame *f; - struct scroll_bar * bar; +w32_createscrollbar (struct frame *f, struct scroll_bar * bar) { return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE, /* Position and size of scroll bar. */ @@ -2005,8 +1952,7 @@ } static void -w32_createwindow (f) - struct frame *f; +w32_createwindow (struct frame *f) { HWND hwnd; RECT rect; @@ -2076,12 +2022,7 @@ } static void -my_post_msg (wmsg, hwnd, msg, wParam, lParam) - W32Msg * wmsg; - HWND hwnd; - UINT msg; - WPARAM wParam; - LPARAM lParam; +my_post_msg (W32Msg * wmsg, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { wmsg->msg.hwnd = hwnd; wmsg->msg.message = msg; @@ -2175,7 +2116,7 @@ it regains focus, be conservative and clear all modifiers since we cannot reconstruct the left and right modifier state. */ static void -reset_modifiers () +reset_modifiers (void) { SHORT ctrl, alt; @@ -2222,7 +2163,7 @@ modifier keys, we know that, if no modifiers are set, then neither the left or right modifier should be set. */ static void -sync_modifiers () +sync_modifiers (void) { if (!modifiers_recorded) return; @@ -2308,7 +2249,7 @@ } static unsigned int -w32_get_modifiers () +w32_get_modifiers (void) { return ((modifier_set (VK_SHIFT) ? shift_modifier : 0) | (modifier_set (VK_CONTROL) ? ctrl_modifier : 0) | @@ -2325,7 +2266,7 @@ and window input. */ static int -construct_console_modifiers () +construct_console_modifiers (void) { int mods; @@ -2397,8 +2338,7 @@ combinations like Alt-Tab which are used by the system. */ static void -register_hot_keys (hwnd) - HWND hwnd; +register_hot_keys (HWND hwnd) { Lisp_Object keylist; @@ -2417,8 +2357,7 @@ } static void -unregister_hot_keys (hwnd) - HWND hwnd; +unregister_hot_keys (HWND hwnd) { Lisp_Object keylist; @@ -2624,7 +2563,7 @@ } static void -cancel_all_deferred_msgs () +cancel_all_deferred_msgs (void) { deferred_msg * item; @@ -2669,7 +2608,7 @@ } static void -signal_user_input () +signal_user_input (void) { /* Interrupt any lisp that wants to be interrupted by input. */ if (!NILP (Vthrow_on_input)) @@ -2687,13 +2626,9 @@ static void -post_character_message (hwnd, msg, wParam, lParam, modifiers) - HWND hwnd; - UINT msg; - WPARAM wParam; - LPARAM lParam; - DWORD modifiers; - +post_character_message (HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam, + DWORD modifiers) { W32Msg wmsg; @@ -2753,11 +2688,7 @@ /* Main window procedure */ LRESULT CALLBACK -w32_wnd_proc (hwnd, msg, wParam, lParam) - HWND hwnd; - UINT msg; - WPARAM wParam; - LPARAM lParam; +w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { struct frame *f; struct w32_display_info *dpyinfo = &one_w32_display_info; @@ -3163,7 +3094,7 @@ wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam); /* Get buffer size. */ size = get_composition_string_fn (context, GCS_RESULTSTR, buffer, 0); - buffer = alloca(size); + buffer = alloca (size); size = get_composition_string_fn (context, GCS_RESULTSTR, buffer, size); release_ime_context_fn (hwnd, context); @@ -4007,8 +3938,7 @@ } static void -my_create_window (f) - struct frame * f; +my_create_window (struct frame * f) { MSG msg; @@ -4023,8 +3953,7 @@ messages for the tooltip. Creating tooltips indirectly also creates deadlocks when tooltips are created for menu items. */ static void -my_create_tip_window (f) - struct frame *f; +my_create_tip_window (struct frame *f) { RECT rect; @@ -4067,10 +3996,7 @@ /* Create and set up the w32 window for frame F. */ static void -w32_window (f, window_prompting, minibuffer_only) - struct frame *f; - long window_prompting; - int minibuffer_only; +w32_window (struct frame *f, long window_prompting, int minibuffer_only) { BLOCK_INPUT; @@ -4118,9 +4044,7 @@ well. */ static void -x_icon (f, parms) - struct frame *f; - Lisp_Object parms; +x_icon (struct frame *f, Lisp_Object parms) { Lisp_Object icon_x, icon_y; struct w32_display_info *dpyinfo = &one_w32_display_info; @@ -4159,8 +4083,7 @@ static void -x_make_gc (f) - struct frame *f; +x_make_gc (struct frame *f) { XGCValues gc_values; @@ -4193,8 +4116,7 @@ constructed. */ static Lisp_Object -unwind_create_frame (frame) - Lisp_Object frame; +unwind_create_frame (Lisp_Object frame) { struct frame *f = XFRAME (frame); @@ -4219,9 +4141,7 @@ } static void -x_default_font_parameter (f, parms) - struct frame *f; - Lisp_Object parms; +x_default_font_parameter (struct frame *f, Lisp_Object parms) { struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL, @@ -4587,8 +4507,7 @@ display info directly because we're called from frame.c, which doesn't know about that structure. */ Lisp_Object -x_get_focus_frame (frame) - struct frame *frame; +x_get_focus_frame (struct frame *frame) { struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (frame); Lisp_Object xfocus; @@ -4899,36 +4818,31 @@ } int -x_pixel_width (f) - register struct frame *f; +x_pixel_width (register struct frame *f) { return FRAME_PIXEL_WIDTH (f); } int -x_pixel_height (f) - register struct frame *f; +x_pixel_height (register struct frame *f) { return FRAME_PIXEL_HEIGHT (f); } int -x_char_width (f) - register struct frame *f; +x_char_width (register struct frame *f) { return FRAME_COLUMN_WIDTH (f); } int -x_char_height (f) - register struct frame *f; +x_char_height (register struct frame *f) { return FRAME_LINE_HEIGHT (f); } int -x_screen_planes (f) - register struct frame *f; +x_screen_planes (register struct frame *f) { return FRAME_W32_DISPLAY_INFO (f)->n_planes; } @@ -4937,8 +4851,7 @@ Open a new connection if necessary. */ struct w32_display_info * -x_display_info_for_name (name) - Lisp_Object name; +x_display_info_for_name (Lisp_Object name) { Lisp_Object names; struct w32_display_info *dpyinfo; @@ -5253,7 +5166,7 @@ xdisp.c could be used. */ int -hourglass_started () +hourglass_started (void) { return hourglass_shown_p || hourglass_timer; } @@ -5261,7 +5174,7 @@ /* Cancel a currently active hourglass timer, and start a new one. */ void -start_hourglass () +start_hourglass (void) { DWORD delay; int secs, msecs = 0; @@ -5297,7 +5210,7 @@ cursor if shown. */ void -cancel_hourglass () +cancel_hourglass (void) { if (hourglass_timer) { @@ -5316,8 +5229,7 @@ to indicate that an hourglass cursor is shown. */ static void -w32_show_hourglass (f) - struct frame *f; +w32_show_hourglass (struct frame *f) { if (!hourglass_shown_p) { @@ -5332,7 +5244,7 @@ /* Hide the hourglass cursor on all frames, if it is currently shown. */ static void -w32_hide_hourglass () +w32_hide_hourglass (void) { if (hourglass_shown_p) { @@ -5386,8 +5298,7 @@ static Lisp_Object -unwind_create_tip_frame (frame) - Lisp_Object frame; +unwind_create_tip_frame (Lisp_Object frame) { Lisp_Object deleted; @@ -5412,9 +5323,8 @@ when this happens. */ static Lisp_Object -x_create_tip_frame (dpyinfo, parms, text) - struct w32_display_info *dpyinfo; - Lisp_Object parms, text; +x_create_tip_frame (struct w32_display_info *dpyinfo, + Lisp_Object parms, Lisp_Object text) { struct frame *f; Lisp_Object frame, tem; @@ -5654,11 +5564,9 @@ the display in *ROOT_X, and *ROOT_Y. */ static void -compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) - struct frame *f; - Lisp_Object parms, dx, dy; - int width, height; - int *root_x, *root_y; +compute_tip_xy (struct frame *f, + Lisp_Object parms, Lisp_Object dx, Lisp_Object dy, + int width, int height, int *root_x, int *root_y) { Lisp_Object left, top; int min_x, min_y, max_x, max_y; @@ -6037,11 +5945,7 @@ allows us to work around the fact that the standard Open File dialog does not support directories. */ UINT CALLBACK -file_dialog_callback (hwnd, msg, wParam, lParam) - HWND hwnd; - UINT msg; - WPARAM wParam; - LPARAM lParam; +file_dialog_callback (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { if (msg == WM_NOTIFY) { @@ -6395,8 +6299,7 @@ /* Convert a one-element vector style key sequence to a hot key definition. */ static Lisp_Object -w32_parse_hot_key (key) - Lisp_Object key; +w32_parse_hot_key (Lisp_Object key) { /* Copied from Fdefine_key and store_in_keymap. */ register Lisp_Object c; @@ -6625,7 +6528,7 @@ This is a direct interface to the Windows API FindWindow function. */) (class, name) -Lisp_Object class, name; + Lisp_Object class, name; { HWND hnd; @@ -6963,7 +6866,7 @@ }; void -syms_of_w32fns () +syms_of_w32fns (void) { globals_of_w32fns (); /* This is zero if not using MS-Windows. */ @@ -7320,7 +7223,7 @@ is non zero. */ void -globals_of_w32fns () +globals_of_w32fns (void) { HMODULE user32_lib = GetModuleHandle ("user32.dll"); /* @@ -7363,7 +7266,7 @@ #undef abort void -w32_abort () +w32_abort (void) { int button; button = MessageBox (NULL, @@ -7391,7 +7294,7 @@ /* For convenience when debugging. */ int -w32_last_error () +w32_last_error (void) { return GetLastError (); }
--- a/src/w32font.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32font.c Wed Jul 07 12:15:48 2010 +0000 @@ -153,8 +153,7 @@ static int -memq_no_quit (elt, list) - Lisp_Object elt, list; +memq_no_quit (Lisp_Object elt, Lisp_Object list) { while (CONSP (list) && ! EQ (XCAR (list), elt)) list = XCDR (list); @@ -162,8 +161,7 @@ } Lisp_Object -intern_font_name (string) - char * string; +intern_font_name (char * string) { Lisp_Object obarray, tem, str; int len; @@ -185,8 +183,7 @@ Return a cache of font-entities on FRAME. The cache must be a cons whose cdr part is the actual cache area. */ Lisp_Object -w32font_get_cache (f) - FRAME_PTR f; +w32font_get_cache (FRAME_PTR f) { struct w32_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); @@ -198,8 +195,7 @@ is a vector of font-entities. This is the sole API that allocates font-entities. */ static Lisp_Object -w32font_list (frame, font_spec) - Lisp_Object frame, font_spec; +w32font_list (Lisp_Object frame, Lisp_Object font_spec) { Lisp_Object fonts = w32font_list_internal (frame, font_spec, 0); FONT_ADD_LOG ("w32font-list", font_spec, fonts); @@ -211,8 +207,7 @@ FRAME. The closeness is detemined by the font backend, thus `face-font-selection-order' is ignored here. */ static Lisp_Object -w32font_match (frame, font_spec) - Lisp_Object frame, font_spec; +w32font_match (Lisp_Object frame, Lisp_Object font_spec) { Lisp_Object entity = w32font_match_internal (frame, font_spec, 0); FONT_ADD_LOG ("w32font-match", font_spec, entity); @@ -223,8 +218,7 @@ List available families. The value is a list of family names (symbols). */ static Lisp_Object -w32font_list_family (frame) - Lisp_Object frame; +w32font_list_family (Lisp_Object frame) { Lisp_Object list = Qnil; LOGFONT font_match_pattern; @@ -248,10 +242,7 @@ Open a font specified by FONT_ENTITY on frame F. If the font is scalable, open it with PIXEL_SIZE. */ static Lisp_Object -w32font_open (f, font_entity, pixel_size) - FRAME_PTR f; - Lisp_Object font_entity; - int pixel_size; +w32font_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) { Lisp_Object font_object = font_make_object (VECSIZE (struct w32font_info), @@ -275,9 +266,7 @@ /* w32 implementation of close for font_backend. Close FONT on frame F. */ void -w32font_close (f, font) - FRAME_PTR f; - struct font *font; +w32font_close (FRAME_PTR f, struct font *font) { int i; struct w32font_info *w32_font = (struct w32font_info *) font; @@ -303,9 +292,7 @@ return 1. If not, return 0. If a font must be opened to check it, return -1. */ int -w32font_has_char (entity, c) - Lisp_Object entity; - int c; +w32font_has_char (Lisp_Object entity, int c) { /* We can't be certain about which characters a font will support until we open it. Checking the scripts that the font supports turns out @@ -354,9 +341,7 @@ which characters are not supported by the font. */ static unsigned -w32font_encode_char (font, c) - struct font *font; - int c; +w32font_encode_char (struct font *font, int c) { struct w32font_info * w32_font = (struct w32font_info *)font; @@ -373,11 +358,8 @@ CODE (length NGLYPHS). Apparently metrics can be NULL, in this case just return the overall width. */ int -w32font_text_extents (font, code, nglyphs, metrics) - struct font *font; - unsigned *code; - int nglyphs; - struct font_metrics *metrics; +w32font_text_extents (struct font *font, unsigned *code, + int nglyphs, struct font_metrics *metrics) { int i; HFONT old_font = NULL; @@ -552,9 +534,8 @@ */ int -w32font_draw (s, from, to, x, y, with_background) - struct glyph_string *s; - int from, to, x, y, with_background; +w32font_draw (struct glyph_string *s, int from, int to, + int x, int y, int with_background) { UINT options; HRGN orig_clip = NULL; @@ -568,7 +549,7 @@ /* Save clip region for later restoration. */ orig_clip = CreateRectRgn (0, 0, 0, 0); - if (!GetClipRgn(s->hdc, orig_clip)) + if (!GetClipRgn (s->hdc, orig_clip)) { DeleteObject (orig_clip); orig_clip = NULL; @@ -715,9 +696,7 @@ Additional parameter opentype_only restricts the returned fonts to opentype fonts, which can be used with the Uniscribe backend. */ Lisp_Object -w32font_list_internal (frame, font_spec, opentype_only) - Lisp_Object frame, font_spec; - int opentype_only; +w32font_list_internal (Lisp_Object frame, Lisp_Object font_spec, int opentype_only) { struct font_callback_data match_data; HDC dc; @@ -770,9 +749,7 @@ Additional parameter opentype_only restricts the returned fonts to opentype fonts, which can be used with the Uniscribe backend. */ Lisp_Object -w32font_match_internal (frame, font_spec, opentype_only) - Lisp_Object frame, font_spec; - int opentype_only; +w32font_match_internal (Lisp_Object frame, Lisp_Object font_spec, int opentype_only) { struct font_callback_data match_data; HDC dc; @@ -800,11 +777,8 @@ } int -w32font_open_internal (f, font_entity, pixel_size, font_object) - FRAME_PTR f; - Lisp_Object font_entity; - int pixel_size; - Lisp_Object font_object; +w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity, + int pixel_size, Lisp_Object font_object) { int len, size, i; LOGFONT logfont; @@ -951,11 +925,9 @@ /* Callback function for EnumFontFamiliesEx. * Adds the name of a font to a Lisp list (passed in as the lParam arg). */ static int CALLBACK -add_font_name_to_list (logical_font, physical_font, font_type, list_object) - ENUMLOGFONTEX *logical_font; - NEWTEXTMETRICEX *physical_font; - DWORD font_type; - LPARAM list_object; +add_font_name_to_list (ENUMLOGFONTEX *logical_font, + NEWTEXTMETRICEX *physical_font, + DWORD font_type, LPARAM list_object) { Lisp_Object* list = (Lisp_Object *) list_object; Lisp_Object family; @@ -976,14 +948,12 @@ /* Convert an enumerated Windows font to an Emacs font entity. */ static Lisp_Object -w32_enumfont_pattern_entity (frame, logical_font, physical_font, - font_type, requested_font, backend) - Lisp_Object frame; - ENUMLOGFONTEX *logical_font; - NEWTEXTMETRICEX *physical_font; - DWORD font_type; - LOGFONT *requested_font; - Lisp_Object backend; +w32_enumfont_pattern_entity (Lisp_Object frame, + ENUMLOGFONTEX *logical_font, + NEWTEXTMETRICEX *physical_font, + DWORD font_type, + LOGFONT *requested_font, + Lisp_Object backend) { Lisp_Object entity, tem; LOGFONT *lf = (LOGFONT*) logical_font; @@ -1107,8 +1077,7 @@ } static int -logfonts_match (font, pattern) - LOGFONT *font, *pattern; +logfonts_match (LOGFONT *font, LOGFONT *pattern) { /* Only check height for raster fonts. */ if (pattern->lfHeight && font->lfOutPrecision == OUT_STRING_PRECIS @@ -1132,12 +1101,9 @@ #define CSB_CHINESE ((1 << 18) | (1 << 20)) static int -font_matches_spec (type, font, spec, backend, logfont) - DWORD type; - NEWTEXTMETRICEX *font; - Lisp_Object spec; - Lisp_Object backend; - LOGFONT *logfont; +font_matches_spec (DWORD type, NEWTEXTMETRICEX *font, + Lisp_Object spec, Lisp_Object backend, + LOGFONT *logfont) { Lisp_Object extra, val; @@ -1322,9 +1288,7 @@ } static int -w32font_coverage_ok (coverage, charset) - FONTSIGNATURE * coverage; - BYTE charset; +w32font_coverage_ok (FONTSIGNATURE * coverage, BYTE charset) { DWORD subrange1 = coverage->fsUsb[1]; @@ -1350,9 +1314,7 @@ static int -check_face_name (font, full_name) - LOGFONT *font; - char *full_name; +check_face_name (LOGFONT *font, char *full_name) { char full_iname[LF_FULLFACESIZE+1]; @@ -1397,11 +1359,9 @@ * and the list to which the fonts are added are passed in via the * lparam argument, in the form of a font_callback_data struct. */ static int CALLBACK -add_font_entity_to_list (logical_font, physical_font, font_type, lParam) - ENUMLOGFONTEX *logical_font; - NEWTEXTMETRICEX *physical_font; - DWORD font_type; - LPARAM lParam; +add_font_entity_to_list (ENUMLOGFONTEX *logical_font, + NEWTEXTMETRICEX *physical_font, + DWORD font_type, LPARAM lParam) { struct font_callback_data *match_data = (struct font_callback_data *) lParam; @@ -1510,11 +1470,9 @@ /* Callback function for EnumFontFamiliesEx. * Terminates the search once we have a match. */ static int CALLBACK -add_one_font_entity_to_list (logical_font, physical_font, font_type, lParam) - ENUMLOGFONTEX *logical_font; - NEWTEXTMETRICEX *physical_font; - DWORD font_type; - LPARAM lParam; +add_one_font_entity_to_list (ENUMLOGFONTEX *logical_font, + NEWTEXTMETRICEX *physical_font, + DWORD font_type, LPARAM lParam) { struct font_callback_data *match_data = (struct font_callback_data *) lParam; @@ -1526,8 +1484,7 @@ /* Old function to convert from x to w32 charset, from w32fns.c. */ static LONG -x_to_w32_charset (lpcs) - char * lpcs; +x_to_w32_charset (char * lpcs) { Lisp_Object this_entry, w32_charset; char *charset; @@ -1609,8 +1566,7 @@ /* Convert a Lisp font registry (symbol) to a windows charset. */ static LONG -registry_to_w32_charset (charset) - Lisp_Object charset; +registry_to_w32_charset (Lisp_Object charset) { if (EQ (charset, Qiso10646_1) || EQ (charset, Qunicode_bmp) || EQ (charset, Qunicode_sip)) @@ -1625,9 +1581,7 @@ /* Old function to convert from w32 to x charset, from w32fns.c. */ static char * -w32_to_x_charset (fncharset, matching) - int fncharset; - char *matching; +w32_to_x_charset (int fncharset, char *matching) { static char buf[32]; Lisp_Object charset_type; @@ -1821,9 +1775,7 @@ } static Lisp_Object -w32_registry (w32_charset, font_type) - LONG w32_charset; - DWORD font_type; +w32_registry (LONG w32_charset, DWORD font_type) { char *charset; @@ -1833,12 +1785,11 @@ return font_type == TRUETYPE_FONTTYPE ? Qiso10646_1 : Qunknown; charset = w32_to_x_charset (w32_charset, NULL); - return font_intern_prop (charset, strlen(charset), 1); + return font_intern_prop (charset, strlen (charset), 1); } static int -w32_decode_weight (fnweight) - int fnweight; +w32_decode_weight (int fnweight) { if (fnweight >= FW_HEAVY) return 210; if (fnweight >= FW_EXTRABOLD) return 205; @@ -1852,8 +1803,7 @@ } static int -w32_encode_weight (n) - int n; +w32_encode_weight (int n) { if (n >= 210) return FW_HEAVY; if (n >= 205) return FW_EXTRABOLD; @@ -1869,8 +1819,7 @@ /* Convert a Windows font weight into one of the weights supported by fontconfig (see font.c:font_parse_fcname). */ static Lisp_Object -w32_to_fc_weight (n) - int n; +w32_to_fc_weight (int n) { if (n >= FW_EXTRABOLD) return intern ("black"); if (n >= FW_BOLD) return intern ("bold"); @@ -1881,10 +1830,7 @@ /* Fill in all the available details of LOGFONT from FONT_SPEC. */ static void -fill_in_logfont (f, logfont, font_spec) - FRAME_PTR f; - LOGFONT *logfont; - Lisp_Object font_spec; +fill_in_logfont (FRAME_PTR f, LOGFONT *logfont, Lisp_Object font_spec) { Lisp_Object tmp, extra; int dpi = FRAME_W32_DISPLAY_INFO (f)->resy; @@ -2029,8 +1975,7 @@ } static void -list_all_matching_fonts (match_data) - struct font_callback_data *match_data; +list_all_matching_fonts (struct font_callback_data *match_data) { HDC dc; Lisp_Object families = w32font_list_family (match_data->frame); @@ -2066,8 +2011,7 @@ } static Lisp_Object -lispy_antialias_type (type) - BYTE type; +lispy_antialias_type (BYTE type) { Lisp_Object lispy; @@ -2094,8 +2038,7 @@ /* Convert antialiasing symbols to lfQuality */ static BYTE -w32_antialias_type (type) - Lisp_Object type; +w32_antialias_type (Lisp_Object type) { if (EQ (type, Qnone)) return NONANTIALIASED_QUALITY; @@ -2241,12 +2184,8 @@ The full name is in fcname format, with weight, slant and antialiasing specified if they are not "normal". */ static int -w32font_full_name (font, font_obj, pixel_size, name, nbytes) - LOGFONT * font; - Lisp_Object font_obj; - int pixel_size; - char *name; - int nbytes; +w32font_full_name (LOGFONT * font, Lisp_Object font_obj, + int pixel_size, char *name, int nbytes) { int len, height, outline; char *p; @@ -2317,11 +2256,8 @@ is written. If the buffer is not large enough to contain the name, the function returns -1, otherwise it returns the number of bytes written to FCNAME. */ -static int logfont_to_fcname(font, pointsize, fcname, size) - LOGFONT* font; - int pointsize; - char *fcname; - int size; +static int +logfont_to_fcname (LOGFONT* font, int pointsize, char *fcname, int size) { int len, height; char *p = fcname; @@ -2360,11 +2296,8 @@ } static void -compute_metrics (dc, w32_font, code, metrics) - HDC dc; - struct w32font_info *w32_font; - unsigned int code; - struct w32_metric_cache *metrics; +compute_metrics (HDC dc, struct w32font_info *w32_font, unsigned int code, + struct w32_metric_cache *metrics) { GLYPHMETRICS gm; MAT2 transform; @@ -2482,7 +2415,7 @@ /* Initialize state that does not change between invocations. This is only called when Emacs is dumped. */ void -syms_of_w32font () +syms_of_w32font (void) { DEFSYM (Qgdi, "gdi"); DEFSYM (Quniscribe, "uniscribe");
--- a/src/w32heap.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32heap.c Wed Jul 07 12:15:48 2010 +0000 @@ -222,7 +222,7 @@ was allocated by something else; GNU malloc detects when there is a jump in the sbrk values, and starts a new heap block. */ void -init_heap () +init_heap (void) { PIMAGE_DOS_HEADER dos_header; PIMAGE_NT_HEADERS nt_header;
--- a/src/w32inevt.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32inevt.c Wed Jul 07 12:15:48 2010 +0000 @@ -582,8 +582,8 @@ *part = 0; SELECTED_FRAME ()->mouse_moved = 0; - XSETINT(*x, movement_pos.X); - XSETINT(*y, movement_pos.Y); + XSETINT (*x, movement_pos.X); + XSETINT (*y, movement_pos.Y); *time = movement_time; UNBLOCK_INPUT; @@ -684,7 +684,7 @@ } static void -maybe_generate_resize_event () +maybe_generate_resize_event (void) { CONSOLE_SCREEN_BUFFER_INFO info; FRAME_PTR f = get_frame ();
--- a/src/w32menu.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32menu.c Wed Jul 07 12:15:48 2010 +0000 @@ -59,8 +59,8 @@ HMENU current_popup_menu; -void syms_of_w32menu (); -void globals_of_w32menu (); +void syms_of_w32menu (void); +void globals_of_w32menu (void); typedef BOOL (WINAPI * GetMenuItemInfoA_Proc) ( IN HMENU, @@ -116,8 +116,7 @@ ID, or 0 if none. */ static struct frame * -menubar_id_to_frame (id) - HMENU id; +menubar_id_to_frame (HMENU id) { Lisp_Object tail, frame; FRAME_PTR f; @@ -276,8 +275,7 @@ This way we can safely execute Lisp code. */ void -x_activate_menubar (f) - FRAME_PTR f; +x_activate_menubar (FRAME_PTR f) { set_frame_menubar (f, 0, 1); @@ -386,10 +384,7 @@ it is set the first time this is called, from initialize_frame_menubar. */ void -set_frame_menubar (f, first_time, deep_p) - FRAME_PTR f; - int first_time; - int deep_p; +set_frame_menubar (FRAME_PTR f, int first_time, int deep_p) { HMENU menubar_widget = f->output_data.w32->menubar_widget; Lisp_Object items; @@ -648,8 +643,7 @@ is visible. */ void -initialize_frame_menubar (f) - FRAME_PTR f; +initialize_frame_menubar (FRAME_PTR f) { /* This function is called before the first chance to redisplay the frame. It has to be, so the frame will have the right size. */ @@ -661,8 +655,7 @@ This is used when deleting a frame, and when turning off the menu bar. */ void -free_frame_menubar (f) - FRAME_PTR f; +free_frame_menubar (FRAME_PTR f) { BLOCK_INPUT; @@ -1020,11 +1013,9 @@ "button6", "button7", "button8", "button9", "button10" }; static Lisp_Object -w32_dialog_show (f, keymaps, title, header, error) - FRAME_PTR f; - int keymaps; - Lisp_Object title, header; - char **error; +w32_dialog_show (FRAME_PTR f, int keymaps, + Lisp_Object title, Lisp_Object header, + char **error) { int i, nb_buttons=0; char dialog_name[6]; @@ -1127,7 +1118,7 @@ /* Frame title: 'Q' = Question, 'I' = Information. Can also have 'E' = Error if, one day, we want a popup for errors. */ - if (NILP(header)) + if (NILP (header)) dialog_name[0] = 'Q'; else dialog_name[0] = 'I'; @@ -1213,8 +1204,8 @@ anywhere in Emacs that uses the other specific dialog choices that MessageBox provides. */ -static int is_simple_dialog (contents) - Lisp_Object contents; +static int +is_simple_dialog (Lisp_Object contents) { Lisp_Object options = XCDR (contents); Lisp_Object name, yes, no, other; @@ -1249,9 +1240,8 @@ return !(CONSP (options)); } -static Lisp_Object simple_dialog_show (f, contents, header) - FRAME_PTR f; - Lisp_Object contents, header; +static Lisp_Object +simple_dialog_show (FRAME_PTR f, Lisp_Object contents, Lisp_Object header) { int answer; UINT type; @@ -1315,8 +1305,7 @@ /* Is this item a separator? */ static int -name_is_separator (name) - char *name; +name_is_separator (char *name) { char *start = name; @@ -1647,8 +1636,7 @@ /* Free memory used by owner-drawn strings. */ static void -w32_free_submenu_strings (menu) - HMENU menu; +w32_free_submenu_strings (HMENU menu) { int i, num = GetMenuItemCount (menu); for (i = 0; i < num; i++) @@ -1676,8 +1664,7 @@ } void -w32_free_menu_strings (hwnd) - HWND hwnd; +w32_free_menu_strings (HWND hwnd) { HMENU menu = current_popup_menu; @@ -1712,7 +1699,8 @@ #endif /* HAVE_MENUS */ } -void syms_of_w32menu () +void +syms_of_w32menu (void) { globals_of_w32menu (); @@ -1734,7 +1722,8 @@ variable initialized is 0 and directly from main when initialized is non zero. */ -void globals_of_w32menu () +void +globals_of_w32menu (void) { /* See if Get/SetMenuItemInfo functions are available. */ HMODULE user32 = GetModuleHandle ("user32.dll");
--- a/src/w32proc.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32proc.c Wed Jul 07 12:15:48 2010 +0000 @@ -46,7 +46,7 @@ #include <windows.h> #ifdef __GNUC__ /* This definition is missing from mingw32 headers. */ -extern BOOL WINAPI IsValidLocale(LCID, DWORD); +extern BOOL WINAPI IsValidLocale (LCID, DWORD); #endif #ifdef HAVE_LANGINFO_CODESET @@ -117,7 +117,8 @@ Lisp_Object Qhigh, Qlow; #ifdef EMACSDEBUG -void _DebPrint (const char *fmt, ...) +void +_DebPrint (const char *fmt, ...) { char buf[1024]; va_list args; @@ -129,7 +130,7 @@ } #endif -typedef void (_CALLBACK_ *signal_handler)(int); +typedef void (_CALLBACK_ *signal_handler) (int); /* Signal handlers...SIG_DFL == 0 so this is initialized correctly. */ static signal_handler sig_handlers[NSIG]; @@ -175,7 +176,7 @@ cp = &child_procs[child_proc_count++]; Initialise: - memset (cp, 0, sizeof(*cp)); + memset (cp, 0, sizeof (*cp)); cp->fd = -1; cp->pid = -1; cp->procinfo.hProcess = NULL; @@ -398,7 +399,7 @@ return TRUE; EH_Fail: - DebPrint (("create_child.CreateProcess failed: %ld\n", GetLastError());); + DebPrint (("create_child.CreateProcess failed: %ld\n", GetLastError ());); return FALSE; } @@ -608,7 +609,10 @@ #endif void -w32_executable_type (char * filename, int * is_dos_app, int * is_cygnus_app, int * is_gui_app) +w32_executable_type (char * filename, + int * is_dos_app, + int * is_cygnus_app, + int * is_gui_app) { file_data executable; char * p; @@ -1875,7 +1879,8 @@ #ifdef HAVE_LANGINFO_CODESET /* Emulation of nl_langinfo. Used in fns.c:Flocale_info. */ -char *nl_langinfo (nl_item item) +char * +nl_langinfo (nl_item item) { /* Conversion of Posix item numbers to their Windows equivalents. */ static const LCTYPE w32item[] = { @@ -2003,13 +2008,14 @@ return make_number (GetThreadLocale ()); } -DWORD int_from_hex (char * s) +DWORD +int_from_hex (char * s) { DWORD val = 0; static char hex[] = "0123456789abcdefABCDEF"; char * p; - while (*s && (p = strchr(hex, *s)) != NULL) + while (*s && (p = strchr (hex, *s)) != NULL) { unsigned digit = p - hex; if (digit > 15) @@ -2024,7 +2030,8 @@ function isn't given a context pointer. */ Lisp_Object Vw32_valid_locale_ids; -BOOL CALLBACK enum_locale_fn (LPTSTR localeNum) +BOOL CALLBACK +enum_locale_fn (LPTSTR localeNum) { DWORD id = int_from_hex (localeNum); Vw32_valid_locale_ids = Fcons (make_number (id), Vw32_valid_locale_ids); @@ -2089,7 +2096,8 @@ function isn't given a context pointer. */ Lisp_Object Vw32_valid_codepages; -BOOL CALLBACK enum_codepage_fn (LPTSTR codepageNum) +BOOL CALLBACK +enum_codepage_fn (LPTSTR codepageNum) { DWORD id = atoi (codepageNum); Vw32_valid_codepages = Fcons (make_number (id), Vw32_valid_codepages); @@ -2265,7 +2273,8 @@ } -syms_of_ntproc () +void +syms_of_ntproc (void) { DEFSYM (Qhigh, "high"); DEFSYM (Qlow, "low");
--- a/src/w32reg.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32reg.c Wed Jul 07 12:15:48 2010 +0000 @@ -58,9 +58,7 @@ */ static char * -w32_get_rdb_resource (rdb, resource) - char *rdb; - char *resource; +w32_get_rdb_resource (char *rdb, char *resource) { char *value = rdb; int len = strlen (resource); @@ -78,9 +76,7 @@ } static LPBYTE -w32_get_string_resource (name, class, dwexptype) - char *name, *class; - DWORD dwexptype; +w32_get_string_resource (char *name, char *class, DWORD dwexptype) { LPBYTE lpvalue = NULL; HKEY hrootkey = NULL; @@ -147,9 +143,7 @@ database RDB. */ char * -x_get_string_resource (rdb, name, class) - XrmDatabase rdb; - char *name, *class; +x_get_string_resource (XrmDatabase rdb, char *name, char *class) { if (rdb) {
--- a/src/w32select.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32select.c Wed Jul 07 12:15:48 2010 +0000 @@ -30,7 +30,7 @@ * (CF_UNICODETEXT), when a well-known console codepage is given, they * apply to the console version of the clipboard data (CF_OEMTEXT), * else they apply to the normal 8-bit text clipboard (CF_TEXT). - * + * * When pasting (getting data from the OS), the clipboard format that * matches the {next-}selection-coding-system is retrieved. If * Unicode is requested, but not available, 8-bit text (CF_TEXT) is @@ -45,13 +45,13 @@ * * Scenarios to use the facilities for customizing the selection * coding system are: - * + * * ;; Generally use KOI8-R instead of the russian MS codepage for * ;; the 8-bit clipboard. * (set-selection-coding-system 'koi8-r-dos) - * + * * Or - * + * * ;; Create a special clipboard copy function that uses codepage * ;; 1253 (Greek) to copy Greek text to a specific non-Unicode * ;; application. @@ -71,7 +71,7 @@ * types should be supported is also moved to Lisp, functionality * could be expanded to CF_HTML, CF_RTF and maybe other types. */ - + #include <config.h> #include <setjmp.h> #include "lisp.h" @@ -89,8 +89,8 @@ static HGLOBAL convert_to_handle_as_coded (Lisp_Object coding_system); static Lisp_Object render (Lisp_Object oformat); static Lisp_Object render_locale (void); -static Lisp_Object render_all (void); -static void run_protected (Lisp_Object (*code) (), Lisp_Object arg); +static Lisp_Object render_all (Lisp_Object ignore); +static void run_protected (Lisp_Object (*code) (Lisp_Object), Lisp_Object arg); static Lisp_Object lisp_error_handler (Lisp_Object error); static LRESULT CALLBACK owner_callback (HWND win, UINT msg, WPARAM wp, LPARAM lp); @@ -220,11 +220,11 @@ unsigned char *dst = NULL; struct coding_system coding; - ONTRACE (fprintf (stderr, "convert_to_handle_as_coded: %s\n", + ONTRACE (fprintf (stderr, "convert_to_handle_as_coded: %s\n", SDATA (SYMBOL_NAME (coding_system)))); setup_windows_coding_system (coding_system, &coding); - coding.dst_bytes = SBYTES(current_text) * 2; + coding.dst_bytes = SBYTES (current_text) * 2; coding.destination = (unsigned char *) xmalloc (coding.dst_bytes); encode_coding_object (&coding, current_text, 0, 0, SCHARS (current_text), SBYTES (current_text), Qnil); @@ -290,7 +290,7 @@ if (SetClipboardData (format, htext) == NULL) { - GlobalFree(htext); + GlobalFree (htext); return Qnil; } @@ -314,7 +314,7 @@ if ((lcid_ptr = (LCID *) GlobalLock (hlocale)) == NULL) { - GlobalFree(hlocale); + GlobalFree (hlocale); return Qnil; } @@ -323,7 +323,7 @@ if (SetClipboardData (CF_LOCALE, hlocale) == NULL) { - GlobalFree(hlocale); + GlobalFree (hlocale); return Qnil; } @@ -334,7 +334,7 @@ data survives us. This code will do that. */ static Lisp_Object -render_all (void) +render_all (Lisp_Object ignore) { ONTRACE (fprintf (stderr, "render_all\n")); @@ -380,7 +380,7 @@ automatic conversions anywhere else, so to get consistent results, we probably don't want to rely on it here either. */ - render_locale(); + render_locale (); if (current_clipboard_type == CF_UNICODETEXT) render (make_number (CF_TEXT)); @@ -392,7 +392,7 @@ } static void -run_protected (Lisp_Object (*code) (), Lisp_Object arg) +run_protected (Lisp_Object (*code) (Lisp_Object), Lisp_Object arg) { /* FIXME: This works but it doesn't feel right. Too much fiddling with global variables and calling strange looking functions. Is @@ -514,7 +514,7 @@ && EQ (cfg_coding_system, dos_coding_system)) return; cfg_coding_system = dos_coding_system; - + /* Set some sensible fallbacks */ cfg_codepage = ANSICP; cfg_lcid = LOCALE_NEUTRAL; @@ -583,7 +583,7 @@ cfg_clipboard_type = CF_TEXT; return FALSE; /* Stop enumeration */ } - + /* Is the wanted codepage the OEM codepage for this locale? */ codepage = cp_from_locale (lcid, CF_OEMTEXT); if (codepage == cfg_codepage) @@ -704,7 +704,7 @@ current_lcid = cfg_lcid; current_num_nls = 0; current_requires_encoding = 0; - + BLOCK_INPUT; /* Check for non-ASCII characters. While we are at it, count the @@ -744,7 +744,7 @@ /* If we have something non-ASCII we may want to set a locale. We do that directly (non-delayed), as it's just a small bit. */ if (ok) - ok = !NILP(render_locale()); + ok = !NILP (render_locale ()); if (ok) { @@ -753,7 +753,7 @@ /* If for some reason we don't have a clipboard_owner, we just set the text format as chosen by the configuration and than forget about the whole thing. */ - ok = !NILP(render (make_number (current_clipboard_type))); + ok = !NILP (render (make_number (current_clipboard_type))); current_text = Qnil; current_coding_system = Qnil; } @@ -884,7 +884,7 @@ struct coding_system coding; Lisp_Object coding_system = Qnil; Lisp_Object dos_coding_system; - + /* `next-selection-coding-system' should override everything, even when the locale passed by the system disagrees. The only exception is when `next-selection-coding-system' @@ -1065,7 +1065,7 @@ dumped version. */ void -syms_of_w32select () +syms_of_w32select (void) { defsubr (&Sw32_set_clipboard_data); defsubr (&Sw32_get_clipboard_data); @@ -1076,7 +1076,7 @@ When sending or receiving text via cut_buffer, selection, and clipboard, the text is encoded or decoded by this coding system. The default value is the current system default encoding on 9x/Me and -`utf-16le-dos' (Unicode) on NT/W2K/XP. */); +`utf-16le-dos' (Unicode) on NT/W2K/XP. */); /* The actual value is set dynamically in the dumped Emacs, see below. */ Vselection_coding_system = Qnil; @@ -1104,7 +1104,7 @@ un-dumped version. */ void -globals_of_w32select () +globals_of_w32select (void) { DEFAULT_LCID = GetUserDefaultLCID (); /* Drop the sort order from the LCID, so we can compare this with
--- a/src/w32term.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32term.c Wed Jul 07 12:15:48 2010 +0000 @@ -96,7 +96,7 @@ extern unsigned int msh_mousewheel; -extern void free_frame_menubar (); +extern void free_frame_menubar (struct frame *); extern int w32_codepage_for_font (char *fontname); extern Cursor w32_load_cursor (LPCTSTR name); @@ -294,9 +294,7 @@ int event_record_index; -record_event (locus, type) - char *locus; - int type; +record_event (char *locus, int type) { if (event_record_index == sizeof (event_record) / sizeof (struct record)) event_record_index = 0; @@ -310,7 +308,7 @@ void -XChangeGC (void * ignore, XGCValues* gc, unsigned long mask, +XChangeGC (void *ignore, XGCValues *gc, unsigned long mask, XGCValues *xgcv) { if (mask & GCForeground) @@ -321,8 +319,8 @@ gc->font = xgcv->font; } -XGCValues *XCreateGC (void * ignore, Window window, unsigned long mask, - XGCValues *xgcv) +XGCValues * +XCreateGC (void *ignore, Window window, unsigned long mask, XGCValues *xgcv) { XGCValues *gc = (XGCValues *) xmalloc (sizeof (XGCValues)); bzero (gc, sizeof (XGCValues)); @@ -333,8 +331,8 @@ } void -XGetGCValues (void* ignore, XGCValues *gc, - unsigned long mask, XGCValues *xgcv) +XGetGCValues (void *ignore, XGCValues *gc, + unsigned long mask, XGCValues *xgcv) { XChangeGC (ignore, xgcv, mask, gc); } @@ -376,11 +374,7 @@ /* Draw a filled rectangle at the specified position. */ void -w32_fill_rect (f, hdc, pix, lprect) - FRAME_PTR f; - HDC hdc; - COLORREF pix; - RECT * lprect; +w32_fill_rect (FRAME_PTR f, HDC hdc, COLORREF pix, RECT *lprect) { HBRUSH hb; @@ -390,8 +384,7 @@ } void -w32_clear_window (f) - FRAME_PTR f; +w32_clear_window (FRAME_PTR f) { RECT rect; HDC hdc = get_frame_dc (f); @@ -411,8 +404,7 @@ #define OPAQUE_FRAME 255 void -x_set_frame_alpha (f) - struct frame *f; +x_set_frame_alpha (struct frame *f) { struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); double alpha = 1.0; @@ -458,8 +450,7 @@ } int -x_display_pixel_height (dpyinfo) - struct w32_display_info *dpyinfo; +x_display_pixel_height (struct w32_display_info *dpyinfo) { HDC dc = GetDC (NULL); int pixels = GetDeviceCaps (dc, VERTRES); @@ -468,8 +459,7 @@ } int -x_display_pixel_width (dpyinfo) - struct w32_display_info *dpyinfo; +x_display_pixel_width (struct w32_display_info *dpyinfo) { HDC dc = GetDC (NULL); int pixels = GetDeviceCaps (dc, HORZRES); @@ -488,8 +478,7 @@ each window being updated. */ static void -x_update_begin (f) - struct frame *f; +x_update_begin (struct frame *f) { struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f); @@ -511,8 +500,7 @@ position of W. */ static void -x_update_window_begin (w) - struct window *w; +x_update_window_begin (struct window *w) { struct frame *f = XFRAME (WINDOW_FRAME (w)); struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f); @@ -571,9 +559,7 @@ /* Draw a vertical window border from (x,y0) to (x,y1) */ static void -w32_draw_vertical_window_border (w, x, y0, y1) - struct window *w; - int x, y0, y1; +w32_draw_vertical_window_border (struct window *w, int x, int y0, int y1) { struct frame *f = XFRAME (WINDOW_FRAME (w)); RECT r; @@ -610,9 +596,8 @@ here. */ static void -x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) - struct window *w; - int cursor_on_p, mouse_face_overwritten_p; +x_update_window_end (struct window *w, int cursor_on_p, + int mouse_face_overwritten_p) { struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame)); @@ -656,8 +641,7 @@ update_end. */ static void -x_update_end (f) - struct frame *f; +x_update_end (struct frame *f) { if (! FRAME_W32_P (f)) return; @@ -672,8 +656,7 @@ updated_window is not available here. */ static void -w32_frame_up_to_date (f) - struct frame *f; +w32_frame_up_to_date (struct frame *f) { if (FRAME_W32_P (f)) { @@ -702,8 +685,7 @@ between bitmaps to be drawn between current row and DESIRED_ROW. */ static void -x_after_update_window_line (desired_row) - struct glyph_row *desired_row; +x_after_update_window_line (struct glyph_row *desired_row) { struct window *w = updated_window; struct frame *f; @@ -749,10 +731,8 @@ drawn. */ static void -w32_draw_fringe_bitmap (w, row, p) - struct window *w; - struct glyph_row *row; - struct draw_fringe_bitmap_params *p; +w32_draw_fringe_bitmap (struct window *w, struct glyph_row *row, + struct draw_fringe_bitmap_params *p) { struct frame *f = XFRAME (WINDOW_FRAME (w)); HDC hdc; @@ -890,10 +870,7 @@ } static void -w32_define_fringe_bitmap (which, bits, h, wd) - int which; - unsigned short *bits; - int h, wd; +w32_define_fringe_bitmap (int which, unsigned short *bits, int h, int wd) { if (which >= max_fringe_bmp) { @@ -908,8 +885,7 @@ } static void -w32_destroy_fringe_bitmap (which) - int which; +w32_destroy_fringe_bitmap (int which) { if (which >= max_fringe_bmp) return; @@ -979,8 +955,7 @@ face. */ static void -x_set_cursor_gc (s) - struct glyph_string *s; +x_set_cursor_gc (struct glyph_string *s) { if (s->font == FRAME_FONT (s->f) && s->face->background == FRAME_BACKGROUND_PIXEL (s->f) @@ -1031,8 +1006,7 @@ /* Set up S->gc of glyph string S for drawing text in mouse face. */ static void -x_set_mouse_face_gc (s) - struct glyph_string *s; +x_set_mouse_face_gc (struct glyph_string *s) { int face_id; struct face *face; @@ -1085,8 +1059,7 @@ matrix was built, so there isn't much to do, here. */ static INLINE void -x_set_mode_line_face_gc (s) - struct glyph_string *s; +x_set_mode_line_face_gc (struct glyph_string *s) { s->gc = s->face->gc; } @@ -1097,8 +1070,7 @@ pattern. */ static INLINE void -x_set_glyph_string_gc (s) - struct glyph_string *s; +x_set_glyph_string_gc (struct glyph_string *s) { PREPARE_FACE_FOR_DISPLAY (s->f, s->face); @@ -1143,8 +1115,7 @@ line or menu if we don't have X toolkit support. */ static INLINE void -x_set_glyph_string_clipping (s) - struct glyph_string *s; +x_set_glyph_string_clipping (struct glyph_string *s) { RECT *r = s->clip; int n = get_glyph_string_clip_rects (s, r, 2); @@ -1172,8 +1143,8 @@ the area of SRC. */ static void -x_set_glyph_string_clipping_exactly (src, dst) - struct glyph_string *src, *dst; +x_set_glyph_string_clipping_exactly (struct glyph_string *src, + struct glyph_string *dst) { RECT r; @@ -1190,8 +1161,7 @@ Compute left and right overhang of glyph string S. */ static void -w32_compute_glyph_string_overhangs (s) - struct glyph_string *s; +w32_compute_glyph_string_overhangs (struct glyph_string *s) { if (s->cmp == NULL && s->first_glyph->type == CHAR_GLYPH @@ -1219,9 +1189,8 @@ /* Fill rectangle X, Y, W, H with background color of glyph string S. */ static INLINE void -x_clear_glyph_string_rect (s, x, y, w, h) - struct glyph_string *s; - int x, y, w, h; +x_clear_glyph_string_rect (struct glyph_string *s, + int x, int y, int w, int h) { int real_x = x; int real_y = y; @@ -1251,9 +1220,7 @@ contains the first component of a composition. */ static void -x_draw_glyph_string_background (s, force_p) - struct glyph_string *s; - int force_p; +x_draw_glyph_string_background (struct glyph_string *s, int force_p) { /* Nothing to do if background has already been drawn or if it shouldn't be drawn in the first place. */ @@ -1292,8 +1259,7 @@ /* Draw the foreground of glyph string S. */ static void -x_draw_glyph_string_foreground (s) - struct glyph_string *s; +x_draw_glyph_string_foreground (struct glyph_string *s) { int i, x; @@ -1350,8 +1316,7 @@ /* Draw the foreground of composite glyph string S. */ static void -x_draw_composite_glyph_string_foreground (s) - struct glyph_string *s; +x_draw_composite_glyph_string_foreground (struct glyph_string *s) { int i, j, x; struct font *font = s->font; @@ -1464,11 +1429,8 @@ Value is non-zero if successful. */ static int -w32_alloc_lighter_color (f, color, factor, delta) - struct frame *f; - COLORREF *color; - double factor; - int delta; +w32_alloc_lighter_color (struct frame *f, COLORREF *color, + double factor, int delta) { COLORREF new; long bright; @@ -1527,10 +1489,7 @@ colors in COLORS. On W32, we no longer try to map colors to a palette. */ void -x_query_colors (f, colors, ncolors) - struct frame *f; - XColor *colors; - int ncolors; +x_query_colors (struct frame *f, XColor *colors, int ncolors) { int i; @@ -1545,9 +1504,7 @@ } void -x_query_color (f, color) - struct frame *f; - XColor *color; +x_query_color (struct frame *f, XColor *color) { x_query_colors (f, color, 1); } @@ -1561,12 +1518,8 @@ be allocated, use DEFAULT_PIXEL, instead. */ static void -w32_setup_relief_color (f, relief, factor, delta, default_pixel) - struct frame *f; - struct relief *relief; - double factor; - int delta; - COLORREF default_pixel; +w32_setup_relief_color (struct frame *f, struct relief *relief, double factor, + int delta, COLORREF default_pixel) { XGCValues xgcv; struct w32_output *di = f->output_data.w32; @@ -1602,8 +1555,7 @@ /* Set up colors for the relief lines around glyph string S. */ static void -x_setup_relief_colors (s) - struct glyph_string *s; +x_setup_relief_colors (struct glyph_string *s) { struct w32_output *di = s->f->output_data.w32; COLORREF color; @@ -1638,12 +1590,10 @@ when drawing. */ static void -w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, - raised_p, top_p, bot_p, left_p, right_p, clip_rect) - struct frame *f; - int left_x, top_y, right_x, bottom_y, width; - int top_p, bot_p, left_p, right_p, raised_p; - RECT *clip_rect; +w32_draw_relief_rect (struct frame *f, + int left_x, int top_y, int right_x, int bottom_y, int width, + int raised_p, int top_p, int bot_p, int left_p, int right_p, + RECT *clip_rect) { int i; XGCValues gc; @@ -1703,11 +1653,9 @@ rectangle to use when drawing. */ static void -w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, - left_p, right_p, clip_rect) - struct glyph_string *s; - int left_x, top_y, right_x, bottom_y, width, left_p, right_p; - RECT *clip_rect; +w32_draw_box_rect (struct glyph_string *s, + int left_x, int top_y, int right_x, int bottom_y, int width, + int left_p, int right_p, RECT *clip_rect) { w32_set_clip_rectangle (s->hdc, clip_rect); @@ -1740,8 +1688,7 @@ /* Draw a box around glyph string S. */ static void -x_draw_glyph_string_box (s) - struct glyph_string *s; +x_draw_glyph_string_box (struct glyph_string *s) { int width, left_x, right_x, top_y, bottom_y, last_x, raised_p; int left_p, right_p; @@ -1792,8 +1739,7 @@ /* Draw foreground of image glyph string S. */ static void -x_draw_image_foreground (s) - struct glyph_string *s; +x_draw_image_foreground (struct glyph_string *s) { int x = s->x; int y = s->ybase - image_ascent (s->img, s->face, &s->slice); @@ -1883,8 +1829,7 @@ /* Draw a relief around the image glyph string S. */ static void -x_draw_image_relief (s) - struct glyph_string *s; +x_draw_image_relief (struct glyph_string *s) { int x0, y0, x1, y1, thick, raised_p; RECT r; @@ -1936,9 +1881,7 @@ /* Draw the foreground of image glyph string S to PIXMAP. */ static void -w32_draw_image_foreground_1 (s, pixmap) - struct glyph_string *s; - HBITMAP pixmap; +w32_draw_image_foreground_1 (struct glyph_string *s, HBITMAP pixmap) { HDC hdc = CreateCompatibleDC (s->hdc); HGDIOBJ orig_hdc_obj = SelectObject (hdc, pixmap); @@ -2025,9 +1968,7 @@ give the rectangle to draw. */ static void -x_draw_glyph_string_bg_rect (s, x, y, w, h) - struct glyph_string *s; - int x, y, w, h; +x_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w, int h) { #if 0 /* TODO: stipple */ if (s->stippled_p) @@ -2058,8 +1999,7 @@ */ static void -x_draw_image_glyph_string (s) - struct glyph_string *s; +x_draw_image_glyph_string (struct glyph_string *s) { int x, y; int box_line_hwidth = eabs (s->face->box_line_width); @@ -2172,8 +2112,7 @@ /* Draw stretch glyph string S. */ static void -x_draw_stretch_glyph_string (s) - struct glyph_string *s; +x_draw_stretch_glyph_string (struct glyph_string *s) { xassert (s->first_glyph->type == STRETCH_GLYPH); @@ -2255,8 +2194,7 @@ /* Draw glyph string S. */ static void -x_draw_glyph_string (s) - struct glyph_string *s; +x_draw_glyph_string (struct glyph_string *s) { int relief_drawn_p = 0; @@ -2421,7 +2359,7 @@ /* Draw strike-through. */ if (s->face->strike_through_p - && !FONT_TEXTMETRIC(s->font).tmStruckOut) + && !FONT_TEXTMETRIC (s->font).tmStruckOut) { unsigned long h = 1; unsigned long dy = (s->height - h) / 2; @@ -2502,9 +2440,8 @@ /* Shift display to make room for inserted glyphs. */ void -w32_shift_glyphs_for_insert (f, x, y, width, height, shift_by) - struct frame *f; - int x, y, width, height, shift_by; +w32_shift_glyphs_for_insert (struct frame *f, int x, int y, + int width, int height, int shift_by) { HDC hdc; @@ -2520,9 +2457,7 @@ for X frames. */ static void -x_delete_glyphs (f, n) - struct frame *f; - register int n; +x_delete_glyphs (struct frame *f, register int n) { if (! FRAME_W32_P (f)) return; @@ -2592,8 +2527,7 @@ that is bounded by calls to x_update_begin and x_update_end. */ static void -w32_set_terminal_window (n) - register int n; +w32_set_terminal_window (struct frame *f, int n) { /* This function intentionally left blank. */ } @@ -2607,9 +2541,7 @@ lines or deleting -N lines at vertical position VPOS. */ static void -x_ins_del_lines (f, vpos, n) - struct frame *f; - int vpos, n; +x_ins_del_lines (struct frame *f, int vpos, int n) { if (! FRAME_W32_P (f)) return; @@ -2621,9 +2553,7 @@ /* Scroll part of the display as described by RUN. */ static void -x_scroll_run (w, run) - struct window *w; - struct run *run; +x_scroll_run (struct window *w, struct run *run) { struct frame *f = XFRAME (w->frame); int x, y, width, height, from_y, to_y, bottom_y; @@ -2705,16 +2635,14 @@ ***********************************************************************/ static void -frame_highlight (f) - struct frame *f; +frame_highlight (struct frame *f) { x_update_cursor (f, 1); x_set_frame_alpha (f); } static void -frame_unhighlight (f) - struct frame *f; +frame_unhighlight (struct frame *f) { x_update_cursor (f, 1); x_set_frame_alpha (f); @@ -2727,9 +2655,7 @@ Lisp code can tell when the switch took place by examining the events. */ static void -x_new_focus_frame (dpyinfo, frame) - struct w32_display_info *dpyinfo; - struct frame *frame; +x_new_focus_frame (struct w32_display_info *dpyinfo, struct frame *frame) { struct frame *old_focus = dpyinfo->w32_focus_frame; @@ -2757,12 +2683,8 @@ a FOCUS_IN_EVENT into *BUFP. */ static void -x_focus_changed (type, state, dpyinfo, frame, bufp) - int type; - int state; - struct w32_display_info *dpyinfo; - struct frame *frame; - struct input_event *bufp; +x_focus_changed (int type, int state, struct w32_display_info *dpyinfo, + struct frame *frame, struct input_event *bufp) { if (type == WM_SETFOCUS) { @@ -2807,10 +2729,8 @@ Returns FOCUS_IN_EVENT event in *BUFP. */ static void -w32_detect_focus_change (dpyinfo, event, bufp) - struct w32_display_info *dpyinfo; - W32Msg *event; - struct input_event *bufp; +w32_detect_focus_change (struct w32_display_info *dpyinfo, W32Msg *event, + struct input_event *bufp) { struct frame *frame; @@ -2829,8 +2749,7 @@ /* Handle an event saying the mouse has moved out of an Emacs frame. */ void -x_mouse_leave (dpyinfo) - struct w32_display_info *dpyinfo; +x_mouse_leave (struct w32_display_info *dpyinfo) { x_new_focus_frame (dpyinfo, dpyinfo->w32_focus_event_frame); } @@ -2844,8 +2763,7 @@ the appropriate X display info. */ static void -w32_frame_rehighlight (frame) - struct frame *frame; +w32_frame_rehighlight (struct frame *frame) { if (! FRAME_W32_P (frame)) return; @@ -2853,8 +2771,7 @@ } static void -x_frame_rehighlight (dpyinfo) - struct w32_display_info *dpyinfo; +x_frame_rehighlight (struct w32_display_info *dpyinfo) { struct frame *old_highlight = dpyinfo->x_highlight_frame; @@ -2887,8 +2804,7 @@ /* Convert a keysym to its name. */ char * -x_get_keysym_name (keysym) - int keysym; +x_get_keysym_name (int keysym) { /* Make static so we can always return it */ static char value[100]; @@ -2900,7 +2816,8 @@ return value; } -static int codepage_for_locale(LCID locale) +static int +codepage_for_locale (LCID locale) { char cp[20]; @@ -2917,11 +2834,7 @@ the state in PUP. XBUTTON provides extra information for extended mouse button messages. Returns FALSE if unable to parse the message. */ BOOL -parse_button (message, xbutton, pbutton, pup) - int message; - int xbutton; - int * pbutton; - int * pup; +parse_button (int message, int xbutton, int * pbutton, int * pup) { int button = 0; int up = 0; @@ -2989,10 +2902,7 @@ the mouse. */ static Lisp_Object -construct_mouse_click (result, msg, f) - struct input_event *result; - W32Msg *msg; - struct frame *f; +construct_mouse_click (struct input_event *result, W32Msg *msg, struct frame *f) { int button; int up; @@ -3018,10 +2928,7 @@ } static Lisp_Object -construct_mouse_wheel (result, msg, f) - struct input_event *result; - W32Msg *msg; - struct frame *f; +construct_mouse_wheel (struct input_event *result, W32Msg *msg, struct frame *f) { POINT p; int delta; @@ -3054,10 +2961,7 @@ } static Lisp_Object -construct_drag_n_drop (result, msg, f) - struct input_event *result; - W32Msg *msg; - struct frame *f; +construct_drag_n_drop (struct input_event *result, W32Msg *msg, struct frame *f) { Lisp_Object files; Lisp_Object frame; @@ -3118,9 +3022,7 @@ static Lisp_Object last_mouse_motion_frame; static int -note_mouse_movement (frame, msg) - FRAME_PTR frame; - MSG *msg; +note_mouse_movement (FRAME_PTR frame, MSG *msg) { int mouse_x = LOWORD (msg->lParam); int mouse_y = HIWORD (msg->lParam); @@ -3168,12 +3070,15 @@ Mouse Face ************************************************************************/ -static struct scroll_bar *x_window_to_scroll_bar (); -static void x_scroll_bar_report_motion (); +static struct scroll_bar *x_window_to_scroll_bar (Window); +static void x_scroll_bar_report_motion (FRAME_PTR *, Lisp_Object *, + enum scroll_bar_part *, + Lisp_Object *, Lisp_Object *, + unsigned long *); static void x_check_fullscreen (struct frame *); static void -redo_mouse_highlight () +redo_mouse_highlight (void) { if (!NILP (last_mouse_motion_frame) && FRAME_LIVE_P (XFRAME (last_mouse_motion_frame))) @@ -3183,9 +3088,7 @@ } static void -w32_define_cursor (window, cursor) - Window window; - Cursor cursor; +w32_define_cursor (Window window, Cursor cursor) { PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0); } @@ -3210,13 +3113,9 @@ movement. */ static void -w32_mouse_position (fp, insist, bar_window, part, x, y, time) - FRAME_PTR *fp; - int insist; - Lisp_Object *bar_window; - enum scroll_bar_part *part; - Lisp_Object *x, *y; - unsigned long *time; +w32_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, + enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, + unsigned long *time) { FRAME_PTR f1; @@ -3307,9 +3206,7 @@ or ButtonRelase. */ static void -w32_handle_tool_bar_click (f, button_event) - struct frame *f; - struct input_event *button_event; +w32_handle_tool_bar_click (struct frame *f, struct input_event *button_event) { int x = XFASTINT (button_event->x); int y = XFASTINT (button_event->y); @@ -3334,8 +3231,7 @@ bits. */ static struct scroll_bar * -x_window_to_scroll_bar (window_id) - Window window_id; +x_window_to_scroll_bar (Window window_id) { Lisp_Object tail; @@ -3371,9 +3267,8 @@ displaying PORTION out of a whole WHOLE, and our position POSITION. */ static void -w32_set_scroll_bar_thumb (bar, portion, position, whole) - struct scroll_bar *bar; - int portion, position, whole; +w32_set_scroll_bar_thumb (struct scroll_bar *bar, + int portion, int position, int whole) { Window w = SCROLL_BAR_W32_WINDOW (bar); /* We use the whole scroll-bar height in the calculations below, to @@ -3399,7 +3294,7 @@ BLOCK_INPUT; si.cbSize = sizeof (si); si.fMask = SIF_POS | SIF_PAGE; - GetScrollInfo(w, SB_CTL, &si); + GetScrollInfo (w, SB_CTL, &si); near_bottom_p = si.nPos + si.nPage >= range; UNBLOCK_INPUT; if (!near_bottom_p) @@ -3448,9 +3343,7 @@ ************************************************************************/ static HWND -my_create_scrollbar (f, bar) - struct frame * f; - struct scroll_bar * bar; +my_create_scrollbar (struct frame * f, struct scroll_bar * bar) { return (HWND) SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_CREATESCROLLBAR, (WPARAM) f, @@ -3489,26 +3382,21 @@ } static void -my_set_focus (f, hwnd) - struct frame * f; - HWND hwnd; +my_set_focus (struct frame * f, HWND hwnd) { SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SETFOCUS, (WPARAM) hwnd, 0); } static void -my_set_foreground_window (hwnd) - HWND hwnd; +my_set_foreground_window (HWND hwnd) { SendMessage (hwnd, WM_EMACS_SETFOREGROUND, (WPARAM) hwnd, 0); } static void -my_destroy_window (f, hwnd) - struct frame * f; - HWND hwnd; +my_destroy_window (struct frame * f, HWND hwnd) { SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_DESTROYWINDOW, (WPARAM) hwnd, 0); @@ -3520,9 +3408,7 @@ scroll bar. */ static struct scroll_bar * -x_scroll_bar_create (w, top, left, width, height) - struct window *w; - int top, left, width, height; +x_scroll_bar_create (struct window *w, int top, int left, int width, int height) { struct frame *f = XFRAME (WINDOW_FRAME (w)); HWND hwnd; @@ -3575,8 +3461,7 @@ nil. */ static void -x_scroll_bar_remove (bar) - struct scroll_bar *bar; +x_scroll_bar_remove (struct scroll_bar *bar) { FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); @@ -3596,9 +3481,8 @@ characters, starting at POSITION. If WINDOW has no scroll bar, create one. */ static void -w32_set_vertical_scroll_bar (w, portion, whole, position) - struct window *w; - int portion, whole, position; +w32_set_vertical_scroll_bar (struct window *w, + int portion, int whole, int position) { struct frame *f = XFRAME (w->frame); struct scroll_bar *bar; @@ -3741,8 +3625,7 @@ `*redeem_scroll_bar_hook' is applied to its window before the judgment. */ static void -w32_condemn_scroll_bars (frame) - FRAME_PTR frame; +w32_condemn_scroll_bars (FRAME_PTR frame) { /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */ while (! NILP (FRAME_SCROLL_BARS (frame))) @@ -3763,8 +3646,7 @@ Note that WINDOW isn't necessarily condemned at all. */ static void -w32_redeem_scroll_bar (window) - struct window *window; +w32_redeem_scroll_bar (struct window *window) { struct scroll_bar *bar; struct frame *f; @@ -3809,8 +3691,7 @@ last call to `*condemn_scroll_bars_hook'. */ static void -w32_judge_scroll_bars (f) - FRAME_PTR f; +w32_judge_scroll_bars (FRAME_PTR f) { Lisp_Object bar, next; @@ -3841,10 +3722,8 @@ mark bits. */ static int -w32_scroll_bar_handle_click (bar, msg, emacs_event) - struct scroll_bar *bar; - W32Msg *msg; - struct input_event *emacs_event; +w32_scroll_bar_handle_click (struct scroll_bar *bar, W32Msg *msg, + struct input_event *emacs_event) { if (! WINDOWP (bar->window)) abort (); @@ -3950,12 +3829,10 @@ on the scroll bar. */ static void -x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) - FRAME_PTR *fp; - Lisp_Object *bar_window; - enum scroll_bar_part *part; - Lisp_Object *x, *y; - unsigned long *time; +x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, + enum scroll_bar_part *part, + Lisp_Object *x, Lisp_Object *y, + unsigned long *time) { struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); Window w = SCROLL_BAR_W32_WINDOW (bar); @@ -4011,8 +3888,7 @@ redraw them. */ void -x_scroll_bar_clear (f) - FRAME_PTR f; +x_scroll_bar_clear (FRAME_PTR f) { Lisp_Object bar; @@ -4071,10 +3947,8 @@ */ int -w32_read_socket (sd, expected, hold_quit) - register int sd; - int expected; - struct input_event *hold_quit; +w32_read_socket (struct terminal *terminal, int expected, + struct input_event *hold_quit) { int count = 0; int check_visibility = 0; @@ -4295,7 +4169,7 @@ temp_index = 0; temp_buffer[temp_index++] = msg.msg.wParam; inev.kind = MULTIMEDIA_KEY_EVENT; - inev.code = GET_APPCOMMAND_LPARAM(msg.msg.lParam); + inev.code = GET_APPCOMMAND_LPARAM (msg.msg.lParam); inev.modifiers = msg.dwModifiers; XSETFRAME (inev.frame_or_window, f); inev.timestamp = msg.msg.time; @@ -4343,7 +4217,7 @@ selected now and last mouse movement event was not in it. Minibuffer window will be selected only when it is active. */ - if (WINDOWP(window) + if (WINDOWP (window) && !EQ (window, last_window) && !EQ (window, selected_window) /* For click-to-focus window managers @@ -4903,11 +4777,7 @@ mode lines must be clipped to the whole window. */ static void -w32_clip_to_row (w, row, area, hdc) - struct window *w; - struct glyph_row *row; - int area; - HDC hdc; +w32_clip_to_row (struct window *w, struct glyph_row *row, int area, HDC hdc) { struct frame *f = XFRAME (WINDOW_FRAME (w)); RECT clip_rect; @@ -4928,9 +4798,7 @@ /* Draw a hollow box cursor on window W in glyph row ROW. */ static void -x_draw_hollow_cursor (w, row) - struct window *w; - struct glyph_row *row; +x_draw_hollow_cursor (struct window *w, struct glyph_row *row) { struct frame *f = XFRAME (WINDOW_FRAME (w)); HDC hdc; @@ -4970,11 +4838,8 @@ --gerd. */ static void -x_draw_bar_cursor (w, row, width, kind) - struct window *w; - struct glyph_row *row; - int width; - enum text_cursor_kinds kind; +x_draw_bar_cursor (struct window *w, struct glyph_row *row, + int width, enum text_cursor_kinds kind) { struct frame *f = XFRAME (w->frame); struct glyph *cursor_glyph; @@ -5053,9 +4918,7 @@ /* RIF: Define cursor CURSOR on frame F. */ static void -w32_define_frame_cursor (f, cursor) - struct frame *f; - Cursor cursor; +w32_define_frame_cursor (struct frame *f, Cursor cursor) { w32_define_cursor (FRAME_W32_WINDOW (f), cursor); } @@ -5064,9 +4927,7 @@ /* RIF: Clear area on frame F. */ static void -w32_clear_frame_area (f, x, y, width, height) - struct frame *f; - int x, y, width, height; +w32_clear_frame_area (struct frame *f, int x, int y, int width, int height) { HDC hdc; @@ -5078,12 +4939,9 @@ /* RIF: Draw or clear cursor on window W. */ static void -w32_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p) - struct window *w; - struct glyph_row *glyph_row; - int x, y; - int cursor_type, cursor_width; - int on_p, active_p; +w32_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, + int x, int y, int cursor_type, int cursor_width, + int on_p, int active_p) { if (on_p) { @@ -5178,9 +5036,7 @@ /* Icons. */ int -x_bitmap_icon (f, icon) - struct frame *f; - Lisp_Object icon; +x_bitmap_icon (struct frame *f, Lisp_Object icon) { HANDLE main_icon; HANDLE small_icon = NULL; @@ -5269,10 +5125,7 @@ /* Changing the font of the frame. */ Lisp_Object -x_new_font (f, font_object, fontset) - struct frame *f; - Lisp_Object font_object; - int fontset; +x_new_font (struct frame *f, Lisp_Object font_object, int fontset) { struct font *font = XFONT_OBJECT (font_object); @@ -5340,8 +5193,7 @@ from its current recorded position values and gravity. */ void -x_calc_absolute_position (f) - struct frame *f; +x_calc_absolute_position (struct frame *f) { int flags = f->size_hint_flags; @@ -5401,10 +5253,8 @@ which means, do adjust for borders but don't change the gravity. */ void -x_set_offset (f, xoff, yoff, change_gravity) - struct frame *f; - register int xoff, yoff; - int change_gravity; +x_set_offset (struct frame *f, register int xoff, register int yoff, + int change_gravity) { int modified_top, modified_left; @@ -5439,8 +5289,7 @@ /* Check if we need to resize the frame due to a fullscreen request. If so needed, resize the frame. */ static void -x_check_fullscreen (f) - struct frame *f; +x_check_fullscreen (struct frame *f) { if (f->want_fullscreen & FULLSCREEN_BOTH) { @@ -5470,10 +5319,7 @@ Otherwise we leave the window gravity unchanged. */ void -x_set_window_size (f, change_gravity, cols, rows) - struct frame *f; - int change_gravity; - int cols, rows; +x_set_window_size (struct frame *f, int change_gravity, int cols, int rows) { int pixelwidth, pixelheight; @@ -5498,8 +5344,8 @@ rect.right = pixelwidth; rect.bottom = pixelheight; - AdjustWindowRect(&rect, f->output_data.w32->dwStyle, - FRAME_EXTERNAL_MENU_BAR (f)); + AdjustWindowRect (&rect, f->output_data.w32->dwStyle, + FRAME_EXTERNAL_MENU_BAR (f)); my_set_window_pos (FRAME_W32_WINDOW (f), NULL, @@ -5565,9 +5411,7 @@ void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y); void -x_set_mouse_position (f, x, y) - struct frame *f; - int x, y; +x_set_mouse_position (struct frame *f, int x, int y) { int pix_x, pix_y; @@ -5584,9 +5428,7 @@ } void -x_set_mouse_pixel_position (f, pix_x, pix_y) - struct frame *f; - int pix_x, pix_y; +x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) { RECT rect; POINT pt; @@ -5607,8 +5449,7 @@ /* focus shifting, raising and lowering. */ void -x_focus_on_frame (f) - struct frame *f; +x_focus_on_frame (struct frame *f) { struct w32_display_info *dpyinfo = &one_w32_display_info; @@ -5625,15 +5466,13 @@ } void -x_unfocus_frame (f) - struct frame *f; +x_unfocus_frame (struct frame *f) { } /* Raise frame F. */ void -x_raise_frame (f) - struct frame *f; +x_raise_frame (struct frame *f) { BLOCK_INPUT; @@ -5692,8 +5531,7 @@ /* Lower frame F. */ void -x_lower_frame (f) - struct frame *f; +x_lower_frame (struct frame *f) { BLOCK_INPUT; my_set_window_pos (FRAME_W32_WINDOW (f), @@ -5704,9 +5542,7 @@ } static void -w32_frame_raise_lower (f, raise_flag) - FRAME_PTR f; - int raise_flag; +w32_frame_raise_lower (FRAME_PTR f, int raise_flag) { if (! FRAME_W32_P (f)) return; @@ -5727,8 +5563,7 @@ finishes with it. */ void -x_make_frame_visible (f) - struct frame *f; +x_make_frame_visible (struct frame *f) { Lisp_Object type; @@ -5752,8 +5587,8 @@ /* Adjust vertical window position in order to avoid being covered by a task bar placed at the bottom of the desktop. */ - SystemParametersInfo(SPI_GETWORKAREA, 0, &workarea_rect, 0); - GetWindowRect(FRAME_W32_WINDOW(f), &window_rect); + SystemParametersInfo (SPI_GETWORKAREA, 0, &workarea_rect, 0); + GetWindowRect (FRAME_W32_WINDOW(f), &window_rect); if (window_rect.bottom > workarea_rect.bottom && window_rect.top > workarea_rect.top) f->top_pos = max (window_rect.top @@ -5820,8 +5655,8 @@ /* Make the frame visible (mapped and not iconified). */ -x_make_frame_invisible (f) - struct frame *f; +void +x_make_frame_invisible (struct frame *f) { /* Don't keep the highlight on an invisible frame. */ if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f) @@ -5847,8 +5682,7 @@ /* Change window state from mapped to iconified. */ void -x_iconify_frame (f) - struct frame *f; +x_iconify_frame (struct frame *f) { Lisp_Object type; @@ -5934,8 +5768,7 @@ /* Destroy the window of frame F. */ void -x_destroy_window (f) - struct frame *f; +x_destroy_window (struct frame *f) { struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); @@ -5952,10 +5785,7 @@ If USER_POSITION is nonzero, we set the USPosition flag (this is useful when FLAGS is 0). */ void -x_wm_set_size_hint (f, flags, user_position) - struct frame *f; - long flags; - int user_position; +x_wm_set_size_hint (struct frame *f, long flags, int user_position) { Window window = FRAME_W32_WINDOW (f); @@ -5971,9 +5801,7 @@ /* Window manager things */ void -x_wm_set_icon_position (f, icon_x, icon_y) - struct frame *f; - int icon_x, icon_y; +x_wm_set_icon_position (struct frame *f, int icon_x, int icon_y) { #if 0 Window window = FRAME_W32_WINDOW (f); @@ -5994,8 +5822,7 @@ static int w32_initialized = 0; void -w32_initialize_display_info (display_name) - Lisp_Object display_name; +w32_initialize_display_info (Lisp_Object display_name) { struct w32_display_info *dpyinfo = &one_w32_display_info; @@ -6048,8 +5875,7 @@ but any whitespace following value is not removed. */ static char * -w32_make_rdb (xrm_option) - char *xrm_option; +w32_make_rdb (char *xrm_option) { char *buffer = xmalloc (strlen (xrm_option) + 2); char *current = buffer; @@ -6208,10 +6034,7 @@ } struct w32_display_info * -w32_term_init (display_name, xrm_option, resource_name) - Lisp_Object display_name; - char *xrm_option; - char *resource_name; +w32_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) { struct w32_display_info *dpyinfo; struct terminal *terminal; @@ -6286,8 +6109,7 @@ /* Get rid of display DPYINFO, assuming all frames are already gone. */ void -x_delete_display (dpyinfo) - struct w32_display_info *dpyinfo; +x_delete_display (struct w32_display_info *dpyinfo) { /* Discard this display from w32_display_name_list and w32_display_list. We can't use Fdelq because that can quit. */ @@ -6323,7 +6145,7 @@ } dpyinfo->color_list = NULL; if (dpyinfo->palette) - DeleteObject(dpyinfo->palette); + DeleteObject (dpyinfo->palette); } xfree (dpyinfo->w32_id_name); @@ -6335,7 +6157,7 @@ DWORD WINAPI w32_msg_worker (void * arg); static void -w32_initialize () +w32_initialize (void) { HANDLE shell; HRESULT (WINAPI * set_user_model) (wchar_t * id); @@ -6438,7 +6260,7 @@ } void -syms_of_w32term () +syms_of_w32term (void) { staticpro (&w32_display_name_list); w32_display_name_list = Qnil;
--- a/src/w32uniscribe.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32uniscribe.c Wed Jul 07 12:15:48 2010 +0000 @@ -64,8 +64,7 @@ static Lisp_Object otf_features (HDC context, char *table); static int -memq_no_quit (elt, list) - Lisp_Object elt, list; +memq_no_quit (Lisp_Object elt, Lisp_Object list) { while (CONSP (list) && ! EQ (XCAR (list), elt)) list = XCDR (list); @@ -75,8 +74,7 @@ /* Font backend interface implementation. */ static Lisp_Object -uniscribe_list (frame, font_spec) - Lisp_Object frame, font_spec; +uniscribe_list (Lisp_Object frame, Lisp_Object font_spec) { Lisp_Object fonts = w32font_list_internal (frame, font_spec, 1); FONT_ADD_LOG ("uniscribe-list", font_spec, fonts); @@ -84,8 +82,7 @@ } static Lisp_Object -uniscribe_match (frame, font_spec) - Lisp_Object frame, font_spec; +uniscribe_match (Lisp_Object frame, Lisp_Object font_spec) { Lisp_Object entity = w32font_match_internal (frame, font_spec, 1); FONT_ADD_LOG ("uniscribe-match", font_spec, entity); @@ -93,8 +90,7 @@ } static Lisp_Object -uniscribe_list_family (frame) - Lisp_Object frame; +uniscribe_list_family (Lisp_Object frame) { Lisp_Object list = Qnil; LOGFONT font_match_pattern; @@ -116,10 +112,7 @@ } static Lisp_Object -uniscribe_open (f, font_entity, pixel_size) - FRAME_PTR f; - Lisp_Object font_entity; - int pixel_size; +uniscribe_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) { Lisp_Object font_object = font_make_object (VECSIZE (struct uniscribe_font_info), @@ -148,9 +141,7 @@ } static void -uniscribe_close (f, font) - FRAME_PTR f; - struct font *font; +uniscribe_close (FRAME_PTR f, struct font *font) { struct uniscribe_font_info *uniscribe_font = (struct uniscribe_font_info *) font; @@ -164,8 +155,7 @@ /* Return a list describing which scripts/languages FONT supports by which GSUB/GPOS features of OpenType tables. */ static Lisp_Object -uniscribe_otf_capability (font) - struct font *font; +uniscribe_otf_capability (struct font *font) { HDC context; HFONT old_font; @@ -175,7 +165,7 @@ f = XFRAME (selected_frame); context = get_frame_dc (f); - old_font = SelectObject (context, FONT_HANDLE(font)); + old_font = SelectObject (context, FONT_HANDLE (font)); features = otf_features (context, "GSUB"); XSETCAR (capability, features); @@ -202,8 +192,7 @@ than the length of LGSTRING, nil should be return. In that case, this function is called again with the larger LGSTRING. */ static Lisp_Object -uniscribe_shape (lgstring) - Lisp_Object lgstring; +uniscribe_shape (Lisp_Object lgstring) { struct font * font; struct uniscribe_font_info * uniscribe_font; @@ -287,7 +276,7 @@ passed in. */ f = XFRAME (selected_frame); context = get_frame_dc (f); - old_font = SelectObject (context, FONT_HANDLE(font)); + old_font = SelectObject (context, FONT_HANDLE (font)); result = ScriptShape (context, &(uniscribe_font->cache), chars + items[i].iCharPos, nchars_in_run, @@ -322,7 +311,7 @@ /* Cache not complete... */ f = XFRAME (selected_frame); context = get_frame_dc (f); - old_font = SelectObject (context, FONT_HANDLE(font)); + old_font = SelectObject (context, FONT_HANDLE (font)); result = ScriptPlace (context, &(uniscribe_font->cache), glyphs, nglyphs, attributes, &(items[i].a), @@ -397,7 +386,7 @@ /* Cache incomplete... */ f = XFRAME (selected_frame); context = get_frame_dc (f); - old_font = SelectObject (context, FONT_HANDLE(font)); + old_font = SelectObject (context, FONT_HANDLE (font)); result = ScriptGetGlyphABCWidth (context, &(uniscribe_font->cache), glyphs[j], &char_metric); @@ -451,9 +440,7 @@ Return a glyph code of FONT for characer C (Unicode code point). If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */ static unsigned -uniscribe_encode_char (font, c) - struct font *font; - int c; +uniscribe_encode_char (struct font *font, int c) { HDC context = NULL; struct frame *f = NULL; @@ -509,7 +496,7 @@ the frame. */ f = XFRAME (selected_frame); context = get_frame_dc (f); - old_font = SelectObject (context, FONT_HANDLE(font)); + old_font = SelectObject (context, FONT_HANDLE (font)); result = ScriptShape (context, &(uniscribe_font->cache), ch, len, 2, &(items[0].a), glyphs, clusters, attrs, &nglyphs); @@ -574,12 +561,9 @@ Adds the name of opentype fonts to a Lisp list (passed in as the lParam arg). */ static int CALLBACK -add_opentype_font_name_to_list (logical_font, physical_font, font_type, - list_object) - ENUMLOGFONTEX *logical_font; - NEWTEXTMETRICEX *physical_font; - DWORD font_type; - LPARAM list_object; +add_opentype_font_name_to_list (ENUMLOGFONTEX *logical_font, + NEWTEXTMETRICEX *physical_font, + DWORD font_type, LPARAM list_object) { Lisp_Object* list = (Lisp_Object *) list_object; Lisp_Object family; @@ -650,9 +634,8 @@ /* Check if font supports the otf script/language/features specified. OTF_SPEC is in the format (script lang [(gsub_feature ...)|nil] [(gpos_feature ...)]?) */ -int uniscribe_check_otf (font, otf_spec) - LOGFONT *font; - Lisp_Object otf_spec; +int +uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec) { Lisp_Object script, lang, rest; Lisp_Object features[2]; @@ -947,7 +930,7 @@ NULL, /* get_outline */ NULL, /* free_outline */ NULL, /* anchor_point */ - uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */ + uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */ NULL, /* otf_drive - use shape instead. */ NULL, /* start_for_frame */ NULL, /* end_for_frame */ @@ -957,7 +940,7 @@ /* Note that this should be called at every startup, not just when dumping, as it needs to test for the existence of the Uniscribe library. */ void -syms_of_w32uniscribe () +syms_of_w32uniscribe (void) { HMODULE uniscribe;
--- a/src/w32xfns.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/w32xfns.c Wed Jul 07 12:15:48 2010 +0000 @@ -39,7 +39,7 @@ HANDLE interrupt_handle = NULL; void -init_crit () +init_crit (void) { InitializeCriticalSection (&critsect); @@ -57,7 +57,7 @@ } void -delete_crit () +delete_crit (void) { DeleteCriticalSection (&critsect); @@ -74,7 +74,7 @@ } void -signal_quit () +signal_quit (void) { /* Make sure this event never remains signaled; if the main thread isn't in a blocking call, then this should do nothing. */ @@ -161,9 +161,7 @@ int nQueue = 0; BOOL -get_next_msg (lpmsg, bWait) - W32Msg * lpmsg; - BOOL bWait; +get_next_msg (W32Msg * lpmsg, BOOL bWait) { BOOL bRet = FALSE; @@ -216,7 +214,7 @@ if (!UnionRect (&(lpmsg->rect), &(lpmsg->rect), &(lpCur->w32msg.rect))) { - SetRectEmpty(&(lpmsg->rect)); + SetRectEmpty (&(lpmsg->rect)); } myfree (lpCur); @@ -245,8 +243,7 @@ } BOOL -post_msg (lpmsg) - W32Msg * lpmsg; +post_msg (W32Msg * lpmsg) { int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg)); @@ -298,7 +295,7 @@ /* Process all messages in the current thread's queue. */ void -drain_message_queue () +drain_message_queue (void) { MSG msg; while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) @@ -322,9 +319,7 @@ */ static int -read_integer (string, NextString) - register char *string; - char **NextString; +read_integer (register char *string, char **NextString) { register int Result = 0; int Sign = 1; @@ -348,10 +343,9 @@ } int -XParseGeometry (string, x, y, width, height) - char *string; - int *x, *y; - unsigned int *width, *height; /* RETURN */ +XParseGeometry (char *string, + int *x, int *y, + unsigned int *width, unsigned int *height) { int mask = NoValue; register char *strind; @@ -446,8 +440,7 @@ /* x_sync is a no-op on W32. */ void -x_sync (f) - void *f; +x_sync (void *f) { }
--- a/src/window.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/window.c Wed Jul 07 12:15:48 2010 +0000 @@ -683,7 +683,7 @@ { register struct window *w = decode_any_window (window); int add_x, add_y; - calc_absolute_offset(w, &add_x, &add_y); + calc_absolute_offset (w, &add_x, &add_y); return Fcons (make_number (WINDOW_LEFT_EDGE_X (w) + add_x), Fcons (make_number (WINDOW_TOP_EDGE_Y (w) + add_y), @@ -761,7 +761,7 @@ { register struct window *w = decode_any_window (window); int add_x, add_y; - calc_absolute_offset(w, &add_x, &add_y); + calc_absolute_offset (w, &add_x, &add_y); return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w) + WINDOW_LEFT_MARGIN_WIDTH (w) @@ -3009,7 +3009,7 @@ a specific window, it will attempt to strictly resize that window proportionally, even at the expense of deleting smaller windows. */ static int * -shrink_windows (int total, int size, int nchildren, int shrinkable, +shrink_windows (int total, int size, int nchildren, int shrinkable, int resize_fixed_p, Lisp_Object forward, int width_p, int safe_p) { int available_resize = 0;
--- a/src/xdisp.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/xdisp.c Wed Jul 07 12:15:48 2010 +0000 @@ -12933,7 +12933,7 @@ point. */ if (/* previous candidate is a glyph in TEXT_AREA of that row */ w->cursor.hpos >= 0 - && w->cursor.hpos < MATRIX_ROW_USED(matrix, w->cursor.vpos) + && w->cursor.hpos < MATRIX_ROW_USED (matrix, w->cursor.vpos) && BUFFERP (g1->object) && (g1->charpos == pt_old /* an exact match always wins */ || (BUFFERP (glyph->object) @@ -22309,7 +22309,7 @@ it->pixel_width = 0; it->nglyphs = 0; - height = get_it_property(it, Qline_height); + height = get_it_property (it, Qline_height); /* Split (line-height total-height) list */ if (CONSP (height) && CONSP (XCDR (height)) @@ -22318,7 +22318,7 @@ total_height = XCAR (XCDR (height)); height = XCAR (height); } - height = calc_line_height_property(it, height, font, boff, 1); + height = calc_line_height_property (it, height, font, boff, 1); if (it->override_ascent >= 0) { @@ -22368,11 +22368,11 @@ it->ascent = XINT (height) - it->descent; if (!NILP (total_height)) - spacing = calc_line_height_property(it, total_height, font, boff, 0); - else - { - spacing = get_it_property(it, Qline_spacing); - spacing = calc_line_height_property(it, spacing, font, boff, 0); + spacing = calc_line_height_property (it, total_height, font, boff, 0); + else + { + spacing = get_it_property (it, Qline_spacing); + spacing = calc_line_height_property (it, spacing, font, boff, 0); } if (INTEGERP (spacing)) {
--- a/src/xfaces.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/xfaces.c Wed Jul 07 12:15:48 2010 +0000 @@ -764,7 +764,7 @@ { GC gc = xmalloc (sizeof (*gc)); if (gc) - bcopy(xgcv, gc, sizeof(XGCValues)); + bcopy (xgcv, gc, sizeof (XGCValues)); return gc; }
--- a/src/xterm.c Tue Jul 06 12:12:41 2010 +0000 +++ b/src/xterm.c Wed Jul 07 12:15:48 2010 +0000 @@ -481,7 +481,7 @@ if (FRAME_X_DISPLAY_INFO (f)->root_window != FRAME_X_OUTPUT (f)->parent_desc) /* Since the WM decoration lies under the FRAME_OUTER_WINDOW, we must treat the former instead of the latter. */ - win = FRAME_X_OUTPUT(f)->parent_desc; + win = FRAME_X_OUTPUT (f)->parent_desc; if (dpyinfo->x_highlight_frame == f) alpha = f->alpha[0]; @@ -510,10 +510,10 @@ unsigned long n, left; x_catch_errors (dpy); - rc = XGetWindowProperty(dpy, win, XInternAtom(dpy, OPACITY, False), - 0L, 1L, False, XA_CARDINAL, - &actual, &format, &n, &left, - &data); + rc = XGetWindowProperty (dpy, win, XInternAtom(dpy, OPACITY, False), + 0L, 1L, False, XA_CARDINAL, + &actual, &format, &n, &left, + &data); if (rc == Success && actual != None) if (*(unsigned long *)data == opac) @@ -2259,7 +2259,7 @@ extra = s->face->id == TOOL_BAR_FACE_ID ? XINT (Vtool_bar_button_margin) : 0; - + x0 = x - thick - extra; y0 = y - thick - extra; x1 = x + s->slice.width + thick - 1 + extra; @@ -2879,7 +2879,7 @@ redisplay, do it here. */ gtk_widget_queue_draw (FRAME_GTK_WIDGET (f)); #endif - + XFlush (FRAME_X_DISPLAY (f)); UNBLOCK_INPUT; @@ -3086,7 +3086,7 @@ XTtoggle_invisible_pointer (FRAME_PTR f, int invisible) { BLOCK_INPUT; - if (invisible) + if (invisible) { if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor != 0) XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), @@ -3595,7 +3595,7 @@ /* Convert a keysym to its name. */ char * -x_get_keysym_name (KeySym keysym) +x_get_keysym_name (int keysym) { char *value; @@ -4553,7 +4553,7 @@ if (f->output_data.x->scroll_bar_top_shadow_pixel == -1) { pixel = f->output_data.x->scroll_bar_background_pixel; - if (pixel != -1) + if (pixel != -1) { if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), @@ -4565,7 +4565,7 @@ if (f->output_data.x->scroll_bar_bottom_shadow_pixel == -1) { pixel = f->output_data.x->scroll_bar_background_pixel; - if (pixel != -1) + if (pixel != -1) { if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), @@ -5729,10 +5729,10 @@ EVENT_INIT (inev.ie); inev.ie.kind = NO_EVENT; inev.ie.arg = Qnil; - + if (pending_event_wait.eventtype == event.type) pending_event_wait.eventtype = 0; /* Indicates we got it. */ - + switch (event.type) { case ClientMessage: @@ -6652,7 +6652,7 @@ event.xconfigure.height); f = 0; } -#endif +#endif if (f) { #ifndef USE_X_TOOLKIT @@ -8386,7 +8386,7 @@ set_wm_state (frame, 0, fs, NULL); set_wm_state (frame, 0, fh, NULL); set_wm_state (frame, 0, fw, NULL); - + /* If there are _NET_ atoms we assume we have extended window manager hints. */ switch (f->want_fullscreen) @@ -8459,7 +8459,7 @@ for (i = 0; i < actual_size; ++i) { Atom a = ((Atom*)tmp_data)[i]; - if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) + if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) { if (value == FULLSCREEN_HEIGHT) value = FULLSCREEN_MAXIMIZED; @@ -8480,7 +8480,7 @@ } lval = Qnil; - switch (value) + switch (value) { case FULLSCREEN_WIDTH: lval = Qfullwidth; @@ -8495,7 +8495,7 @@ lval = Qmaximized; break; } - + store_frame_param (f, Qfullscreen, lval); store_frame_param (f, Qsticky, sticky ? Qt : Qnil); @@ -8533,7 +8533,7 @@ case FULLSCREEN_HEIGHT: height = x_display_pixel_height (dpyinfo); } - + if (FRAME_COLS (f) != width || FRAME_LINES (f) != height) { change_frame_size (f, height, width, 0, 1, 0); @@ -8661,7 +8661,7 @@ FD_ZERO (&fds); FD_SET (fd, &fds); - + EMACS_GET_TIME (time_now); EMACS_SUB_TIME (tmo, tmo_at, time_now); @@ -8751,7 +8751,7 @@ if (NILP (tip_frame) || XFRAME (tip_frame) != f) { int r, c; - + /* When the frame is maximized/fullscreen or running under for example Xmonad, x_set_window_size_1 will be a no-op. In that case, the right thing to do is extend rows/cols to @@ -9790,7 +9790,7 @@ fprintf (stderr, "%s-WARNING **: %s\n", log_domain, message); } #endif - + /* Open a connection to X display DISPLAY_NAME, and return the structure that describes the open display. If we cannot contact the display, return null. */ @@ -10211,7 +10211,7 @@ = XInternAtom (dpyinfo->display, "_NET_WM_ICON_NAME", False); dpyinfo->Xatom_net_wm_name = XInternAtom (dpyinfo->display, "_NET_WM_NAME", False); - + dpyinfo->cut_buffers_initialized = 0; dpyinfo->x_dnd_atoms_size = 8; @@ -10340,7 +10340,7 @@ #ifdef HAVE_X_SM /* Close X session management when we close its display. */ if (t->id == 1 && x_session_have_connection ()) - x_session_close(); + x_session_close (); #endif delete_terminal (t); break;