This file is indexed.

/usr/include/osl/simpleState.tcc is in libosl-dev 0.8.0-1.4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/* simpleState.tcc
 */
#ifndef OSL_SIMPLE_STATE_TCC
#define OSL_SIMPLE_STATE_TCC

#include "osl/simpleState.h"
#include <iostream>

template <bool show_error>
bool osl::SimpleState::isAlmostValidDrop(Move move) const
{
  assert(move.from().isPieceStand());
  const Square to=move.to();
  const Piece to_piece=pieceAt(to);
  const Ptype ptype=move.ptype();
  const Player turn = move.player();
  // ターゲットが空白か
  if (! to_piece.isEmpty()) {
    if (show_error) std::cerr << "drop on to piece : " << move << std::endl;
    return false;
  }
  // そもそもその駒を持っているか?
  if (! hasPieceOnStand(turn,ptype)) {
    if (show_error) std::cerr << turn << " don't have : " << ptype << std::endl;
    return false;
  }
  // 二歩のチェック
  if (ptype==PAWN && isPawnMaskSet(turn, to.x())) {
    if (show_error) std::cerr << " Double Pawn : " << move << std::endl;
    return false;
  }
  return true;
}

template <bool show_error>
bool
osl::SimpleState::testValidityOtherThanEffect(Move move) const
{
  const Square from=move.from();
  const Piece from_piece = pieceAt(from);
  const Square to=move.to();
  const Piece to_piece=pieceAt(to);
  // fromにあるのがその駒か
  if (from_piece.isEmpty() 
      || (from_piece.owner() != turn()))
  {
    if (show_error) 
      std::cerr << " No such piece0 : " << move << std::endl;
    return false;
  }
  // promoteしている時にpromote可能か
  if (move.isPromotion())
  {
    // fromにあるのがその駒か
    if (from_piece.ptype() != unpromote(move.ptype()))
    {
      if (show_error) 
	std::cerr << " No such piece1  : " << move << std::endl;
      return false;
    }
    if (from_piece.isPromotedNotKingGold())
    {
      if (show_error) 
	std::cerr << " can't promote promoted piece : " << move << std::endl;
      return false;
    }
  }
  else
  {
    // fromにあるのがその駒か
    if (from_piece.ptype() != move.ptype())
    {
      if (show_error) 
	std::cerr << " No such piece2  : " << move << std::endl;
      return false;
    }
  }
  // toにあるのが,相手の駒か空白か?
  if (!to_piece.isEmpty() && to_piece.owner()==turn()) {
    if (show_error) std::cerr << " No move on  : " << move << std::endl;
    return false;
  }
  // capturePtypeが一致しているか?
  if (to_piece.ptype()!=move.capturePtype()) {
    if (show_error) std::cerr << " Not such capture : " << move 
			      << std::endl << *this;
    return false;
  }
  return true;
}


#endif /* _SIMPLE_STATE_TCC */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End: