Module Name:    src
Committed By:   joerg
Date:           Wed Feb 29 23:39:53 UTC 2012

Modified Files:
        src/games/dab: algor.cc board.h

Log Message:
Fix various format string mismatches.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/games/dab/algor.cc
cvs rdiff -u -r1.3 -r1.4 src/games/dab/board.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/dab/algor.cc
diff -u src/games/dab/algor.cc:1.4 src/games/dab/algor.cc:1.5
--- src/games/dab/algor.cc:1.4	Mon Apr 28 20:22:53 2008
+++ src/games/dab/algor.cc	Wed Feb 29 23:39:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: algor.cc,v 1.4 2008/04/28 20:22:53 martin Exp $	*/
+/*	$NetBSD: algor.cc,v 1.5 2012/02/29 23:39:53 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  * algor.C: Computer algorithm
  */
 #include "defs.h"
-RCSID("$NetBSD: algor.cc,v 1.4 2008/04/28 20:22:53 martin Exp $")
+RCSID("$NetBSD: algor.cc,v 1.5 2012/02/29 23:39:53 joerg Exp $")
 
 #include "algor.h"
 #include "board.h"
@@ -65,7 +65,7 @@ int ALGOR::find_closure(size_t& y, size_
 		for (dir = BOX::first; dir < BOX::last; dir++)
 		    if (!box.isset(dir))
 			return 1;
-		b.abort("find_closure: 3 sided box[%d,%d] has no free sides",
+		b.abort("find_closure: 3 sided box[%zu,%zu] has no free sides",
 			y, x);
 	    }
 	}
@@ -112,7 +112,7 @@ size_t ALGOR::count_closure(size_t& y, s
 	    dir = tdir;
 	}
 	if ((mv = b.domove(ty, tx, tdir, getWho())) == -1)
-	    b.abort("count_closure: Invalid move (%d, %d, %d)", y, x, dir);
+	    b.abort("count_closure: Invalid move (%zu, %zu, %d)", y, x, dir);
 	else
 	    i += mv;
     }
@@ -157,7 +157,7 @@ int ALGOR::try_good_turn(BOX& box, size_
 {
     // Sanity check; we must have a good box
     if (box.count() >= 2)
-	b.abort("try_good_turn: box[%d,%d] has more than 2 sides occupied",
+	b.abort("try_good_turn: box[%zu,%zu] has more than 2 sides occupied",
 		y, x);
 
     // Make sure we don't make a closure in an adjacent box.
@@ -203,7 +203,7 @@ int ALGOR::try_bad_turn(BOX& box, size_t
 			int last)
 {
     if (4 - box.count() <= last)
-	b.abort("try_bad_turn: Called at [%d,%d] for %d with %d",
+	b.abort("try_bad_turn: Called at [%zu,%zu] for %d with %d",
 		y, x, last, box.count());
     for (dir = BOX::first; dir < BOX::last; dir++)
 	if (!box.isset(dir)) {
@@ -246,7 +246,7 @@ size_t ALGOR::find_min_closure1(size_t& 
 
         // Play a bad move that would cause the opponent's closure
 	if ((mv = nb.domove(ty, tx, tdir, getWho())) != 0)
-	    b.abort("find_min_closure1: Invalid move %d (%d, %d, %d)", mv,
+	    b.abort("find_min_closure1: Invalid move %d (%zu, %zu, %d)", mv,
 		    ty, tx, tdir);
 
         // Count the opponent's closure

Index: src/games/dab/board.h
diff -u src/games/dab/board.h:1.3 src/games/dab/board.h:1.4
--- src/games/dab/board.h:1.3	Mon Aug 29 20:30:37 2011
+++ src/games/dab/board.h	Wed Feb 29 23:39:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: board.h,v 1.3 2011/08/29 20:30:37 joerg Exp $	*/
+/*	$NetBSD: board.h,v 1.4 2012/02/29 23:39:53 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -72,7 +72,8 @@ class BOARD {
     void games(size_t i, const PLAYER& p);		// Post games
     void total(size_t i, const PLAYER& p);		// Post totals
     void ties(const PLAYER& p);				// Post ties
-    __dead void abort(const char *s, ...) const;	// Algorithm error
+    __printflike(2, 3) __dead
+    void abort(const char *s, ...) const;		// Algorithm error
 
 
   private:

Reply via email to