Skip to content
Snippets Groups Projects
Commit c99f89e8 authored by Marvin Häuser's avatar Marvin Häuser
Browse files

simulator: fix final() macro overriding keyword

The final() macro used for hashing overrides the language keyword final,
which may cause compilation issues for otherwise valid code. Rename it
to resolve the collision.
parent 56321bb9
No related branches found
No related tags found
1 merge request!477[WIP] simulation code generation fixes
...@@ -63,7 +63,7 @@ Ludovic Apvrille, Renaud Pacalet ...@@ -63,7 +63,7 @@ Ludovic Apvrille, Renaud Pacalet
c -= b; c ^= rot(b, 4); b += a; \ c -= b; c ^= rot(b, 4); b += a; \
} }
#define ifinal(a,b,c) \ #define ihfinal(a,b,c) \
{ \ { \
b += rot(a,14); b ^= a;\ b += rot(a,14); b ^= a;\
a += rot(c,4); a ^= c;\ a += rot(c,4); a ^= c;\
...@@ -73,7 +73,7 @@ Ludovic Apvrille, Renaud Pacalet ...@@ -73,7 +73,7 @@ Ludovic Apvrille, Renaud Pacalet
c += rot(b,14); c ^= b;\ c += rot(b,14); c ^= b;\
} }
#define final(a,b,c) \ #define hfinal(a,b,c) \
{ \ { \
c ^= b; c -= rot(b,14); \ c ^= b; c -= rot(b,14); \
a ^= c; a -= rot(c,11); \ a ^= c; a -= rot(c,11); \
...@@ -121,7 +121,7 @@ public: ...@@ -121,7 +121,7 @@ public:
/*void removeValue(HashValueType iVal){ /*void removeValue(HashValueType iVal){
if(_finalized){ if(_finalized){
ifinal(_a, _b, _c); ihfinal(_a, _b, _c);
_finalized=false; _finalized=false;
} }
switch(_state){ switch(_state){
...@@ -137,7 +137,7 @@ public: ...@@ -137,7 +137,7 @@ public:
_result = _c; _result = _c;
if(_state!=0){ if(_state!=0){
HashValueType aA = _a, aB=_b; HashValueType aA = _a, aB=_b;
final(aA, aB, _result); hfinal(aA, aB, _result);
_finalized=true; _finalized=true;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment