Fix compiler warnings

This commit is contained in:
Quinten Kock 2020-06-20 02:32:10 +02:00
parent 9184324a7f
commit fd1158c0c8
3 changed files with 4 additions and 5 deletions

View File

@ -216,7 +216,6 @@ void make(Move m) {
} }
// are we promoting? // are we promoting?
byte new_val = m.pc_prom & 0b1111;
if(m.pc_prom != P_EMPTY) { if(m.pc_prom != P_EMPTY) {
// promoting; indicate this in the sq_to byte in unmove. // promoting; indicate this in the sq_to byte in unmove.
field[m.sq_to] = m.pc_prom; field[m.sq_to] = m.pc_prom;

View File

@ -4,8 +4,8 @@
#include "Types.h" #include "Types.h"
#include "Move.h" #include "Move.h"
const static byte SLIDE_OFFSETS[] = {-1, 1, -16, 16, 15, 17, -15, -17}; const static byte SLIDE_OFFSETS[] = {255, 1, 240, 16, 15, 17, 241, 239};
const static byte KNIGHT_OFFSETS[] = {-31, 31, -33, 33, -18, 18, -14, 14}; const static byte KNIGHT_OFFSETS[] = {225, 31, 223, 33, 238, 18, 242, 14};
#define INVALID_MOVE Move{0xFF, 0xFF, P_EMPTY} #define INVALID_MOVE Move{0xFF, 0xFF, P_EMPTY}
@ -136,7 +136,7 @@ Move Movegen::generate_pawn() {
offset = color ? -0x10 : 0x10; offset = color ? -0x10 : 0x10;
target_square = square + offset; target_square = square + offset;
if(field[target_square] || if(field[target_square] ||
(square & 0x70) == (color ? 0x10 : 0x60) (square & 0x70) == (color ? 0x10 : 0x60)
) { ) {
// moving ahead is not possible, not even a capture! // moving ahead is not possible, not even a capture!
// this is either due to a blockade or a pending promotion // this is either due to a blockade or a pending promotion

View File

@ -1,7 +1,7 @@
#ifndef __TYPES_H_INC #ifndef __TYPES_H_INC
#define __TYPES_H_INC #define __TYPES_H_INC
#include "Config.h"" #include "Config.h"
#ifdef _ACF_DEBUG_PRINT #ifdef _ACF_DEBUG_PRINT
#define DEBUG(x) Serial.println(F(x)); Serial.flush() #define DEBUG(x) Serial.println(F(x)); Serial.flush()