Update codebase to remove clang warnings (and a couple of legit errors
[typhoon.git] / src / pawnhash.c
1 /**
2
3 Copyright (c) Scott Gasch
4
5 Module Name:
6
7     pawnhash.c
8
9 Abstract:
10
11     Pawn structure score hashing code.
12
13 Author:
14
15     Scott Gasch ([email protected]) 14 Jun 2004
16
17 Revision History:
18
19     $Id: pawnhash.c 345 2007-12-02 22:56:42Z scott $
20
21 **/
22
23 #include "chess.h"
24
25
26 PAWN_HASH_ENTRY *
27 PawnHashLookup(SEARCHER_THREAD_CONTEXT *ctx) 
28 /**
29
30 Routine description:
31
32     Called by eval with a pointer to a POSITION, look in our pawn hash
33     to see if we have an entry that matches the pawn structure in the
34     POSITION.  If so, "check out" that entry and return a pointer to
35     it.
36
37     Note: there is a multi-probing scheme in place to remove
38     contention on MP machines.
39
40 Parameters:
41
42     POSITION *pos
43
44 Return value:
45
46     PAWN_HASH_ENTRY *
47
48 **/
49 {
50     POSITION *pos = &(ctx->sPosition);
51     ULONG u = (ULONG)pos->u64PawnSig & (PAWN_HASH_TABLE_SIZE - 1);
52     return(&(ctx->rgPawnHash[u]));
53 }