emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/xelb 9a0612c 41/42: Fix remaining compile warnings


From: Chris Feng
Subject: [elpa] externals/xelb 9a0612c 41/42: Fix remaining compile warnings
Date: Thu, 17 Sep 2015 23:16:52 +0000

branch: externals/xelb
commit 9a0612c905ec74aff1627f1cc290f7014bd42f23
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    Fix remaining compile warnings
    
    * el_client.el (parse): remove a warning concerning pp-escape-newlines
    * xcb_types.el: remove warnings about the backward-compatible code
    * xcb.el: autoload xcb:connection and xcb:-error-or-event-class->number
---
 el_client.el |    1 +
 xcb-types.el |   44 +++++++++++++++++++++++---------------------
 xcb.el       |    2 ++
 3 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/el_client.el b/el_client.el
index d9b81c3..b662caa 100644
--- a/el_client.el
+++ b/el_client.el
@@ -116,6 +116,7 @@ an `xelb-auto-padding' attribute."
   "Parse an XCB protocol description file FILE (XML)."
   (let ((pp-escape-newlines nil)        ;do not escape newlines
         result header)
+    (cl-assert (not pp-escape-newlines)) ;only to remove a compile warning
     (with-temp-buffer
       (insert-file-contents file)
       (setq result (libxml-parse-xml-region (point-min) (point-max) nil t))
diff --git a/xcb-types.el b/xcb-types.el
index e093e7a..5233c54 100644
--- a/xcb-types.el
+++ b/xcb-types.el
@@ -56,27 +56,29 @@
 
 ;; The `cl-generic' package on ELPA does not solve all problems
 
-(unless (fboundp 'cl-defmethod)
-  (defalias 'cl-defmethod 'defmethod))
-
-(unless (fboundp 'cl-call-next-method)
-  (defalias 'cl-call-next-method 'call-next-method))
-
-(unless (fboundp 'eieio-class-slots)
-  (defun eieio-class-slots (class)
-    (let* ((tmp (class-v class))
-           (names (eieio--class-public-a tmp))
-           (initforms (eieio--class-public-d tmp))
-           (types (eieio--class-public-type tmp))
-           result)
-      (dotimes (i (length names))
-        (setq result (nconc result (list (vector (elt names i)
-                                                 (elt initforms i)
-                                                 (elt types i))))))
-      result))
-  (defsubst cl--slot-descriptor-name (slot) (aref slot 0))
-  (defsubst cl--slot-descriptor-initform (slot) (aref slot 1))
-  (defsubst cl--slot-descriptor-type (slot) (aref slot 2)))
+(eval-and-compile
+  (unless (fboundp 'cl-defmethod)
+    (defalias 'cl-defmethod 'defmethod))
+
+  (unless (fboundp 'cl-call-next-method)
+    (defalias 'cl-call-next-method 'call-next-method))
+
+  (unless (fboundp 'eieio-class-slots)
+    (eval-and-compile
+      (defun eieio-class-slots (class)
+        (let* ((tmp (class-v class))
+               (names (eieio--class-public-a tmp))
+               (initforms (eieio--class-public-d tmp))
+               (types (eieio--class-public-type tmp))
+               result)
+          (dotimes (i (length names))
+            (setq result (nconc result (list (vector (elt names i)
+                                                     (elt initforms i)
+                                                     (elt types i))))))
+          result))
+      (defsubst cl--slot-descriptor-name (slot) (aref slot 0))
+      (defsubst cl--slot-descriptor-initform (slot) (aref slot 1))
+      (defsubst cl--slot-descriptor-type (slot) (aref slot 2)))))
 
 ;;;; Utility functions
 
diff --git a/xcb.el b/xcb.el
index eaa1c76..8f96c5d 100644
--- a/xcb.el
+++ b/xcb.el
@@ -72,6 +72,7 @@
 
 ;;;; X connection related
 
+;;;###autoload
 (defclass xcb:connection ()
   ((process :initarg :process)
    (connected :initform nil)  ;non-nil indicates connected to X server
@@ -636,6 +637,7 @@ Sync by sending a GetInputFocus request and waiting until 
it's processed."
         (accept-process-output process 1 nil 1)))
     (cl-decf (slot-value obj 'event-lock))))
 
+;;;###autoload
 (cl-defmethod xcb:-error-or-event-class->number ((obj xcb:connection) class)
   "Return the error/event number of a error/event class CLASS."
   (unless (symbolp class) (setq class (eieio-class-name class)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]