From c99f89e813fa989efbcb0c5125892d35195ec757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20Ha=CC=88user?= <mhaeuser@posteo.de> Date: Sat, 25 Nov 2023 16:05:57 +0100 Subject: [PATCH] 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. --- simulators/c++2/src_simulator/HashAlgo.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/simulators/c++2/src_simulator/HashAlgo.h b/simulators/c++2/src_simulator/HashAlgo.h index 886c4c9ee6..5ca8d34b79 100644 --- a/simulators/c++2/src_simulator/HashAlgo.h +++ b/simulators/c++2/src_simulator/HashAlgo.h @@ -63,7 +63,7 @@ Ludovic Apvrille, Renaud Pacalet c -= b; c ^= rot(b, 4); b += a; \ } -#define ifinal(a,b,c) \ +#define ihfinal(a,b,c) \ { \ b += rot(a,14); b ^= a;\ a += rot(c,4); a ^= c;\ @@ -73,7 +73,7 @@ Ludovic Apvrille, Renaud Pacalet c += rot(b,14); c ^= b;\ } -#define final(a,b,c) \ +#define hfinal(a,b,c) \ { \ c ^= b; c -= rot(b,14); \ a ^= c; a -= rot(c,11); \ @@ -121,7 +121,7 @@ public: /*void removeValue(HashValueType iVal){ if(_finalized){ - ifinal(_a, _b, _c); + ihfinal(_a, _b, _c); _finalized=false; } switch(_state){ @@ -137,7 +137,7 @@ public: _result = _c; if(_state!=0){ HashValueType aA = _a, aB=_b; - final(aA, aB, _result); + hfinal(aA, aB, _result); _finalized=true; } } -- GitLab