summaryrefslogtreecommitdiffstats
path: root/lz4demo.c
diff options
context:
space:
mode:
authoryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2012-02-20 20:53:49 (GMT)
committeryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2012-02-20 20:53:49 (GMT)
commitecbce64ac93a81784c23c0cb8fe9ae8ede0866f9 (patch)
tree495f2885ee99740f09eb17c6d2adb077a10a8f04 /lz4demo.c
parent4045a42bb14007bd982e256c2ac97cc8695de9cd (diff)
downloadlz4-ecbce64ac93a81784c23c0cb8fe9ae8ede0866f9.zip
lz4-ecbce64ac93a81784c23c0cb8fe9ae8ede0866f9.tar.gz
lz4-ecbce64ac93a81784c23c0cb8fe9ae8ede0866f9.tar.bz2
Corrected : default to Software Bit Count for GCC earlier than 3.4. Thanks to Gray.
Corrected : ARM compilation under Visual Studio : now generates cautious code, like GCC, to ensure compatibility with strict-align CPUs. Thanks to Joe WoodBury. Minor : bench.c : Hash verification changed to MurmurHash3A Minor : bench.c : selectable block size git-svn-id: https://lz4.googlecode.com/svn/trunk@56 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
Diffstat (limited to 'lz4demo.c')
-rw-r--r--lz4demo.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lz4demo.c b/lz4demo.c
index 056e597..3905cfe 100644
--- a/lz4demo.c
+++ b/lz4demo.c
@@ -298,7 +298,8 @@ int main(int argc, char** argv)
int i,
compression=1, // default action if no argument
decode=0,
- bench=0;
+ bench=0,
+ filenamesStart=2;
char* input_filename=0;
char* output_filename=0;
#ifdef _WIN32
@@ -316,16 +317,13 @@ int main(int argc, char** argv)
for(i=1; i<argc; i++)
{
char* argument = argv[i];
- char command = 0;
if(!argument) continue; // Protection if argument empty
- if (argument[0]=='-') command++; // valid command trigger
-
// Select command
- if (command)
+ if (argument[0]=='-')
{
- argument += command;
+ argument ++;
// Display help on usage
if ( argument[0] =='h' ) { usage(); return 0; }
@@ -339,12 +337,15 @@ int main(int argc, char** argv)
// Bench
if ( argument[0] =='b' ) { bench=1; continue; }
+ // Modify Block Size (benchmark only)
+ if ( argument[0] =='B' ) { int B = argument[1] - '0'; int S = 1 << (10 + 2*B); BMK_SetBlocksize(S); continue; }
+
// Test
if ( argument[0] =='t' ) { decode=1; output_filename=nulmark; continue; }
}
// first provided filename is input
- if (!input_filename) { input_filename=argument; continue; }
+ if (!input_filename) { input_filename=argument; filenamesStart=i; continue; }
// second provided filename is output
if (!output_filename)
@@ -358,7 +359,7 @@ int main(int argc, char** argv)
// No input filename ==> Error
if(!input_filename) { badusage(); return 1; }
- if (bench) return BMK_benchFile(argv+2, argc-2);
+ if (bench) return BMK_benchFile(argv+filenamesStart, argc-filenamesStart);
// No output filename
if (!output_filename) { badusage(); return 1; }