Merge from origin/emacs-26
134edc1
Warn about wrong number of args for subrs (Bug#35767)5f01af6
Use plain symbols for eieio type descriptors (Bug#29220)4b24b01
Pacify GCC 9 -Wredundant-decls
This commit is contained in:
commit
7e911d007d
6 changed files with 48 additions and 19 deletions
|
@ -1401,7 +1401,7 @@ when printing the error message."
|
|||
(defun byte-compile-callargs-warn (form)
|
||||
(let* ((def (or (byte-compile-fdefinition (car form) nil)
|
||||
(byte-compile-fdefinition (car form) t)))
|
||||
(sig (byte-compile--function-signature def))
|
||||
(sig (byte-compile--function-signature (or def (car form))))
|
||||
(ncall (length (cdr form))))
|
||||
;; Check many or unevalled from subr-arity.
|
||||
(if (and (cdr-safe sig)
|
||||
|
|
|
@ -117,9 +117,6 @@ Currently under control of this var:
|
|||
(defsubst eieio--object-class-tag (obj)
|
||||
(aref obj 0))
|
||||
|
||||
(defsubst eieio--object-class (obj)
|
||||
(eieio--object-class-tag obj))
|
||||
|
||||
|
||||
;;; Important macros used internally in eieio.
|
||||
|
||||
|
@ -132,6 +129,12 @@ Currently under control of this var:
|
|||
(or (cl--find-class class) class)
|
||||
class))
|
||||
|
||||
(defsubst eieio--object-class (obj)
|
||||
(let ((tag (eieio--object-class-tag obj)))
|
||||
(if eieio-backward-compatibility
|
||||
(eieio--class-object tag)
|
||||
tag)))
|
||||
|
||||
(defun class-p (x)
|
||||
"Return non-nil if X is a valid class vector.
|
||||
X can also be is a symbol."
|
||||
|
@ -163,7 +166,7 @@ Return nil if that option doesn't exist."
|
|||
(defun eieio-object-p (obj)
|
||||
"Return non-nil if OBJ is an EIEIO object."
|
||||
(and (recordp obj)
|
||||
(eieio--class-p (eieio--object-class-tag obj))))
|
||||
(eieio--class-p (eieio--object-class obj))))
|
||||
|
||||
(define-obsolete-function-alias 'object-p 'eieio-object-p "25.1")
|
||||
|
||||
|
|
|
@ -710,6 +710,9 @@ calls `initialize-instance' on that object."
|
|||
;; Call the initialize method on the new object with the slots
|
||||
;; that were passed down to us.
|
||||
(initialize-instance new-object slots)
|
||||
(when eieio-backward-compatibility
|
||||
;; Use symbol as type descriptor, for backwards compatibility.
|
||||
(aset new-object 0 class))
|
||||
;; Return the created object.
|
||||
new-object))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue