This instance will be upgraded to Heptapod 0.25.0 (final) on 2021-09-22 at 15:00 UTC+2 (a few minutes of down time)

Commit d545d706 authored by Alan Mackenzie's avatar Alan Mackenzie
Browse files

CC Mode: fix many compiler warnings which would appear with lexical binding

* cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-defs.el, cc-engine.el
cc-fonts.el, cc-langs.el, cc-mode.el, cc-subword.el, cc-vars.el: In many
places, where function parameters are not used, prefix their names with _.

* cc-cmds.el (c-electric-brace, c-defun-name-and-limits)
cc-engine.el (c-cache-to-parse-ps-state, c-full-trim-near-cache)
(c-after-change-unmark-raw-strings, c-maybe-re-mark-raw-string)
(c-forward-decl-or-cast-1): Remove unused local variables.

* cc-defs.el (c-will-be-unescaped): Remove unused parameter end.
* cc-engine.el (c-looking-at-decl-block): Remove unused parameter
containing-sexp.
(c-looking-at-special-brace-list): Remove unused parameter lim.
(c-add-class-syntax): Remove unused parameter paren-state.
parent 6bb67da4b790
......@@ -162,7 +162,7 @@ Works with: topmost-intro-cont."
(c-safe-position (or containing-sexp (point)) c-state-cache)
containing-sexp))))
(defun c-lineup-arglist (langelem)
(defun c-lineup-arglist (_langelem)
"Line up the current argument line under the first argument.
As a special case, if the indented line is inside a brace block
......@@ -268,7 +268,7 @@ Works with: arglist-cont, arglist-cont-nonempty."
(c-forward-syntactic-ws))
(c-lineup-argcont-scan other-match)))))
(defun c-lineup-arglist-intro-after-paren (langelem)
(defun c-lineup-arglist-intro-after-paren (_langelem)
"Line up a line to just after the open paren of the surrounding paren
or brace block.
......@@ -486,7 +486,7 @@ Works with: func-decl-cont."
(vector (+ (current-column) c-basic-offset)))
c-basic-offset))))
(defun c-indent-one-line-block (langelem)
(defun c-indent-one-line-block (_langelem)
"Indent a one line block `c-basic-offset' extra.
E.g.:
......@@ -509,7 +509,7 @@ Work with: Almost all syntactic symbols, but most useful on *-open."
c-basic-offset
nil))))
(defun c-indent-multi-line-block (langelem)
(defun c-indent-multi-line-block (_langelem)
"Indent a multi line block `c-basic-offset' extra.
E.g.:
......@@ -645,7 +645,7 @@ Works with: The `c' syntactic symbol."
(goto-char (c-langelem-pos langelem)))))
(vector (current-column)))))))
(defun c-lineup-comment (langelem)
(defun c-lineup-comment (_langelem)
"Line up a comment start according to `c-comment-only-line-offset'.
If the comment is lined up with a comment starter on the previous
line, that alignment is preserved.
......@@ -670,7 +670,7 @@ Works with: comment-intro."
-1000)) ;jam it against the left side
))))
(defun c-lineup-knr-region-comment (langelem)
(defun c-lineup-knr-region-comment (_langelem)
"Line up a comment in the \"K&R region\" with the declaration.
That is the region between the function or class header and the
beginning of the block. E.g.:
......@@ -871,7 +871,7 @@ arglist-cont-nonempty."
(vector col))))))
(defun c-lineup-string-cont (langelem)
(defun c-lineup-string-cont (_langelem)
"Line up a continued string under the one it continues.
A continued string in this sense is where a string literal follows
directly after another one. E.g.:
......@@ -896,7 +896,7 @@ arglist-cont-nonempty."
(goto-char pos)
(vector (current-column)))))))
(defun c-lineup-template-args (langelem)
(defun c-lineup-template-args (_langelem)
"Line up template argument lines under the first argument.
To allow this function to be used in a list expression, nil is
returned if there's no template argument on the first line.
......@@ -1026,7 +1026,7 @@ Works with: objc-method-args-cont."
(+ curcol (- prev-col-column (current-column)))
c-basic-offset)))))
(defun c-lineup-inexpr-block (langelem)
(defun c-lineup-inexpr-block (_langelem)
"Line up the block for constructs that use a block inside an expression,
e.g. anonymous classes in Java and lambda functions in Pike. The body
is aligned with the start of the header, e.g. with the \"new\" or
......@@ -1054,7 +1054,7 @@ Works with: inlambda, inexpr-statement, inexpr-class."
(goto-char (cdr res))
(vector (current-column))))))
(defun c-lineup-whitesmith-in-block (langelem)
(defun c-lineup-whitesmith-in-block (_langelem)
"Line up lines inside a block in Whitesmith style.
It's done in a way that works both when the opening brace hangs and
when it doesn't. E.g.:
......@@ -1118,7 +1118,7 @@ arglist-cont."
(vector (+ (current-column) c-basic-offset))))
(vector 0)))))
(defun c-lineup-2nd-brace-entry-in-arglist (langelem)
(defun c-lineup-2nd-brace-entry-in-arglist (_langelem)
"Lineup the second entry of a brace block under the first, when the first
line is also contained in an arglist or an enclosing brace ON THAT LINE.
......@@ -1159,7 +1159,7 @@ Works with brace-list-intro."
(eq (char-after) ?{))))
'c-lineup-arglist-intro-after-paren))
(defun c-lineup-class-decl-init-+ (langelem)
(defun c-lineup-class-decl-init-+ (_langelem)
"Line up the second entry of a class (etc.) initializer c-basic-offset
characters in from the identifier when:
\(i) The type is a class, struct, union, etc. (but not an enum);
......@@ -1200,7 +1200,7 @@ Works with: brace-list-intro."
(eq (point) init-pos)
(vector (+ (current-column) c-basic-offset)))))))
(defun c-lineup-class-decl-init-after-brace (langelem)
(defun c-lineup-class-decl-init-after-brace (_langelem)
"Line up the second entry of a class (etc.) initializer after its opening
brace when:
\(i) The type is a class, struct, union, etc. (but not an enum);
......@@ -1242,7 +1242,7 @@ Works with: brace-list-intro."
(eq (point) init-pos)
'c-lineup-arglist-intro-after-paren)))))
(defun c-lineup-cpp-define (langelem)
(defun c-lineup-cpp-define (_langelem)
"Line up macro continuation lines according to the indentation of
the construct preceding the macro. E.g.:
......@@ -1391,7 +1391,7 @@ Works with: Any syntactic symbol which has an anchor position."
(vector (current-column))))
(defun c-lineup-dont-change (langelem)
(defun c-lineup-dont-change (_langelem)
"Do not change the indentation of the current line.
Works with: Any syntactic symbol."
......@@ -1399,7 +1399,7 @@ Works with: Any syntactic symbol."
(back-to-indentation)
(vector (current-column))))
(defun c-lineup-respect-col-0 (langelem)
(defun c-lineup-respect-col-0 (_langelem)
"If the current line starts at column 0, return [0]. Otherwise return nil.
This can be used for comments (in conjunction with, say,
......@@ -1412,7 +1412,7 @@ anchored there, but reindent other comments."
nil)))
(defun c-snug-do-while (syntax pos)
(defun c-snug-do-while (syntax _pos)
"Dynamically calculate brace hanginess for do-while statements.
Using this function, `while' clauses that end a `do-while' block will
remain on the same line as the brace that closes that block.
......@@ -1430,7 +1430,7 @@ ACTION associated with `block-close' syntax."
'(before)
'(before after)))))
(defun c-snug-1line-defun-close (syntax pos)
(defun c-snug-1line-defun-close (_syntax pos)
"Determine the brace hanginess for an AWK defun-close.
If the action/function being closed is a one-liner, keep it so. Otherwise put
the closing brace on its own line."
......
......@@ -595,7 +595,7 @@
;; starts at a `while' token.
(not (c-get-char-property (c-point 'eol) 'c-awk-NL-prop)))
(defun c-awk-clear-NL-props (beg end)
(defun c-awk-clear-NL-props (beg _end)
;; This function is run from before-change-hooks. It clears the
;; c-awk-NL-prop text property from beg to the end of the buffer (The END
;; parameter is ignored). This ensures that the indentation engine will
......@@ -850,7 +850,7 @@
;; Just beyond logical line following the region which is about to be changed.
;; Set in c-awk-record-region-clear-NL and used in c-awk-after-change.
(defun c-awk-record-region-clear-NL (beg end)
(defun c-awk-record-region-clear-NL (_beg end)
;; This function is called exclusively from the before-change-functions hook.
;; It does two things: Finds the end of the (logical) line on which END lies,
;; and clears c-awk-NL-prop text properties from this point onwards. BEG is
......
......@@ -280,7 +280,7 @@ perhaps a `cc-bytecomp-restore-environment' is forgotten somewhere"))
(cc-bytecomp-debug-msg
"cc-bytecomp-restore-environment: Done"))))
(defun cc-bytecomp-load (cc-part)
(defun cc-bytecomp-load (_cc-part)
;; A dummy function which will immediately be overwritten by the
;; following at load time. This should suppress the byte compiler
;; error that the function is "not known to be defined".
......
......@@ -905,7 +905,6 @@ settings of `c-cleanup-list' are done."
(when (and (boundp 'electric-pair-mode)
electric-pair-mode)
(let ((size (buffer-size))
(c-in-electric-pair-functionality t)
post-self-insert-hook)
(electric-pair-post-self-insert-function)
(setq got-pair-} (and at-eol
......@@ -2297,7 +2296,7 @@ with a brace block, at the outermost level of nesting."
(c-save-buffer-state ((paren-state (c-parse-state))
(orig-point-min (point-min))
(orig-point-max (point-max))
lim name where limits fdoc)
lim name limits where)
(setq lim (c-widen-to-enclosing-decl-scope
paren-state orig-point-min orig-point-max))
(and lim (setq lim (1- lim)))
......
......@@ -400,9 +400,8 @@ to it is returned. This function does not modify the point or the mark."
(setq count (+ count (skip-chars-backward "\\\\"))))
(not (zerop (logand count 1))))))
(defmacro c-will-be-unescaped (beg end)
;; Would the character after END be unescaped after the removal of (BEG END)?
;; This is regardless of its current status. It is assumed that (>= POS END).
(defmacro c-will-be-unescaped (beg)
;; Would the character after BEG be unescaped?
`(save-excursion
(let (count)
(goto-char ,beg)
......@@ -2184,14 +2183,14 @@ non-nil, a caret is prepended to invert the set."
(save-excursion ; Needed for XEmacs's byte compiler
(set-buffer buf1)
(add-hook 'after-change-functions
(lambda (beg end old-len) (setq changed t))
(lambda (_beg _end _old-len) (setq changed t))
nil
t)
(set-buffer buf2)
(insert ?c)
(set-buffer buf1)
(remove-hook 'after-change-functions
(lambda (beg end old-len) (setq changed t))
(lambda (_beg _end _old-len) (setq changed t))
t)
(kill-buffer buf1)
(kill-buffer buf2)
......@@ -2706,7 +2705,7 @@ quoted."
(set sym (cons (cons mode value) (symbol-value sym)))
value))))
(defun c-find-assignment-for-mode (source-pos mode match-any-lang name)
(defun c-find-assignment-for-mode (source-pos mode match-any-lang _name)
;; Find the first assignment entry that applies to MODE at or after
;; SOURCE-POS. If MATCH-ANY-LANG is non-nil, entries with `t' as
;; the language list are considered to match, otherwise they don't.
......
......@@ -263,7 +263,7 @@
;; Either nil, or the position of a comment which is open at the end of the
;; macro represented by `c-macro-cache'.
 
(defun c-invalidate-macro-cache (beg end)
(defun c-invalidate-macro-cache (beg _end)
;; Called from a before-change function. If the change region is before or
;; in the macro characterized by `c-macro-cache' etc., nullify it
;; appropriately. BEG and END are the standard before-change-functions
......@@ -1862,8 +1862,8 @@ comment at the start of cc-engine.el for more info."
; (setq in-face (point)))
; (not (eobp)))))))
 
(defmacro c-debug-sws-msg (&rest args)
;;`(message ,@args)
(defmacro c-debug-sws-msg (&rest _args)
;;`(message ,@_args)
)
 
(defmacro c-put-is-sws (beg end)
......@@ -1987,7 +1987,7 @@ comment at the start of cc-engine.el for more info."
(setq c-sws-lit-limits (cons (match-beginning 1)
(match-end 1))))))))))
 
