ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
misc.h
Go to the documentation of this file.
1//===--- misc.h -------------------------------------------------------------===
2//
3// satoko: Satisfiability solver
4//
5// This file is distributed under the BSD 2-Clause License.
6// See LICENSE for details.
7//
8//===------------------------------------------------------------------------===
9#ifndef satoko__utils__misc_h
10#define satoko__utils__misc_h
11
14
15#define stk_swap(type, a, b) { type t = a; a = b; b = t; }
16
17static inline unsigned stk_uint_max(unsigned a, unsigned b)
18{
19 return a > b ? a : b;
20}
21
22static inline int stk_uint_compare(const void *p1, const void *p2)
23{
24 const unsigned pp1 = *(const unsigned *)p1;
25 const unsigned pp2 = *(const unsigned *)p2;
26
27 if (pp1 < pp2)
28 return -1;
29 if (pp1 > pp2)
30 return 1;
31 return 0;
32}
33
35#endif /* satoko__utils__misc_h */
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.