diff --git a/client/cmdhfmfhard.c b/client/cmdhfmfhard.c index 2e5046754..38d35895f 100644 --- a/client/cmdhfmfhard.c +++ b/client/cmdhfmfhard.c @@ -1431,7 +1431,7 @@ static const uint64_t crack_states_bitsliced(statelist_t *p){ #endif if ( !lstate_p ) { - __sync_fetch_and_add(&total_states_tested, bucket_states_tested); + __atomic_fetch_add(&total_states_tested, bucket_states_tested, __ATOMIC_SEQ_CST); return key; } @@ -1618,7 +1618,7 @@ out: #endif } - __sync_fetch_and_add(&total_states_tested, bucket_states_tested); + __atomic_fetch_add(&total_states_tested, bucket_states_tested, __ATOMIC_SEQ_CST); return key; } @@ -1636,8 +1636,8 @@ static void* crack_states_thread(void* x){ if (keys_found) break; else if(key != -1) { if (TestIfKeyExists(key)) { - __sync_fetch_and_add(&keys_found, 1); - __sync_fetch_and_add(&foundkey, key); + __atomic_fetch_add(&keys_found, 1, __ATOMIC_SEQ_CST); + __atomic_fetch_add(&foundkey, key, __ATOMIC_SEQ_CST); printf("*"); fflush(stdout); break; diff --git a/client/util.c b/client/util.c index 4adc4e701..5485488c9 100644 --- a/client/util.c +++ b/client/util.c @@ -534,9 +534,11 @@ void xor(unsigned char * dst, unsigned char * src, size_t len) { int32_t le24toh (uint8_t data[3]) { return (data[2] << 16) | (data[1] << 8) | data[0]; } +#ifndef ANDROID uint32_t le32toh (uint8_t *data) { return (uint32_t)( (data[3]<<24) | (data[2]<<16) | (data[1]<<8) | data[0]); } +#endif // Pack a bitarray into a uint32_t. uint32_t PackBits(uint8_t start, uint8_t len, uint8_t* bits) { diff --git a/client/util.h b/client/util.h index ede50e8c1..84d1a3163 100644 --- a/client/util.h +++ b/client/util.h @@ -31,6 +31,10 @@ #include #endif +#ifdef ANDROID + #include +#endif + #ifndef BITMASK # define BITMASK(X) (1 << (X)) @@ -146,7 +150,9 @@ extern void wiegand_add_parity(uint8_t *target, uint8_t *source, uint8_t length) extern void xor(unsigned char * dst, unsigned char * src, size_t len); extern int32_t le24toh (uint8_t data[3]); +#ifndef ANDROID extern uint32_t le32toh (uint8_t *data); +#endif extern uint32_t PackBits(uint8_t start, uint8_t len, uint8_t* bits); extern void rol(uint8_t *data, const size_t len); extern uint32_t SwapBits(uint32_t value, int nrbits); diff --git a/liblua/llex.c b/liblua/llex.c index 81b8de9e3..d91f00f7d 100644 --- a/liblua/llex.c +++ b/liblua/llex.c @@ -199,7 +199,7 @@ static void buffreplace (LexState *ls, char from, char to) { #if ANDROID -#define getlocaldecpoint() '.' +#define getlocaledecpoint() '.' #elif !defined(getlocaledecpoint) #define getlocaledecpoint() (localeconv()->decimal_point[0]) #endif