summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2014-04-02 01:37:37 +0200
committerMario Lang <mlang@delysid.org>2014-04-02 01:37:37 +0200
commitad80cdf9b05c79febe5b1e27362d0612bce1de0b (patch)
tree4bcd6797d44a7118fa4d7da91252e7852de9b6c4
parenta1dfd57a807d30ea2fb33c4a1c0608f29f00bfbd (diff)
Eliminate a few compiler warnings due to missing require or cl runtime use.
-rw-r--r--chess-autosave.el1
-rw-r--r--chess-game.el2
-rw-r--r--chess-ics.el2
-rw-r--r--chess-input.el4
-rw-r--r--chess-kibitz.el2
-rw-r--r--chess-module.el3
-rw-r--r--chess-ply.el3
-rw-r--r--chess-polyglot.el18
-rw-r--r--chess-tutorial.el1
9 files changed, 27 insertions, 9 deletions
diff --git a/chess-autosave.el b/chess-autosave.el
index 52526e9..96dbdf2 100644
--- a/chess-autosave.el
+++ b/chess-autosave.el
@@ -6,6 +6,7 @@
(require 'chess-game)
(require 'chess-database)
(require 'chess-message)
+(require 'chess-module)
(defgroup chess-autosave nil
"A special display that autosaves after each move."
diff --git a/chess-game.el b/chess-game.el
index 910a244..2b0d811 100644
--- a/chess-game.el
+++ b/chess-game.el
@@ -8,6 +8,8 @@
;; A chess game is represented by a set of tags that describe the
;; game, and a list of plies representing the main variation.
+(eval-when-compile
+ (require 'cl))
(require 'chess-ply)
(require 'chess-pgn)
diff --git a/chess-ics.el b/chess-ics.el
index 413dd6c..92fa885 100644
--- a/chess-ics.el
+++ b/chess-ics.el
@@ -409,7 +409,7 @@ See `chess-ics-game'.")
(defun chess-ics-game (game-number &rest tags)
"Either create, or retrieve an existing game object with GAME-NUMBER."
(assert (integerp game-number))
- (assert (or (evenp (length tags)) (eq (car tags) t)))
+ (assert (or (zerop (logand (length tags) 1)) (eq (car tags) t)))
(or
;; First try to find a game which matches the constraints in TAGS
(catch 'ics-game
diff --git a/chess-input.el b/chess-input.el
index 200b272..2a9b63f 100644
--- a/chess-input.el
+++ b/chess-input.el
@@ -7,6 +7,10 @@
;; only way to move your pieces around!
;;
+(require 'chess-algebraic)
+(require 'chess-ply)
+(require 'chess-pos)
+
(defvar chess-input-move-string "")
(defvar chess-input-moves-pos nil)
(defvar chess-input-moves nil)
diff --git a/chess-kibitz.el b/chess-kibitz.el
index 96651fd..07b5600 100644
--- a/chess-kibitz.el
+++ b/chess-kibitz.el
@@ -4,6 +4,8 @@
;; viewed or played. C-c C-c is used to save a kibitzing comment.
;;
+(require 'chess-game)
+
(defvar chess-kibitz-input-last nil)
(defvar chess-kibitz-index nil)
diff --git a/chess-module.el b/chess-module.el
index f29dff2..a4263c9 100644
--- a/chess-module.el
+++ b/chess-module.el
@@ -3,6 +3,9 @@
;; Basic module support code underlying all chess.el modules
;;
+(eval-when-compile
+ (require 'cl))
+
(require 'chess-game)
(defvar chess-module-game nil)
diff --git a/chess-ply.el b/chess-ply.el
index a4463a5..ad9423c 100644
--- a/chess-ply.el
+++ b/chess-ply.el
@@ -43,6 +43,9 @@
;;; Code:
+(eval-when-compile
+ (require 'cl))
+
(require 'chess-pos)
(require 'chess-algebraic)
diff --git a/chess-polyglot.el b/chess-polyglot.el
index c124621..b23e0ab 100644
--- a/chess-polyglot.el
+++ b/chess-polyglot.el
@@ -41,7 +41,7 @@
;;; Code:
-(eval-when-compile (require 'cl-lib))
+(require 'cl-lib)
(require 'chess-ply)
(require 'chess-pos)
@@ -118,7 +118,8 @@ On reaching end or beginning of buffer, stop and signal error."
(defun chess-polyglot-read-moves (key)
"Read all moves associated with KEY from the current buffer."
- (cl-assert (= (% (buffer-size) chess-polyglot-record-size) 0))
+ (cl-assert (zerop (% (buffer-size) chess-polyglot-record-size)))
+ ;; Find leftmost entry.
(let ((left 0) (right (1- (/ (buffer-size) chess-polyglot-record-size))))
(while (< left right)
(let ((middle (/ (+ left right) 2)))
@@ -127,12 +128,13 @@ On reaching end or beginning of buffer, stop and signal error."
(setq right middle)
(setq left (1+ middle)))))
(cl-assert (= left right))
- (chess-polyglot-goto-record left)
- (let ((moves ()))
- (while (equal key (chess-polyglot-read-key))
- (setq moves (nconc moves (list (chess-polyglot-read-move))))
- (chess-polyglot-skip-learn))
- moves)))
+ (chess-polyglot-goto-record left))
+ ;; Read all entries with equal keys.
+ (let ((moves ()))
+ (while (equal key (chess-polyglot-read-key))
+ (setq moves (nconc moves (list (chess-polyglot-read-move))))
+ (chess-polyglot-skip-learn))
+ moves))
(defconst chess-polyglot-zorbist-keys
[(2637767806 . 863464769) (720845184 . 95069639) (1155203408 . 610415943)
diff --git a/chess-tutorial.el b/chess-tutorial.el
index cfa0a01..0875bca 100644
--- a/chess-tutorial.el
+++ b/chess-tutorial.el
@@ -3,6 +3,7 @@
;; A special kind of display that merely autosaves the game
;;
+(require 'chess-display)
(require 'chess-game)
(chess-message-catalog 'english