flycrane / lz4

Automatically exported from code.google.com/p/lz4
0 stars 0 forks source link

Minor warnings for 64bit platform #80

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There are 2 minor warnings for 64bit platform (MSVC2012, x64 Release).

(1) lz4.c(379) : sizeof(ptrdiff_t) > sizeof(U32)

FORCE_INLINE void LZ4_putPositionOnHash(Ptr p, U32 h, void* tableBase, 
tableType_t tableType, Ptr srcBase)
{
...
-   case byU32: { U32* hashTable = (U32*) tableBase; hashTable[h] = p-srcBase; 
break; }
+   case byU32: { U32* hashTable = (U32*) tableBase; hashTable[h] = 
(U32)(p-srcBase); break; }
...
}

(2) lz4.c(639) : sizeof(size_t) > sizeof(U32)

char* LZ4_slideInputBuffer (void* LZ4_Data)
{
...
-           else lz4ds->hashTable[nH] -= newBaseDelta;
+           else lz4ds->hashTable[nH] -= (U32)newBaseDelta;
...
}

Original issue reported on code.google.com by takayuki...@gmail.com on 20 Aug 2013 at 10:26

GoogleCodeExporter commented 8 years ago
Thanks Takayuki
You are perfectly right.
This will be corrected in next release.

Original comment by yann.col...@gmail.com on 20 Aug 2013 at 1:16

GoogleCodeExporter commented 8 years ago
Fixed into r103.

Original comment by yann.col...@gmail.com on 9 Sep 2013 at 9:09