Fossil SCM
Fix a harmless compiler warning in an assert() in delta.c.
Commit
d891af8385a4d4c0c935f167c52bd17e8ccaf85a
Parent
045deb27ce9f959…
1 file changed
+1
-1
+1
-1
| --- src/delta.c | ||
| +++ src/delta.c | ||
| @@ -226,11 +226,11 @@ | ||
| 226 | 226 | static unsigned int checksum(const char *zIn, size_t N){ |
| 227 | 227 | static const int byteOrderTest = 1; |
| 228 | 228 | const unsigned char *z = (const unsigned char *)zIn; |
| 229 | 229 | const unsigned char *zEnd = (const unsigned char*)&zIn[N&~3]; |
| 230 | 230 | unsigned sum = 0; |
| 231 | - assert( (3&(sqlite3_uint64)z)==0 ); /* Four-byte alignment */ | |
| 231 | + assert( (z - (const unsigned char*)0)%4==0 ); /* Four-byte alignment */ | |
| 232 | 232 | if( 0==*(char*)&byteOrderTest ){ |
| 233 | 233 | /* This is a big-endian machine */ |
| 234 | 234 | while( z<zEnd ){ |
| 235 | 235 | sum += *(unsigned*)z; |
| 236 | 236 | z += 4; |
| 237 | 237 |
| --- src/delta.c | |
| +++ src/delta.c | |
| @@ -226,11 +226,11 @@ | |
| 226 | static unsigned int checksum(const char *zIn, size_t N){ |
| 227 | static const int byteOrderTest = 1; |
| 228 | const unsigned char *z = (const unsigned char *)zIn; |
| 229 | const unsigned char *zEnd = (const unsigned char*)&zIn[N&~3]; |
| 230 | unsigned sum = 0; |
| 231 | assert( (3&(sqlite3_uint64)z)==0 ); /* Four-byte alignment */ |
| 232 | if( 0==*(char*)&byteOrderTest ){ |
| 233 | /* This is a big-endian machine */ |
| 234 | while( z<zEnd ){ |
| 235 | sum += *(unsigned*)z; |
| 236 | z += 4; |
| 237 |
| --- src/delta.c | |
| +++ src/delta.c | |
| @@ -226,11 +226,11 @@ | |
| 226 | static unsigned int checksum(const char *zIn, size_t N){ |
| 227 | static const int byteOrderTest = 1; |
| 228 | const unsigned char *z = (const unsigned char *)zIn; |
| 229 | const unsigned char *zEnd = (const unsigned char*)&zIn[N&~3]; |
| 230 | unsigned sum = 0; |
| 231 | assert( (z - (const unsigned char*)0)%4==0 ); /* Four-byte alignment */ |
| 232 | if( 0==*(char*)&byteOrderTest ){ |
| 233 | /* This is a big-endian machine */ |
| 234 | while( z<zEnd ){ |
| 235 | sum += *(unsigned*)z; |
| 236 | z += 4; |
| 237 |