Skip to content

Commit

Permalink
Fixed visual projects
Browse files Browse the repository at this point in the history
Fixed gpptest
Fixed travis tests
Fixed Huff0 compression on very small input
  • Loading branch information
Cyan4973 committed Sep 23, 2015
1 parent a849b85 commit 5f531df
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 60 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -15,6 +15,6 @@ env:
- TravisCi_FseTest=gpptest
- TravisCi_FseTest=test
- TravisCi_FseTest=sanitize
- TravisCi_FseTest="-C test test32"
- TravisCi_FseTest="-C test memtest"
- TravisCi_FseTest="-C programs test32"
- TravisCi_FseTest="-C programs memtest"

4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -40,7 +40,7 @@ clean:

gpptest: clean
@echo ---- test g++ compilation ----
$(MAKE) -C $(PROGDIR) all CC=g++ CFLAGS="-O3 -I.. -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
$(MAKE) -C $(PROGDIR) all CC=g++ CFLAGS="-O3 -I../lib -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"

armtest: clean
@echo ---- test ARM compilation ----
Expand All @@ -52,7 +52,7 @@ clangtest: clean

staticAnalyze: clean
@echo ---- static analyzer - scan-build ----
scan-build --status-bugs -v $(MAKE) -C $(PROGDIR) all CFLAGS=-g # does not work well; too many false positives
scan-build --status-bugs -v $(MAKE) -C $(PROGDIR) all CFLAGS="-g -I../lib" # does not work well; too many false positives

