Hey, In working trying to get ESP-IDF 5+ Working, I came across the following fun thing that I'm trying to work out what is going on!! This is from main/ovms_module.cpp
I'm not sure why we don't just go through all the words and compare - why the masked compare for the last entry! And why that value?? It might make sense if you masked out the final byte ... I'm just struggling to understand.
Why am I looking at it?? Well there's a new warning about copy constructors.. and then I ran into a problem where 'Name' is sometimes in memory that can only be accessed 32bit int aligned (which is why the strange implementation in the first place - I get that).
Can anybody shed any light on this?
class Name
{.......
inline bool operator==(const Name& a) const
{
for (int i = 0; i < NAMELEN/4 - 1; ++i)
if (a.words[i] != words[i]) return false;
if (a.words[NAMELEN/4-1] != (words[NAMELEN/4-1] & 0x7FFFFFFF)) return false;
return true;
}