aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2017-07-04 22:20:22 -0400
committerStefan Monnier2017-07-04 22:20:22 -0400
commit079d9a38e45f800d006ca36898513a38e5ff59d0 (patch)
tree363b830a0ced7bfb8d8471aae92a0ae15331ab49
parent2fb15dcbbbb8e0c7d90410a1bc94dbef0a83c15b (diff)
downloademacs-079d9a38e45f800d006ca36898513a38e5ff59d0.tar.gz
emacs-079d9a38e45f800d006ca36898513a38e5ff59d0.zip
* lisp/progmodes/cc-engine.el: Mark unused args
(c-beginning-of-statement-1, c-guess-basic-syntax): Remove unused var c-in-literal-cache. (c-debug-sws-msg): Silence byte-compiler, even if we don't use the arg. (c-append-to-state-cache): Remove unused var `bra+1s'. (c-remove-stale-state-cache): Remove unused var `pps-point-state'. (c-invalidate-state-cache-1): Remove unused var `pa'. (c-forward-decl-or-cast-1): Change comments so they don't look like outline headers. (c-restricted-<>-arglists, c-parse-and-markup-<>-arglists): Declare before first use. (c-forward-decl-or-cast-1): Remove unused var `backup-kwd-sym'. (c-backward-over-enum-header): Remove unused var `up-sexp-pos'.
-rw-r--r--lisp/progmodes/cc-engine.el53
1 files changed, 22 insertions, 31 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 955e1ebb08d..e880bd39321 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -241,7 +241,7 @@
241;; Either nil, or the last character of the macro currently represented by 241;; Either nil, or the last character of the macro currently represented by
242;; `c-macro-cache' which isn't in a comment. */ 242;; `c-macro-cache' which isn't in a comment. */
243 243
244(defun c-invalidate-macro-cache (beg end) 244(defun c-invalidate-macro-cache (beg _end)
245 ;; Called from a before-change function. If the change region is before or 245 ;; Called from a before-change function. If the change region is before or
246 ;; in the macro characterized by `c-macro-cache' etc., nullify it 246 ;; in the macro characterized by `c-macro-cache' etc., nullify it
247 ;; appropriately. BEG and END are the standard before-change-functions 247 ;; appropriately. BEG and END are the standard before-change-functions
@@ -834,7 +834,7 @@ comment at the start of cc-engine.el for more info."
834 (c-stmt-delim-chars (if comma-delim 834 (c-stmt-delim-chars (if comma-delim
835 c-stmt-delim-chars-with-comma 835 c-stmt-delim-chars-with-comma
836 c-stmt-delim-chars)) 836 c-stmt-delim-chars))
837 c-in-literal-cache c-maybe-labelp after-case:-pos saved 837 c-maybe-labelp after-case:-pos saved
838 ;; Current position. 838 ;; Current position.
839 pos 839 pos
840 ;; Position of last stmt boundary character (e.g. ;). 840 ;; Position of last stmt boundary character (e.g. ;).
@@ -1680,6 +1680,7 @@ comment at the start of cc-engine.el for more info."
1680; (not (eobp))))))) 1680; (not (eobp)))))))
1681 1681
1682(defmacro c-debug-sws-msg (&rest args) 1682(defmacro c-debug-sws-msg (&rest args)
1683 (ignore args)
1683 ;;`(message ,@args) 1684 ;;`(message ,@args)
1684 ) 1685 )
1685 1686
@@ -3307,7 +3308,6 @@ comment at the start of cc-engine.el for more info."
3307 paren+1s ; A list of `paren+1's; used to determine a 3308 paren+1s ; A list of `paren+1's; used to determine a
3308 ; good-pos. 3309 ; good-pos.
3309 bra+1 ; just after L bra-ce. 3310 bra+1 ; just after L bra-ce.
3310 bra+1s ; list of OLD values of bra+1.
3311 mstart) ; start of a macro. 3311 mstart) ; start of a macro.
3312 3312
3313 (save-excursion 3313 (save-excursion
@@ -3345,7 +3345,7 @@ comment at the start of cc-engine.el for more info."
3345 ;; Insert the opening brace/bracket/paren position. 3345 ;; Insert the opening brace/bracket/paren position.
3346 (setq c-state-cache (cons (1- pa+1) c-state-cache)) 3346 (setq c-state-cache (cons (1- pa+1) c-state-cache))
3347 ;; Clear admin stuff for the next more nested part of the scan. 3347 ;; Clear admin stuff for the next more nested part of the scan.
3348 (setq ren+1 pa+1 pa+1 nil bra+1 nil bra+1s nil) 3348 (setq ren+1 pa+1 pa+1 nil bra+1 nil)
3349 t) ; Carry on the loop 3349 t) ; Carry on the loop
3350 3350
3351 ;; All open p/b/b's at this nesting level, if any, have probably 3351 ;; All open p/b/b's at this nesting level, if any, have probably
@@ -3429,7 +3429,7 @@ comment at the start of cc-engine.el for more info."
3429 upper-lim ; ,beyond which `c-state-cache' entries are removed 3429 upper-lim ; ,beyond which `c-state-cache' entries are removed
3430 scan-back-pos 3430 scan-back-pos
3431 cons-separated 3431 cons-separated
3432 pair-beg pps-point-state target-depth) 3432 pair-beg target-depth)
3433 3433
3434 ;; Remove entries beyond HERE. Also remove any entries inside 3434 ;; Remove entries beyond HERE. Also remove any entries inside
3435 ;; a macro, unless HERE is in the same macro. 3435 ;; a macro, unless HERE is in the same macro.
@@ -3485,9 +3485,6 @@ comment at the start of cc-engine.el for more info."
3485 target-depth 3485 target-depth
3486 nil pps-state)) 3486 nil pps-state))
3487 3487
3488 (if (= (point) pps-point)
3489 (setq pps-point-state pps-state))
3490
3491 (when (eq (car pps-state) target-depth) 3488 (when (eq (car pps-state) target-depth)
3492 (setq pos (point)) ; POS is now just after an R-paren/brace. 3489 (setq pos (point)) ; POS is now just after an R-paren/brace.
3493 (cond 3490 (cond
@@ -3732,11 +3729,10 @@ comment at the start of cc-engine.el for more info."
3732 ;; brace pair. 3729 ;; brace pair.
3733 (let ((here-bol (c-point 'bol here)) 3730 (let ((here-bol (c-point 'bol here))
3734 too-high-pa ; recorded {/(/[ next above or just below here, or nil. 3731 too-high-pa ; recorded {/(/[ next above or just below here, or nil.
3735 dropped-cons ; was the last removed element a brace pair? 3732 dropped-cons) ; was the last removed element a brace pair?
3736 pa)
3737 ;; The easy bit - knock over-the-top bits off `c-state-cache'. 3733 ;; The easy bit - knock over-the-top bits off `c-state-cache'.
3738 (while (and c-state-cache 3734 (while (and c-state-cache
3739 (>= (setq pa (c-state-cache-top-paren)) here)) 3735 (>= (c-state-cache-top-paren) here))
3740 (setq dropped-cons (consp (car c-state-cache)) 3736 (setq dropped-cons (consp (car c-state-cache))
3741 too-high-pa (c-state-cache-top-lparen) 3737 too-high-pa (c-state-cache-top-lparen)
3742 c-state-cache (cdr c-state-cache))) 3738 c-state-cache (cdr c-state-cache)))
@@ -5027,7 +5023,7 @@ comment at the start of cc-engine.el for more info."
5027 5023
5028;; Tools for handling comments and string literals. 5024;; Tools for handling comments and string literals.
5029 5025
5030(defun c-in-literal (&optional lim detect-cpp) 5026(defun c-in-literal (&optional _lim detect-cpp)
5031 "Return the type of literal point is in, if any. 5027 "Return the type of literal point is in, if any.
5032The return value is `c' if in a C-style comment, `c++' if in a C++ 5028The return value is `c' if in a C-style comment, `c++' if in a C++
5033style comment, `string' if in a string literal, `pound' if DETECT-CPP 5029style comment, `string' if in a string literal, `pound' if DETECT-CPP
@@ -5035,9 +5031,6 @@ is non-nil and in a preprocessor line, or nil if somewhere else.
5035Optional LIM is used as the backward limit of the search. If omitted, 5031Optional LIM is used as the backward limit of the search. If omitted,
5036or nil, `c-beginning-of-defun' is used. 5032or nil, `c-beginning-of-defun' is used.
5037 5033
5038The last point calculated is cached if the cache is enabled, i.e. if
5039`c-in-literal-cache' is bound to a two element vector.
5040
5041Note that this function might do hidden buffer changes. See the 5034Note that this function might do hidden buffer changes. See the
5042comment at the start of cc-engine.el for more info." 5035comment at the start of cc-engine.el for more info."
5043 (save-restriction 5036 (save-restriction
@@ -6139,7 +6132,7 @@ comment at the start of cc-engine.el for more info."
6139;; Shut up the byte compiler. 6132;; Shut up the byte compiler.
6140(defvar c-maybe-stale-found-type) 6133(defvar c-maybe-stale-found-type)
6141 6134
6142(defun c-trim-found-types (beg end old-len) 6135(defun c-trim-found-types (beg end _old-len)
6143 ;; An after change function which, in conjunction with the info in 6136 ;; An after change function which, in conjunction with the info in
6144 ;; c-maybe-stale-found-type (set in c-before-change), removes a type 6137 ;; c-maybe-stale-found-type (set in c-before-change), removes a type
6145 ;; from `c-found-types', should this type have become stale. For 6138 ;; from `c-found-types', should this type have become stale. For
@@ -6409,6 +6402,9 @@ comment at the start of cc-engine.el for more info."
6409 (c-clear-<>-pair-props) 6402 (c-clear-<>-pair-props)
6410 (forward-char))))))) 6403 (forward-char)))))))
6411 6404
6405(defvar c-restricted-<>-arglists) ;FIXME: Move definition here?
6406(defvar c-parse-and-markup-<>-arglists) ;FIXME: Move definition here?
6407
6412(defun c-restore-<>-properties (_beg _end _old-len) 6408(defun c-restore-<>-properties (_beg _end _old-len)
6413 ;; This function is called as an after-change function. It restores the 6409 ;; This function is called as an after-change function. It restores the
6414 ;; category/syntax-table properties on template/generic <..> pairs between 6410 ;; category/syntax-table properties on template/generic <..> pairs between
@@ -6715,7 +6711,7 @@ comment at the start of cc-engine.el for more info."
6715 (c-put-char-property open-paren 'syntax-table '(1))) 6711 (c-put-char-property open-paren 'syntax-table '(1)))
6716 (goto-char bound)))) 6712 (goto-char bound))))
6717 6713
6718(defun c-after-change-re-mark-raw-strings (beg end old-len) 6714(defun c-after-change-re-mark-raw-strings (_beg _end _old-len)
6719 ;; This function applies `syntax-table' text properties to C++ raw strings 6715 ;; This function applies `syntax-table' text properties to C++ raw strings
6720 ;; beginning in the region (c-new-BEG c-new-END). BEG, END, and OLD-LEN are 6716 ;; beginning in the region (c-new-BEG c-new-END). BEG, END, and OLD-LEN are
6721 ;; the standard arguments supplied to any after-change function. 6717 ;; the standard arguments supplied to any after-change function.
@@ -8239,10 +8235,6 @@ comment at the start of cc-engine.el for more info."
8239 ;; If `backup-at-type' is nil then the other variables have 8235 ;; If `backup-at-type' is nil then the other variables have
8240 ;; undefined values. 8236 ;; undefined values.
8241 backup-at-type backup-type-start backup-id-start 8237 backup-at-type backup-type-start backup-id-start
8242 ;; This stores `kwd-sym' of the symbol before the current one.
8243 ;; This is needed to distinguish the C++11 version of "auto" from
8244 ;; the pre C++11 meaning.
8245 backup-kwd-sym
8246 ;; Set if we've found a specifier (apart from "typedef") that makes 8238 ;; Set if we've found a specifier (apart from "typedef") that makes
8247 ;; the defined identifier(s) types. 8239 ;; the defined identifier(s) types.
8248 at-type-decl 8240 at-type-decl
@@ -8350,7 +8342,6 @@ comment at the start of cc-engine.el for more info."
8350 (setq backup-at-type at-type 8342 (setq backup-at-type at-type
8351 backup-type-start type-start 8343 backup-type-start type-start
8352 backup-id-start id-start 8344 backup-id-start id-start
8353 backup-kwd-sym kwd-sym
8354 at-type found-type 8345 at-type found-type
8355 type-start start 8346 type-start start
8356 id-start (point) 8347 id-start (point)
@@ -8904,9 +8895,9 @@ comment at the start of cc-engine.el for more info."
8904 ;; uncommon (e.g. some placements of "const" in C++) it's not worth 8895 ;; uncommon (e.g. some placements of "const" in C++) it's not worth
8905 ;; the effort to look for them.) 8896 ;; the effort to look for them.)
8906 8897
8907;;; 2008-04-16: commented out the next form, to allow the function to recognize 8898;;; 2008-04-16: commented out the next form, to allow the function to recognize
8908;;; "foo (int bar)" in CC (an implicit type (in class foo) without a semicolon) 8899;;; "foo (int bar)" in CC (an implicit type (in class foo) without a semicolon)
8909;;; as a(n almost complete) declaration, enabling it to be fontified. 8900;;; as a(n almost complete) declaration, enabling it to be fontified.
8910 ;; CASE 13 8901 ;; CASE 13
8911 ;; (unless (or at-decl-end (looking-at "=[^=]")) 8902 ;; (unless (or at-decl-end (looking-at "=[^=]"))
8912 ;; If this is a declaration it should end here or its initializer(*) 8903 ;; If this is a declaration it should end here or its initializer(*)
@@ -10038,7 +10029,7 @@ comment at the start of cc-engine.el for more info."
10038 (c-syntactic-re-search-forward ";" nil 'move t)))) 10029 (c-syntactic-re-search-forward ";" nil 'move t))))
10039 nil))) 10030 nil)))
10040 10031
10041(defun c-looking-at-decl-block (containing-sexp goto-start &optional limit) 10032(defun c-looking-at-decl-block (_containing-sexp goto-start &optional limit)
10042 ;; Assuming the point is at an open brace, check if it starts a 10033 ;; Assuming the point is at an open brace, check if it starts a
10043 ;; block that contains another declaration level, i.e. that isn't a 10034 ;; block that contains another declaration level, i.e. that isn't a
10044 ;; statement block or a brace list, and if so return non-nil. 10035 ;; statement block or a brace list, and if so return non-nil.
@@ -10311,7 +10302,7 @@ comment at the start of cc-engine.el for more info."
10311 ;; We're at a "{". Move back to the enum-like keyword that starts this 10302 ;; We're at a "{". Move back to the enum-like keyword that starts this
10312 ;; declaration and return t, otherwise don't move and return nil. 10303 ;; declaration and return t, otherwise don't move and return nil.
10313 (let ((here (point)) 10304 (let ((here (point))
10314 up-sexp-pos before-identifier) 10305 before-identifier)
10315 (when c-recognize-post-brace-list-type-p 10306 (when c-recognize-post-brace-list-type-p
10316 (c-backward-typed-enum-colon)) 10307 (c-backward-typed-enum-colon))
10317 (while 10308 (while
@@ -10581,7 +10572,7 @@ comment at the start of cc-engine.el for more info."
10581 next-containing nil)))) 10572 next-containing nil))))
10582 (and (consp bufpos) (car bufpos)))))) 10573 (and (consp bufpos) (car bufpos))))))
10583 10574
10584(defun c-looking-at-special-brace-list (&optional lim) 10575(defun c-looking-at-special-brace-list (&optional _lim)
10585 ;; If we're looking at the start of a pike-style list, i.e., `({ })', 10576 ;; If we're looking at the start of a pike-style list, i.e., `({ })',
10586 ;; `([ ])', `(< >)', etc., a cons of a cons of its starting and ending 10577 ;; `([ ])', `(< >)', etc., a cons of a cons of its starting and ending
10587 ;; positions and its entry in c-special-brace-lists is returned, nil 10578 ;; positions and its entry in c-special-brace-lists is returned, nil
@@ -10644,7 +10635,7 @@ comment at the start of cc-engine.el for more info."
10644 (cons (list beg) type))))) 10635 (cons (list beg) type)))))
10645 (error nil)))) 10636 (error nil))))
10646 10637
10647(defun c-looking-at-bos (&optional lim) 10638(defun c-looking-at-bos (&optional _lim)
10648 ;; Return non-nil if between two statements or declarations, assuming 10639 ;; Return non-nil if between two statements or declarations, assuming
10649 ;; point is not inside a literal or comment. 10640 ;; point is not inside a literal or comment.
10650 ;; 10641 ;;
@@ -11206,7 +11197,7 @@ comment at the start of cc-engine.el for more info."
11206 containing-decl-open 11197 containing-decl-open
11207 containing-decl-start 11198 containing-decl-start
11208 containing-decl-kwd 11199 containing-decl-kwd
11209 paren-state) 11200 _paren-state)
11210 ;; The inclass and class-close syntactic symbols are added in 11201 ;; The inclass and class-close syntactic symbols are added in
11211 ;; several places and some work is needed to fix everything. 11202 ;; several places and some work is needed to fix everything.
11212 ;; Therefore it's collected here. 11203 ;; Therefore it's collected here.
@@ -11422,7 +11413,7 @@ comment at the start of cc-engine.el for more info."
11422 ;; following result clauses, and most of this function is a 11413 ;; following result clauses, and most of this function is a
11423 ;; single gigantic cond. :P 11414 ;; single gigantic cond. :P
11424 literal char-before-ip before-ws-ip char-after-ip macro-start 11415 literal char-before-ip before-ws-ip char-after-ip macro-start
11425 in-macro-expr c-syntactic-context placeholder c-in-literal-cache 11416 in-macro-expr c-syntactic-context placeholder
11426 step-type tmpsymbol keyword injava-inher special-brace-list tmp-pos 11417 step-type tmpsymbol keyword injava-inher special-brace-list tmp-pos
11427 containing-< 11418 containing-<
11428 ;; The following record some positions for the containing 11419 ;; The following record some positions for the containing