 Timestamp:
 Jan 7, 2012, 4:03:51 PM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/lib/byte_compare.hpp
r1831 r1833 36 36 template<class T, uint32_t L> 37 37 IDISA_ALWAYS_INLINE bool overlap_compare(const T * x, const T * y) { 38 39 cout << sizeof(T) << endl; 40 38 41 bool accum = true; 39 uint8_t * p_x = (uint8_t*)x;40 uint8_t * p_y = (uint8_t*)y;42 T * p_x = (T *)x; 43 T * p_y = (T *)y; 41 44 42 45 for(int i=0; i < L/sizeof(T); i++) { 43 46 accum = accum && compare(p_x,p_y,0); 44 p_x += sizeof(T);45 p_y += sizeof(T);47 p_x++; 48 p_y++; 46 49 } 47 50 if(L & (sizeof(T)1)) { … … 53 56 template<class T> 54 57 IDISA_ALWAYS_INLINE bool compare(const T * x, const T * y, const uint32_t offset) { 55 58 cout << sizeof(T) << endl; 56 59 return !((*((T*)((uint8_t *)x + offset))) ^ 57 60 (*((T*)((uint8_t *)y + offset))));
Note: See TracChangeset
for help on using the changeset viewer.