Commit f37f2c0f authored by biagio montesano's avatar biagio montesano

Corrected windows warning

parent 1c246d47
...@@ -71,20 +71,20 @@ inline int match( UINT8*P, UINT8*Q, int codelb ) ...@@ -71,20 +71,20 @@ inline int match( UINT8*P, UINT8*Q, int codelb )
return popcnt( *(UINT32*) P ^ *(UINT32*) Q ); return popcnt( *(UINT32*) P ^ *(UINT32*) Q );
break; break;
case 8: // 64 bit case 8: // 64 bit
return (int)popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ); return (int) popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] );
break; break;
case 16: // 128 bit case 16: // 128 bit
return (int)(popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ) + popcntll( ( (UINT64*) P )[1] ^ ( (UINT64*) Q )[1] )); return (int) ( popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ) + popcntll( ( (UINT64*) P )[1] ^ ( (UINT64*) Q )[1] ) );
break; break;
case 32: // 256 bit case 32: // 256 bit
return (int)(popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ) + popcntll( ( (UINT64*) P )[1] ^ ( (UINT64*) Q )[1] ) return (int) ( popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ) + popcntll( ( (UINT64*) P )[1] ^ ( (UINT64*) Q )[1] )
+ popcntll( ( (UINT64*) P )[2] ^ ( (UINT64*) Q )[2] ) + popcntll( ( (UINT64*) P )[3] ^ ( (UINT64*) Q )[3] )); + popcntll( ( (UINT64*) P )[2] ^ ( (UINT64*) Q )[2] ) + popcntll( ( (UINT64*) P )[3] ^ ( (UINT64*) Q )[3] ) );
break; break;
case 64: // 512 bit case 64: // 512 bit
return (int)(popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ) + popcntll( ( (UINT64*) P )[1] ^ ( (UINT64*) Q )[1] ) return (int) ( popcntll( ( (UINT64*) P )[0] ^ ( (UINT64*) Q )[0] ) + popcntll( ( (UINT64*) P )[1] ^ ( (UINT64*) Q )[1] )
+ popcntll( ( (UINT64*) P )[2] ^ ( (UINT64*) Q )[2] ) + popcntll( ( (UINT64*) P )[3] ^ ( (UINT64*) Q )[3] ) + popcntll( ( (UINT64*) P )[2] ^ ( (UINT64*) Q )[2] ) + popcntll( ( (UINT64*) P )[3] ^ ( (UINT64*) Q )[3] )
+ popcntll( ( (UINT64*) P )[4] ^ ( (UINT64*) Q )[4] ) + popcntll( ( (UINT64*) P )[5] ^ ( (UINT64*) Q )[5] ) + popcntll( ( (UINT64*) P )[4] ^ ( (UINT64*) Q )[4] ) + popcntll( ( (UINT64*) P )[5] ^ ( (UINT64*) Q )[5] )
+ popcntll( ( (UINT64*) P )[6] ^ ( (UINT64*) Q )[6] ) + popcntll( ( (UINT64*) P )[7] ^ ( (UINT64*) Q )[7] )); + popcntll( ( (UINT64*) P )[6] ^ ( (UINT64*) Q )[6] ) + popcntll( ( (UINT64*) P )[7] ^ ( (UINT64*) Q )[7] ) );
break; break;
default: default:
int output = 0; int output = 0;
...@@ -94,7 +94,6 @@ inline int match( UINT8*P, UINT8*Q, int codelb ) ...@@ -94,7 +94,6 @@ inline int match( UINT8*P, UINT8*Q, int codelb )
break; break;
} }
} }
/* splitting function (b <= 64) */ /* splitting function (b <= 64) */
...@@ -132,7 +131,7 @@ inline UINT64 next_set_of_n_elements( UINT64 x ) ...@@ -132,7 +131,7 @@ inline UINT64 next_set_of_n_elements( UINT64 x )
{ {
UINT64 smallest, ripple, new_smallest; UINT64 smallest, ripple, new_smallest;
smallest = x & -(signed)x; smallest = x & -(signed) x;
ripple = x + smallest; ripple = x + smallest;
new_smallest = x ^ ripple; new_smallest = x ^ ripple;
new_smallest = new_smallest / smallest; new_smallest = new_smallest / smallest;
...@@ -145,8 +144,8 @@ inline void print_code( UINT64 tmp, int b ) ...@@ -145,8 +144,8 @@ inline void print_code( UINT64 tmp, int b )
{ {
for ( long long int j = ( b - 1 ); j >= 0; j-- ) for ( long long int j = ( b - 1 ); j >= 0; j-- )
{ {
printf( "%llu", (long long int) tmp / ( 1 << j ) ); printf( "%llu", (long long int) tmp / (UINT64) ( 1 << j ) );
tmp = tmp - ( tmp / ( 1 << j ) ) * ( 1 << j ); tmp = tmp - ( tmp / (UINT64) ( 1 << j ) ) * (UINT64) ( 1 << j );
} }
printf( "\n" ); printf( "\n" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment