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

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

[elpa] externals/chess 6d14e58: Fix use of CL types


From: Stefan Monnier
Subject: [elpa] externals/chess 6d14e58: Fix use of CL types
Date: Sat, 19 Sep 2020 17:22:32 -0400 (EDT)

branch: externals/chess
commit 6d14e5800dba2ab3e3995867209dc24ebac0fe3f
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Fix use of CL types
    
    * chess-game.el (chess-game-add-ply): `listp` is not a type.
    * chess-network.el (chess-full-name): Silence compiler warnings.
    * chess-pos.el (chess-pos): Define as type before use in `cl-typep`.
---
 chess-game.el    | 4 ++--
 chess-network.el | 4 +++-
 chess-pos.el     | 4 +++-
 chess-uci.el     | 5 +++--
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/chess-game.el b/chess-game.el
index 06b99fb..c0b6079 100644
--- a/chess-game.el
+++ b/chess-game.el
@@ -1,6 +1,6 @@
 ;;; chess-game.el --- Maintain a chess game that is being played or viewed
 
-;; Copyright (C) 2002, 2004, 2014  Free Software Foundation, Inc.
+;; Copyright (C) 2002-2020  Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Maintainer: Mario Lang <mlang@delysid.org>
@@ -231,7 +231,7 @@ If INDEX is nil, the last played ply is returned."
 (defun chess-game-add-ply (game ply)
   "Add PLY to the main variation of GAME."
   (cl-assert game)
-  (cl-check-type ply listp)
+  (cl-check-type ply list)
   (let ((plies (chess-game-plies game)))
     (if plies
        (nconc plies (list ply))
diff --git a/chess-network.el b/chess-network.el
index 16f7aa7..4d51666 100644
--- a/chess-network.el
+++ b/chess-network.el
@@ -1,6 +1,6 @@
 ;;; chess-network.el --- Play against an opponent over the network
 
-;; Copyright (C) 2002, 2003, 2008  Free Software Foundation, Inc.
+;; Copyright (C) 2002-2020  Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Maintainer: Mario Lang <mlang@delysid.org>
@@ -127,6 +127,8 @@
 (defvar chess-network-kind)
 (make-variable-buffer-local 'chess-network-kind)
 
+(defvar chess-full-name)
+
 (defun chess-network-handler (game event &rest args)
   "Initialize the network chess engine."
   (unless chess-engine-handling-event
diff --git a/chess-pos.el b/chess-pos.el
index 732893d..4416766 100644
--- a/chess-pos.el
+++ b/chess-pos.el
@@ -1,6 +1,6 @@
 ;;; chess-pos.el --- Routines for manipulating chess positions
 
-;; Copyright (C) 2002, 2004, 2014  Free Software Foundation, Inc.
+;; Copyright (C) 2002-2020  Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Maintainer: Mario Lang <mlang@delysid.org>
@@ -131,6 +131,8 @@ This variable automatically becomes buffer-local when 
changed.")
   "Return non-nil if POSITION is a chess position object."
   (and (vectorp position) (= (length position) 75)))
 
+(cl-deftype chess-pos () '(satisfies chess-pos-p))
+
 (chess-message-catalog 'english
   '((chess-nag-1   . "good move [traditional \"!\"]")
     (chess-nag-2   . "poor move [traditional \"?\"]")
diff --git a/chess-uci.el b/chess-uci.el
index f54e9c0..e10e133 100644
--- a/chess-uci.el
+++ b/chess-uci.el
@@ -1,6 +1,6 @@
 ;;; chess-uci.el --- Common functions for the Universal Chess Interface 
protocol
 
-;; Copyright (C) 2014  Free Software Foundation, Inc.
+;; Copyright (C) 2014-2020  Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Keywords: games, processes
@@ -50,7 +50,8 @@
               (if (and (= from (chess-pos-king-index position color))
                        (= (chess-index-rank from) (chess-index-rank to))
                        (> (abs (- (chess-index-file from)
-                                  (chess-index-file to))) 1))
+                                  (chess-index-file to)))
+                          1))
                   (chess-ply-castling-changes
                    position
                    (< (- (chess-index-file to) (chess-index-file from)) 0))



reply via email to

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