sanitize: clean
@echo ---- check undefined behavior - sanitize ----
Expand Down
44 changes: 22 additions & 22 deletions Visual/VC2012/FSE/FSE.vcxproj
Expand Up @@ -18,6 +18,24 @@
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\lib\fse.c" />
<ClCompile Include="..\..\..\lib\fseU16.c" />
<ClCompile Include="..\..\..\programs\bench.c" />
<ClCompile Include="..\..\..\programs\commandline.c" />
<ClCompile Include="..\..\..\programs\fileio.c" />
<ClCompile Include="..\..\..\programs\xxhash.c" />
<ClCompile Include="..\..\..\programs\zlibh.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\lib\fse.h" />
<ClInclude Include="..\..\..\lib\fseU16.h" />
<ClInclude Include="..\..\..\lib\fse_static.h" />
<ClInclude Include="..\..\..\programs\bench.h" />
<ClInclude Include="..\..\..\programs\fileio.h" />
<ClInclude Include="..\..\..\programs\xxhash.h" />
<ClInclude Include="..\..\..\programs\zlibh.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{69038E19-1F9B-4086-A6E4-C8076F51EB22}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
Expand Down Expand Up @@ -68,22 +86,22 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(SolutionDir)..\..;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath)</IncludePath>
<IncludePath>$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath)</IncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(SolutionDir)..\..;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath)</IncludePath>
<IncludePath>$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath)</IncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)..\..;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<IncludePath>$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)..\..;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<IncludePath>$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand Down Expand Up @@ -157,24 +175,6 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\fse.c" />
<ClCompile Include="..\..\..\fseU16.c" />
<ClCompile Include="..\..\..\test\bench.c" />
<ClCompile Include="..\..\..\test\commandline.c" />
<ClCompile Include="..\..\..\test\fileio.c" />
<ClCompile Include="..\..\..\test\xxhash.c" />
<ClCompile Include="..\..\..\test\zlibh.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\fse.h" />
<ClInclude Include="..\..\..\fseU16.h" />
<ClInclude Include="..\..\..\fse_static.h" />
<ClInclude Include="..\..\..\test\bench.h" />
<ClInclude Include="..\..\..\test\fileio.h" />
<ClInclude Include="..\..\..\test\xxhash.h" />
<ClInclude Include="..\..\..\test\zlibh.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
28 changes: 14 additions & 14 deletions Visual/VC2012/FSE/FSE.vcxproj.filters
Expand Up @@ -15,48 +15,48 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\fse.c">
<ClCompile Include="..\..\..\lib\fse.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="..\..\..\fseU16.c">
<ClCompile Include="..\..\..\lib\fseU16.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="..\..\..\test\zlibh.c">
<ClCompile Include="..\..\..\programs\bench.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="..\..\..\test\bench.c">
<ClCompile Include="..\..\..\programs\commandline.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="..\..\..\test\xxhash.c">
<ClCompile Include="..\..\..\programs\fileio.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="..\..\..\test\fileio.c">
<ClCompile Include="..\..\..\programs\xxhash.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="..\..\..\test\commandline.c">
<ClCompile Include="..\..\..\programs\zlibh.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\fse.h">
<ClInclude Include="..\..\..\lib\fse.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
<ClInclude Include="..\..\..\fse_static.h">
<ClInclude Include="..\..\..\lib\fse_static.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
<ClInclude Include="..\..\..\fseU16.h">
<ClInclude Include="..\..\..\lib\fseU16.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
<ClInclude Include="..\..\..\test\xxhash.h">
<ClInclude Include="..\..\..\programs\bench.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
<ClInclude Include="..\..\..\test\zlibh.h">
<ClInclude Include="..\..\..\programs\fileio.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
<ClInclude Include="..\..\..\test\fileio.h">
<ClInclude Include="..\..\..\programs\xxhash.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
<ClInclude Include="..\..\..\test\bench.h">
<ClInclude Include="..\..\..\programs\zlibh.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
</ItemGroup>
Expand Down
28 changes: 14 additions & 14 deletions Visual/VC2012/fuzzer/fuzzer.vcxproj
Expand Up @@ -18,6 +18,16 @@
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\lib\fse.c" />
<ClCompile Include="..\..\..\programs\fuzzer.c" />
<ClCompile Include="..\..\..\programs\xxhash.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\lib\fse.h" />
<ClInclude Include="..\..\..\lib\fse_static.h" />
<ClInclude Include="..\..\..\programs\xxhash.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{31732650-1FA8-4E67-833D-88DF9AA1623D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
Expand Down Expand Up @@ -68,22 +78,22 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(SolutionDir)..\..;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<IncludePath>$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(SolutionDir)..\..;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<IncludePath>$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)..\..;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<IncludePath>$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)..\..;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<IncludePath>$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand Down Expand Up @@ -156,16 +166,6 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\fse.c" />
<ClCompile Include="..\..\..\test\fuzzer.c" />
<ClCompile Include="..\..\..\test\xxhash.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\fse.h" />
<ClInclude Include="..\..\..\fse_static.h" />
<ClInclude Include="..\..\..\test\xxhash.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
12 changes: 6 additions & 6 deletions Visual/VC2012/fuzzer/fuzzer.vcxproj.filters
Expand Up @@ -15,24 +15,24 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\fse.c">
<ClCompile Include="..\..\..\lib\fse.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="..\..\..\test\fuzzer.c">
<ClCompile Include="..\..\..\programs\fuzzer.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="..\..\..\test\xxhash.c">
<ClCompile Include="..\..\..\programs\xxhash.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\fse.h">
<ClInclude Include="..\..\..\lib\fse.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
<ClInclude Include="..\..\..\fse_static.h">
<ClInclude Include="..\..\..\lib\fse_static.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
<ClInclude Include="..\..\..\test\xxhash.h">
<ClInclude Include="..\..\..\programs\xxhash.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
</ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions lib/fse.c
Expand Up @@ -2109,6 +2109,7 @@ static size_t HUF_compress_into4Segments(void* dst, size_t dstSize, const void*
BYTE* const oend = ostart + dstSize;

if (dstSize < 6 + 1 + 1 + 1 + 8) return 0; /* minimum space to compress successfully */
if (srcSize < 12) return 0; /* no saving possible : too small input */
op += 6; /* jumpTable */

errorCode = HUF_compress_usingCTable(op, oend-op, ip, segmentSize, CTable);
Expand Down Expand Up @@ -2173,6 +2174,7 @@ size_t HUF_compress2 (void* dst, size_t dstSize,
/* Write table description header */
errorCode = HUF_writeCTable (op, dstSize, CTable, maxSymbolValue, huffLog);
if (FSE_isError(errorCode)) return errorCode;
if (errorCode + 12 >= srcSize) return 0; /* not useful to try compression */
op += errorCode;

/* Compress */
Expand Down

0 comments on commit 5f531df

Please sign in to comment.