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

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

[elpa] externals/web-server 4d865cc 6/8: Silence warnings


From: Stefan Monnier
Subject: [elpa] externals/web-server 4d865cc 6/8: Silence warnings
Date: Sat, 27 Mar 2021 14:45:27 -0400 (EDT)

branch: externals/web-server
commit 4d865cc4720f668aed7a8c3bcfddfbf534ecfb67
Author: Brian Leung <leungbk@mailfence.com>
Commit: Eric Schulte <eric.schulte@gmx.com>

    Silence warnings
---
 web-server.el | 35 +++++++++++++++++------------------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/web-server.el b/web-server.el
index 1474bf9..9cf14e8 100644
--- a/web-server.el
+++ b/web-server.el
@@ -47,7 +47,6 @@
 (require 'mm-encode)              ; to look-up mime types for files
 (require 'url-util)               ; to decode url-encoded params
 (require 'eieio)
-(eval-when-compile (require 'cl))
 (require 'cl-lib)
 
 (defclass ws-server ()
@@ -138,7 +137,7 @@ function.
                         (goto-char (point-max))
                         (insert (format "%s\t%s\t%s\t%s"
                                         (format-time-string ws-log-time-format)
-                                        (first c) (second c) message))))))
+                                        (cl-first c) (cl-second c) 
message))))))
            network-args))
     (push server ws-servers)
     server))
@@ -163,7 +162,7 @@ function.
 
 (defun ws-parse-query-string (string)
   "Thin wrapper around `url-parse-query-string'."
-  (mapcar (lambda (pair) (cons (first pair) (second pair)))
+  (mapcar (lambda (pair) (cons (cl-first pair) (cl-second pair)))
           (url-parse-query-string string nil 'allow-newlines)))
 
 (defun ws-parse (proc string)
@@ -185,7 +184,7 @@ function.
             (credentials (match-string 2 string)))
         (list (cons :AUTHORIZATION
                     (cons protocol
-                          (case protocol
+                          (cl-case protocol
                             (:BASIC
                              (let ((cred (base64-decode-string credentials)))
                                (if (string-match ":" cred)
@@ -270,7 +269,7 @@ Return non-nil only when parsing is complete."
                               ;; Trim off the additional CRLF
                               (substring after-headers 2))))
                     (setq body-stored t))
-                  (case context
+                  (cl-case context
                     ;; Parse URL data.
                     ;; http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4
                     (application/x-www-form-urlencoded
@@ -344,7 +343,7 @@ Return non-nil only when parsing is complete."
         (goto-char (point-max))
         (insert (format "%s\t%s\t%s\tWS-ERROR: %s"
                         (format-time-string ws-log-time-format)
-                        (first c) (second c)
+                        (cl-first c) (cl-second c)
                         (apply #'format msg args)))))
     (apply #'ws-send-500 proc msg args)))
 
@@ -456,13 +455,13 @@ See RFC6455."
                     (let ((place 0))
                       (apply #'+
                        (mapcar (lambda (bit)
-                                 (prog1 (if bit (expt 2 place) 0) (incf 
place)))
+                                 (prog1 (if bit (expt 2 place) 0) (cl-incf 
place)))
                                (reverse bits)))))
                   (bits (length)
                     (apply #'append
                            (mapcar (lambda (int) (int-to-bits int 8))
                                    (cl-subseq
-                                    pending index (incf index length))))))
+                                    pending index (cl-incf index length))))))
         (let (fin rsvs opcode mask pl mask-key)
           ;; Parse fin bit, rsvs bits and opcode
           (let ((byte (bits 1)))
@@ -470,7 +469,7 @@ See RFC6455."
                   rsvs (cl-subseq byte 1 4)
                   opcode
                   (let ((it (bits-to-int (cl-subseq byte 4))))
-                    (case it
+                    (cl-case it
                       (0 :CONTINUATION)
                       (1 :TEXT)
                       (2 :BINARY)
@@ -498,7 +497,7 @@ See RFC6455."
            ((= pl 126) (setq pl (bits-to-int (bits 2))))
            ((= pl 127) (setq pl (bits-to-int (bits 8)))))
           ;; unmask data
-          (when mask (setq mask-key (cl-subseq pending index (incf index 4))))
+          (when mask (setq mask-key (cl-subseq pending index (cl-incf index 
4))))
           (setq data (concat data
                              (ws-web-socket-mask
                               mask-key (cl-subseq pending index (+ index 
pl)))))
@@ -521,7 +520,7 @@ See RFC6455."
   "Frame STRING for web socket communication."
   (let* ((fin 1) ;; set to 0 if not final frame
          (len (length string))
-         (opcode (ecase (or opcode :TEXT) (:TEXT 1) (:BINARY 2))))
+         (opcode (cl-ecase (or opcode :TEXT) (:TEXT 1) (:BINARY 2))))
     ;; Does not do any masking which is only required of client communication
     (concat
      (cond
@@ -587,7 +586,7 @@ compressed using the command specified in `ws-gzip-cmd'."
       (set-process-plist proc
         (append
          (list :content-encoding
-               (ecase (intern content)
+               (cl-ecase (intern content)
                  ((compress x-compress) (ws-encoding-cmd-to-fn 
ws-compress-cmd))
                  ((deflate x-deflate)   (ws-encoding-cmd-to-fn ws-deflate-cmd))
                  ((gzip x-gzip)         (ws-encoding-cmd-to-fn ws-gzip-cmd))
@@ -601,7 +600,7 @@ compressed using the command specified in `ws-gzip-cmd'."
         (append
          (when (string= transfer "chunked") (list :ender "0\r\n\r\n"))
          (list :transfer-encoding
-               (ecase (intern transfer)
+               (cl-ecase (intern transfer)
                  (chunked  #'ws-chunk)
                  ((compress x-compress) (ws-encoding-cmd-to-fn 
ws-compress-cmd))
                  ((deflate x-deflate)   (ws-encoding-cmd-to-fn ws-deflate-cmd))
@@ -696,11 +695,11 @@ challenge.  Optional arguments UNAUTH and INVALID should 
be
 functions which are called on the request when no authentication
 information, or invalid authentication information are provided
 respectively."
-  (lexical-let ((handler handler)
-                (credentials credentials)
-                (realm realm)
-                (unauth unauth)
-                (invalid invalid))
+  (let ((handler handler)
+        (credentials credentials)
+        (realm realm)
+        (unauth unauth)
+        (invalid invalid))
     (lambda (request)
       (with-slots (process headers) request
         (let ((auth (cddr (assoc :AUTHORIZATION headers))))



reply via email to

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