fix style warning
authorKevin Rosenberg <kevin@rosenberg.net>
Sun, 18 Jan 2009 03:48:39 +0000 (20:48 -0700)
committerKevin Rosenberg <kevin@rosenberg.net>
Sun, 18 Jan 2009 03:48:39 +0000 (20:48 -0700)
color.lisp
sockets.lisp

index b18bd2d00df115ff22f15408165e38426e0549b1..52d5b46f1fd5c4b13ea366073bee62300e94c9f4 100644 (file)
       (setq s (/ delta max)))
 
     (when (plusp delta)
       (setq s (/ delta max)))
 
     (when (plusp delta)
-      (setq h (cond
-               ((= max r)
-                (nth-value 0 (/ (- g b) delta)))
-               ((= max g)
-                (nth-value 0 (+ 2 (/ (- b r) delta))))
-               (t
-                (nth-value 0 (+ 4 (/ (- r g) delta))))))
-      (setq h (the fixnum (* 60 h)))
+      (setq h (* 60  (cond
+                       ((= max r) (/ (- g b) delta))
+                       ((= max g) (+ 2 (/ (- b r) delta)))
+                       (t (+ 4 (/ (- r g) delta))))))
       (when (minusp h)
         (incf h 360)))
 
       (when (minusp h)
         (incf h 360)))
 
              (type (or null fixnum) h))
 
     (when (plusp max)
              (type (or null fixnum) h))
 
     (when (plusp max)
-      (setq s (truncate (the fixnum (* 255 delta)) max)))
+      (setq s (round (the fixnum (* 255 delta)) max)))
 
     (when (plusp delta)
       (setq h (cond
                ((= max r)
 
     (when (plusp delta)
       (setq h (cond
                ((= max r)
-                (truncate (the fixnum (* 60 (the fixnum (- g b)))) delta))
+                (round (the fixnum (* 60 (the fixnum (- g b)))) delta))
                ((= max g)
                 (the fixnum
                ((= max g)
                 (the fixnum
-                     (+ 120 (truncate (the fixnum (* 60 (the fixnum (- b r)))) delta))))
+                     (+ 120 (round (the fixnum (* 60 (the fixnum (- b r)))) delta))))
                (t
                 (the fixnum
                (t
                 (the fixnum
-                     (+ 240 (truncate (the fixnum (* 60 (the fixnum (- r g)))) delta))))))
+                     (+ 240 (round (the fixnum (* 60 (the fixnum (- r g)))) delta))))))
       (when (minusp h)
         (incf h 360)))
 
       (when (minusp h)
         (incf h 360)))
 
index dc8965cc4e91374cf84f5f376ce478a8ee55183a..c8c9b58df0aaa6463e0dbc7b075d2afd895aa51a 100644 (file)
@@ -22,6 +22,7 @@
 (defun listen-to-inet-port (&key (port 0) (kind :stream) (reuse nil))
   "Create, bind and listen to an inet socket on *:PORT.
 setsockopt SO_REUSEADDR if :reuse is not nil"
 (defun listen-to-inet-port (&key (port 0) (kind :stream) (reuse nil))
   "Create, bind and listen to an inet socket on *:PORT.
 setsockopt SO_REUSEADDR if :reuse is not nil"
+  (declare (ignore kind))
   (let ((socket (make-instance 'sb-bsd-sockets:inet-socket
                                :type :stream
                                :protocol :tcp)))
   (let ((socket (make-instance 'sb-bsd-sockets:inet-socket
                                :type :stream
                                :protocol :tcp)))