Computer Chess Club Archives


Search

Terms

Messages

Subject: msvc Warning : unreferenced inline function removed (ot)

Author: Georg v. Zimmermann

Date: 07:33:37 12/28/01


Hi,

using MSVC and setting warnings to level 4 I get flooded by the Compiler Warning
(level 4) C4514.

This happens since I have some structures (see below for example) that are used
in almost all source files, but where only part of the functions are used in
each.

What is the correct/clean way to avoid this problem ? I hate to just turn off
warnings. Thanks for any advice.

Regards,
Georg

/* move is Sunsetter's way of reperesenting a move.

   It is a 32 bit value in the following format:
   6 bits -> from square
   2 bits -> padding
   6 bits -> to square
   2 bits -> padding
   3 bits -> the piece that moved
   3 bits -> piece to promote to (if any)
   1 bit  -> if the move was en passant
   1 bit  -> if the move is no good (i.e. the value of the hashMove when
                                     there isn't a hash move)
*/

struct move {
  private:

  duword data;

  public:
  move(square f, square t, piece mp, piece p) { data = f | (t << 8) |
                    (mp << 16) | (p << 19); };
  move(square f, square t, piece mp) { data = f | (t << 8) | (mp << 16); };
  move()                    {};

  int operator ==(move m)   { return data == m.data; };
  int operator !=(move m)   { return data != m.data; };
  square from()             { return (square) data & 0xFF; };
  square to()               { return (square) (data >> 8) & 0xFF; };
  piece moved()             { return (piece) ((data >> 16) & 7); };
  piece promotion()         { return (piece) ((data >> 19) & 7); };
  int isBad()               { return data >> 23; };
  void makeBad()            { data |= 1 << 23; };
};



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.