--- a/src/otherfunctions.h 2005-01-09 20:58:10.000000000 +0100 +++ amuled/src/otherfunctions.h 2005-01-09 21:11:41.000000000 +0100 @@ -202,25 +202,37 @@ // Like 'memcmp' this function returns 0, if hash1==hash2, and !0, if hash1!=hash2. // NOTE: Do *NOT* use that function for determining if hash1hash2. inline int md4cmp(const void* hash1, const void* hash2) { + #ifdef __arm__ // casting (void *) to (uint32 *) for unaligned pointer doesnt work for arm + return memcmp(hash1,hash2,16) ; + #else return !(((uint32*)hash1)[0] == ((uint32*)hash2)[0] && ((uint32*)hash1)[1] == ((uint32*)hash2)[1] && ((uint32*)hash1)[2] == ((uint32*)hash2)[2] && ((uint32*)hash1)[3] == ((uint32*)hash2)[3]); + #endif } // md4clr -- replacement for memset(hash,0,16) inline void md4clr(const void* hash) { + #ifdef __arm__ //casting (void *) to (uint32 *) for unaligned pointer doesnt work for arm + memset((void *)hash,0,16); + #else ((uint32*)hash)[0] = ((uint32*)hash)[1] = ((uint32*)hash)[2] = ((uint32*)hash)[3] = 0; + #endif } // md4cpy -- replacement for memcpy(dst,src,16) inline void md4cpy(const void* dst, const void* src) { + #ifdef __arm__ //casting (void *) to (uint32 *) for unaligned pointer doesnt work for arm + memcpy((void *)dst,src,16); + #else ((uint32*)dst)[0] = ((uint32*)src)[0]; ((uint32*)dst)[1] = ((uint32*)src)[1]; ((uint32*)dst)[2] = ((uint32*)src)[2]; ((uint32*)dst)[3] = ((uint32*)src)[3]; + #endif } // DumpMem ... Dumps mem ;)