(defun c-invalidate-sws-region-after-del (beg end old-len)
(defun c-invalidate-sws-region-after-del (beg end _old-len)
;; Text has been deleted, OLD-LEN characters of it starting from position
;; BEG. END is typically eq to BEG. Should there have been a comment or
;; CPP construct open at END before the deletion, check whether this
......@@ -2709,7 +2709,7 @@ comment at the start of cc-engine.el for more info."
(if (and (consp elt) (>= (length elt) 3))
;; Inside a string or comment
(let ((depth 0) (containing nil) (last nil)
in-string in-comment (after-quote nil)
in-string in-comment
(min-depth 0) com-style com-str-start (intermediate nil)
(char-1 (nth 3 elt)) ; first char of poss. 2-char construct
(pos (car elt))
......@@ -3028,7 +3028,7 @@ comment at the start of cc-engine.el for more info."
(defun c-full-trim-near-cache ()
;; Remove stale entries in `c-full-lit-near-cache', i.e. those whose END
;; entries, or positions, are above `c-full-near-cache-limit'.
(let ((nc-list c-full-lit-near-cache) elt)
(let ((nc-list c-full-lit-near-cache))
(while nc-list
(let ((elt (car nc-list)))
(if (if (car (cddr elt))
......@@ -5608,7 +5608,7 @@ comment at the start of cc-engine.el for more info."
;; Tools for handling comments and string literals.
 
(defun c-in-literal (&optional lim detect-cpp)
(defun c-in-literal (&optional _lim detect-cpp)
"Return the type of literal point is in, if any.
The return value is `c' if in a C-style comment, `c++' if in a C++
style comment, `string' if in a string literal, `pound' if DETECT-CPP
......@@ -6025,6 +6025,9 @@ comment at the start of cc-engine.el for more info."
(setq c-bs-cache-limit
(min c-bs-cache-limit pos)))
 
(defvar c-restricted-<>-arglists) ;FIXME: Move definition here?
(defvar c-parse-and-markup-<>-arglists) ;FIXME: Move definition here?
(defun c-update-brace-stack (stack from to)
;; Given a brace-stack which has the value STACK at position FROM, update it
;; to its value at position TO, where TO is after (or equal to) FROM.
......@@ -6803,7 +6806,7 @@ comment at the start of cc-engine.el for more info."
c-found-types)
(sort type-list 'string-lessp)))
 
(defun c-trim-found-types (beg end old-len)
(defun c-trim-found-types (beg end _old-len)
;; An after change function which, in conjunction with the info in
;; c-maybe-stale-found-type (set in c-before-change), removes a type
;; from `c-found-types', should this type have become stale. For
......@@ -7522,7 +7525,7 @@ comment at the start of cc-engine.el for more info."
;; This functions is called as an after-change function by virtue of its
;; membership of the C++ value of `c-before-font-lock-functions'.
;; (when (< beg end)
(c-save-buffer-state (found eoll state id found-beg found-end)
(c-save-buffer-state (found eoll state id found-beg)
;; Has an inserted " swallowed up a R"(, turning it into "...R"(?
(goto-char end)
(setq eoll (c-point 'eoll))
......@@ -7640,8 +7643,7 @@ comment at the start of cc-engine.el for more info."
;; entire raw string (when properly terminated) or just the delimiter
;; (otherwise). In either of these cases, return t, otherwise return nil.
;;
(let ((here (point))
in-macro macro-end id Rquote found)
(let (in-macro macro-end)
(when
(and
(eq (char-before (1- (point))) ?R)
......@@ -9386,8 +9388,8 @@ This function might do hidden buffer changes."
maybe-typeless
;; Save the value of kwd-sym between loops of the "Check for a
;; type" loop. Needed to distinguish a C++11 "auto" from a pre
;; C++11 one.
prev-kwd-sym
;; C++11 one. (Commented out, 2020-11-01).
;; prev-kwd-sym
;; If a specifier is found that also can be a type prefix,
;; these flags are set instead of those above. If we need to
;; back up an identifier, they are copied to the real flag
......@@ -9546,7 +9548,7 @@ This function might do hidden buffer changes."
;; specifier keyword and we know we're in a
;; declaration.
(setq at-decl-or-cast t)
(setq prev-kwd-sym kwd-sym)
;; (setq prev-kwd-sym kwd-sym)
 
(goto-char kwd-clause-end))))
 
......@@ -11261,7 +11263,7 @@ comment at the start of cc-engine.el for more info."
(c-syntactic-re-search-forward ";" nil 'move t)))
nil)))
 
(defun c-looking-at-decl-block (containing-sexp goto-start &optional limit)
(defun c-looking-at-decl-block (goto-start &optional limit)
;; Assuming the point is at an open brace, check if it starts a
;; block that contains another declaration level, i.e. that isn't a
;; statement block or a brace list, and if so return non-nil.
......@@ -11274,9 +11276,6 @@ comment at the start of cc-engine.el for more info."
;;
;; The point is clobbered if the check is unsuccessful.
;;
;; CONTAINING-SEXP is the position of the open of the surrounding
;; paren, or nil if none.
;;
;; The optional LIMIT limits the backward search for the start of
;; the construct. It's assumed to be at a syntactically relevant
;; position.
......@@ -11441,9 +11440,7 @@ comment at the start of cc-engine.el for more info."
; *c-looking-at-decl-block
; containing-sexp goto-start &optional
; limit)
(when (and (c-looking-at-decl-block
(c-pull-open-brace paren-state)
nil)
(when (and (c-looking-at-decl-block nil)
(looking-at c-class-key))
(goto-char (match-end 1))
(c-forward-syntactic-ws)
......@@ -11462,9 +11459,7 @@ comment at the start of cc-engine.el for more info."
(save-excursion
(goto-char open-paren-pos)
(when (and (eq (char-after) ?{)
(c-looking-at-decl-block
(c-safe-position open-paren-pos paren-state)
nil))
(c-looking-at-decl-block nil))
(back-to-indentation)
(vector (point) open-paren-pos))))))
 
......@@ -11477,7 +11472,7 @@ comment at the start of cc-engine.el for more info."
(while (and open-brace
(save-excursion
(goto-char open-brace)
(not (c-looking-at-decl-block next-open-brace nil))))
(not (c-looking-at-decl-block nil))))
(setq open-brace next-open-brace
next-open-brace (c-pull-open-brace paren-state)))
open-brace))
......@@ -11795,7 +11790,7 @@ comment at the start of cc-engine.el for more info."
(goto-char (car res))
(c-do-declarators
(point-max) t nil nil
(lambda (id-start id-end tok not-top func init)
(lambda (id-start _id-end _tok _not-top _func _init)
(cond
((> id-start after-type-id-pos)
(throw 'find-decl nil))
......@@ -11885,7 +11880,7 @@ comment at the start of cc-engine.el for more info."
(or accept-in-paren (not (eq (cdr bufpos) 'in-paren)))
(car bufpos))))))
 
(defun c-looking-at-special-brace-list (&optional lim)
(defun c-looking-at-special-brace-list ()
;; If we're looking at the start of a pike-style list, i.e., `({ })',
;; `([ ])', `(< >)', etc., a cons of a cons of its starting and ending
;; positions and its entry in c-special-brace-lists is returned, nil
......@@ -12515,8 +12510,7 @@ comment at the start of cc-engine.el for more info."
(defun c-add-class-syntax (symbol
containing-decl-open
containing-decl-start
containing-decl-kwd
paren-state)
containing-decl-kwd)
;; The inclass and class-close syntactic symbols are added in
;; several places and some work is needed to fix everything.
;; Therefore it's collected here.
......@@ -12565,7 +12559,7 @@ comment at the start of cc-engine.el for more info."
;; CASE B.1: class-open
((save-excursion
(and (eq (char-after) ?{)
(c-looking-at-decl-block containing-sexp t)
(c-looking-at-decl-block t)
(setq beg-of-same-or-containing-stmt (point))))
(c-add-syntax 'class-open beg-of-same-or-containing-stmt))
 
......@@ -12768,10 +12762,7 @@ comment at the start of cc-engine.el for more info."
(goto-char containing-sexp)
(eq (char-after) ?{))
(setq placeholder
(c-looking-at-decl-block
(c-most-enclosing-brace paren-state
containing-sexp)
t)))
(c-looking-at-decl-block t)))
(setq containing-decl-open containing-sexp
containing-decl-start (point)
containing-sexp nil)
......@@ -13013,8 +13004,7 @@ comment at the start of cc-engine.el for more info."
(setq placeholder (c-add-class-syntax 'inclass
containing-decl-open
containing-decl-start
containing-decl-kwd
paren-state))
containing-decl-kwd))
;; Append access-label with the same anchor point as
;; inclass gets.
(c-append-syntax 'access-label placeholder))
......@@ -13086,7 +13076,7 @@ comment at the start of cc-engine.el for more info."
((save-excursion
(let (tmp)
(and (eq char-after-ip ?{)
(setq tmp (c-looking-at-decl-block containing-sexp t))
(setq tmp (c-looking-at-decl-block t))
(progn
(setq placeholder (point))
(goto-char tmp)
......@@ -13107,7 +13097,7 @@ comment at the start of cc-engine.el for more info."
(goto-char indent-point)
(skip-chars-forward " \t")
(and (eq (char-after) ?{)
(c-looking-at-decl-block containing-sexp t)
(c-looking-at-decl-block t)
(setq placeholder (point))))
(c-add-syntax 'class-open placeholder))
 
......@@ -13147,8 +13137,7 @@ comment at the start of cc-engine.el for more info."
(c-add-class-syntax 'inclass
containing-decl-open
containing-decl-start
containing-decl-kwd
paren-state))
containing-decl-kwd))
 
;; CASE 5A.5: ordinary defun open
(t
......@@ -13211,8 +13200,7 @@ comment at the start of cc-engine.el for more info."
(c-add-class-syntax 'inclass
containing-decl-open
containing-decl-start
containing-decl-kwd
paren-state)))
containing-decl-kwd)))
 
;; CASE 5B.4: Nether region after a C++ or Java func
;; decl, which could include a `throws' declaration.
......@@ -13282,8 +13270,7 @@ comment at the start of cc-engine.el for more info."
(c-add-class-syntax 'inclass
containing-decl-open
containing-decl-start
containing-decl-kwd
paren-state)))
containing-decl-kwd)))
 
;; CASE 5C.3: in a Java implements/extends
(injava-inher
......@@ -13469,8 +13456,7 @@ comment at the start of cc-engine.el for more info."
(c-add-class-syntax 'class-close
containing-decl-open
containing-decl-start
containing-decl-kwd
paren-state))
containing-decl-kwd))
 
;; CASE 5H: we could be looking at subsequent knr-argdecls
((and c-recognize-knr-p
......@@ -13591,8 +13577,7 @@ comment at the start of cc-engine.el for more info."
(c-add-class-syntax 'inclass
containing-decl-open
containing-decl-start
containing-decl-kwd
paren-state)))
containing-decl-kwd)))
(when (and c-syntactic-indentation-in-macros
macro-start
(/= macro-start (c-point 'boi indent-point)))
......@@ -13911,7 +13896,7 @@ comment at the start of cc-engine.el for more info."
(save-excursion
(goto-char indent-point)
(c-forward-syntactic-ws (c-point 'eol))
(c-looking-at-special-brace-list (point)))))
(c-looking-at-special-brace-list))))
(c-add-syntax 'brace-entry-open (point))
(c-add-stmt-syntax 'brace-list-entry nil t containing-sexp
paren-state (point))
......@@ -13977,9 +13962,7 @@ comment at the start of cc-engine.el for more info."
(and lim
(progn
(goto-char lim)
(c-looking-at-decl-block
(c-most-enclosing-brace paren-state lim)
nil))
(c-looking-at-decl-block nil))
(setq placeholder (point))))
(c-backward-to-decl-anchor lim)
(back-to-indentation)
......@@ -14147,9 +14130,7 @@ comment at the start of cc-engine.el for more info."
(and (progn
(goto-char placeholder)
(eq (char-after) ?{))
(c-looking-at-decl-block (c-most-enclosing-brace
paren-state (point))
nil))))
(c-looking-at-decl-block nil))))
(c-backward-to-decl-anchor lim)
(back-to-indentation)
(c-add-syntax 'defun-block-intro (point)))
......
......@@ -1104,7 +1104,7 @@ casts and declarations are fontified. Used on level 2 and higher."
limit list not-top
(cond ((eq types t) 'c-decl-type-start)
((null types) 'c-decl-id-start))
(lambda (id-start id-end end-pos not-top is-function init-char)
(lambda (id-start _id-end end-pos _not-top is-function init-char)
(if (eq types t)
;; Register and fontify the identifier as a type.
(let ((c-promote-possible-types t))
......@@ -2530,7 +2530,7 @@ need for `c++-font-lock-extra-types'.")
limit
"[-+]"
nil
(lambda (match-pos inside-macro &optional top-level)
(lambda (_match-pos _inside-macro &optional _top-level)
(forward-char)
(c-font-lock-objc-method))))
nil)
......
......@@ -239,12 +239,12 @@ the evaluated constant value at compile time."
(unless (listp (car-safe ops))
(setq ops (list ops)))
(cond ((eq opgroup-filter t)
(setq opgroup-filter (lambda (opgroup) t)))
(setq opgroup-filter (lambda (_opgroup) t)))
((not (functionp opgroup-filter))
(setq opgroup-filter `(lambda (opgroup)
(memq opgroup ',opgroup-filter)))))
(cond ((eq op-filter t)
(setq op-filter (lambda (op) t)))
(setq op-filter (lambda (_op) t)))
((stringp op-filter)
(setq op-filter `(lambda (op)
(string-match ,op-filter op)))))
......
......@@ -1003,7 +1003,7 @@ Note that the style variables are always made local to the buffer."
(c-clear-char-property-with-value
m-beg (point) 'syntax-table '(1)))))
(defun c-extend-region-for-CPP (beg end)
(defun c-extend-region-for-CPP (_beg _end)
;; Adjust `c-new-BEG', `c-new-END' respectively to the beginning and end of
;; any preprocessor construct they may be in.
;;
......@@ -1027,7 +1027,7 @@ Note that the style variables are always made local to the buffer."
(when (> (point) c-new-END)
(setq c-new-END (min (point) (c-determine-+ve-limit 500 c-new-END)))))
(defun c-depropertize-new-text (beg end old-len)
(defun c-depropertize-new-text (beg end _old-len)
;; Remove from the new text in (BEG END) any and all text properties which
;; might interfere with CC Mode's proper working.
;;
......@@ -1047,7 +1047,7 @@ Note that the style variables are always made local to the buffer."
(c-clear-char-properties beg end 'c-type)
(c-clear-char-properties beg end 'c-awk-NL-prop))))
(defun c-extend-font-lock-region-for-macros (begg endd old-len)
(defun c-extend-font-lock-region-for-macros (_begg endd _old-len)
;; Extend the region (c-new-BEG c-new-END) to cover all (possibly changed)
;; preprocessor macros; The return value has no significance.
;;
......@@ -1094,7 +1094,7 @@ Note that the style variables are always made local to the buffer."
t)
(t nil)))))))
(defun c-neutralize-syntax-in-CPP (begg endd old-len)
(defun c-neutralize-syntax-in-CPP (_begg _endd _old-len)
;; "Neutralize" every preprocessor line wholly or partially in the changed
;; region. "Restore" lines which were CPP lines before the change and are
;; no longer so.
......@@ -1464,7 +1464,7 @@ Note that the style variables are always made local to the buffer."
((and
(c-is-escaped end)
(or (eq beg end) ; .... by inserting stuff between \ and \n?
(c-will-be-unescaped beg end))) ; ... by removing an odd number of \s?
(c-will-be-unescaped beg))) ; ... by removing an odd number of \s?
(goto-char (1+ end))) ; To after the NL which is being unescaped.
(t
(goto-char end)))
......@@ -1776,7 +1776,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
(goto-char (match-beginning 0))
(save-excursion (search-forward "'" (match-end 0) t)))))))))
(defun c-parse-quotes-before-change (beg end)
(defun c-parse-quotes-before-change (_beg _end)
;; This function analyzes 's near the region (c-new-BEG c-new-END), amending
;; those two variables as needed to include 's into that region when they
;; might be syntactically relevant to the change in progress.
......@@ -1876,7 +1876,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
'c-digit-separator t
?')))))
(defun c-parse-quotes-after-change (beg end old-len)
(defun c-parse-quotes-after-change (_beg _end _old-len)
;; This function applies syntax-table properties (value '(1)) and
;; c-digit-separator properties as needed to 's within the range (c-new-BEG
;; c-new-END). This operation is performed even within strings and
......@@ -2283,7 +2283,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
(c-backward-syntactic-ws)
(point)))))))))
(defun c-change-expand-fl-region (beg end old-len)
(defun c-change-expand-fl-region (_beg _end _old-len)
;; Expand the region (c-new-BEG c-new-END) to an after-change font-lock
;; region. This will usually be the smallest sequence of whole lines
;; containing `c-new-BEG' and `c-new-END', but if `c-new-BEG' is in a
......@@ -2427,7 +2427,7 @@ This function is called from `c-common-init', once per mode initialization."
(add-hook 'font-lock-mode-hook 'c-after-font-lock-init nil t))
;; Emacs 22 and later.
(defun c-extend-after-change-region (beg end old-len)
(defun c-extend-after-change-region (beg end _old-len)
"Extend the region to be fontified, if necessary."