projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5488c69
)
hashlib: Add a hash for bool.
author
Marcelina Kościelnicka
<mwk@0x04.net>
Mon, 24 May 2021 19:27:29 +0000
(21:27 +0200)
committer
Marcelina Kościelnicka
<mwk@0x04.net>
Mon, 24 May 2021 20:02:15 +0000
(22:02 +0200)
kernel/hashlib.h
patch
|
blob
|
history
diff --git
a/kernel/hashlib.h
b/kernel/hashlib.h
index a523afadd080db4ddfb6d0e3558252bf1cab068f..42fb8d3635a6355326677d310f8de1b1a748fd44 100644
(file)
--- a/
kernel/hashlib.h
+++ b/
kernel/hashlib.h
@@
-66,6
+66,12
@@
struct hash_int_ops {
}
};
+template<> struct hash_ops<bool> : hash_int_ops
+{
+ static inline unsigned int hash(bool a) {
+ return a ? 1 : 0;
+ }
+};
template<> struct hash_ops<int32_t> : hash_int_ops
{
static inline unsigned int hash(int32_t a) {