mirror of
https://github.com/YosysHQ/yosys
synced 2026-05-24 10:59:40 +00:00
hashlib: error on unused containers
This commit is contained in:
parent
b06f9bdf18
commit
4eb1c61bd5
1 changed files with 10 additions and 4 deletions
|
|
@ -55,6 +55,12 @@ namespace hashlib {
|
||||||
* instead of pointers.
|
* instead of pointers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
|
# define HASHLIB_ATTRIBUTE_WARN_UNUSED __attribute__((warn_unused))
|
||||||
|
#else
|
||||||
|
# define HASHLIB_ATTRIBUTE_WARN_UNUSED
|
||||||
|
#endif
|
||||||
|
|
||||||
const int hashtable_size_trigger = 2;
|
const int hashtable_size_trigger = 2;
|
||||||
const int hashtable_size_factor = 3;
|
const int hashtable_size_factor = 3;
|
||||||
|
|
||||||
|
|
@ -402,7 +408,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename K, typename T, typename OPS>
|
template<typename K, typename T, typename OPS>
|
||||||
class dict {
|
class HASHLIB_ATTRIBUTE_WARN_UNUSED dict {
|
||||||
struct entry_t
|
struct entry_t
|
||||||
{
|
{
|
||||||
std::pair<K, T> udata;
|
std::pair<K, T> udata;
|
||||||
|
|
@ -877,7 +883,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename K, typename OPS>
|
template<typename K, typename OPS>
|
||||||
class pool
|
class HASHLIB_ATTRIBUTE_WARN_UNUSED pool
|
||||||
{
|
{
|
||||||
template<typename, int, typename> friend class idict;
|
template<typename, int, typename> friend class idict;
|
||||||
|
|
||||||
|
|
@ -1257,7 +1263,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename K, int offset, typename OPS>
|
template<typename K, int offset, typename OPS>
|
||||||
class idict
|
class HASHLIB_ATTRIBUTE_WARN_UNUSED idict
|
||||||
{
|
{
|
||||||
pool<K, OPS> database;
|
pool<K, OPS> database;
|
||||||
|
|
||||||
|
|
@ -1360,7 +1366,7 @@ public:
|
||||||
* i-prefixed methods operate on indices in parents
|
* i-prefixed methods operate on indices in parents
|
||||||
*/
|
*/
|
||||||
template<typename K, typename OPS>
|
template<typename K, typename OPS>
|
||||||
class mfp
|
class HASHLIB_ATTRIBUTE_WARN_UNUSED mfp
|
||||||
{
|
{
|
||||||
idict<K, 0, OPS> database;
|
idict<K, 0, OPS> database;
|
||||||
class AtomicParent {
|
class AtomicParent {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue