My Project
empty.h
Go to the documentation of this file.
1
11#ifndef EDAX_EMPTY_H
12#define EDAX_EMPTY_H
13
15typedef struct SquareList {
16 unsigned long long b;
17 int x;
20 struct SquareList *next;
22
28static inline void empty_remove(SquareList *empty)
29{
30 empty->previous->next = empty->next;
31 empty->next->previous = empty->previous;
32}
33
39static inline void empty_restore(SquareList *empty)
40{
41 empty->previous->next = empty;
42 empty->next->previous = empty;
43}
44
46#define foreach_empty(empty, list)\
47 for ((empty) = (list)->next; (empty)->next; (empty) = (empty)->next)
48
50#define foreach_even_empty(empty, list, parity)\
51 for ((empty) = (list)->next; (empty)->next; (empty) = (empty)->next) if ((parity & empty->quadrant) == 0)
52
54#define foreach_odd_empty(empty, list, parity)\
55 for ((empty) = (list)->next; (empty)->next; (empty) = (empty)->next) if (parity & empty->quadrant)
56
57#endif
58
static void empty_remove(SquareList *empty)
remove an empty square from the list.
Definition: empty.h:28
static void empty_restore(SquareList *empty)
restore the list of empty squares
Definition: empty.h:39
Definition: empty.h:15
struct SquareList * previous
Definition: empty.h:19
int quadrant
Definition: empty.h:18
unsigned long long b
Definition: empty.h:16
struct SquareList * next
Definition: empty.h:20
int x
Definition: empty.h:17