From 82ccdec2fb04316ae51ddf2666eecc397f2b1fd9 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Thu, 24 Aug 2017 16:59:47 -0700 Subject: minor : added header license --- programs/Makefile | 2 +- tests/Makefile | 3 +-- tests/fasttest.c | 36 ++++++++++++++++++++++++++++++------ 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/programs/Makefile b/programs/Makefile index 71b18b9..67af189 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -1,6 +1,6 @@ # ########################################################################## # LZ4 programs - Makefile -# Copyright (C) Yann Collet 2011-2016 +# Copyright (C) Yann Collet 2011-2017 # # This Makefile is validated for Linux, macOS, *BSD, Hurd, Solaris, MSYS2 targets # diff --git a/tests/Makefile b/tests/Makefile index 5b30684..d2d05af 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,6 +1,6 @@ # ########################################################################## # LZ4 programs - Makefile -# Copyright (C) Yann Collet 2011-2016 +# Copyright (C) Yann Collet 2011-2017 # # This Makefile is validated for Linux, macOS, *BSD, Hurd, Solaris, MSYS2 targets # @@ -76,7 +76,6 @@ lz4c: lz4c32: # create a 32-bits version for 32/64 interop tests $(MAKE) -C $(PRGDIR) $@ CFLAGS="-m32 $(CFLAGS)" - cp $(LZ4) $(LZ4)c32 fullbench : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xxhash.o fullbench.c $(CC) $(FLAGS) $^ -o $@$(EXT) diff --git a/tests/fasttest.c b/tests/fasttest.c index a165293..07811f6 100644 --- a/tests/fasttest.c +++ b/tests/fasttest.c @@ -1,8 +1,33 @@ +/* + fasttest.c - + Copyright (C) Yann Collet 2012-2017 + + GPL v2 License + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + You can contact the author at : + - LZ4 homepage : http://www.lz4.org + - LZ4 source repo : https://github.com/lz4/lz4 +*/ + /************************************** * Compiler Options **************************************/ #ifdef _MSC_VER /* Visual Studio */ -# define _CRT_SECURE_NO_WARNINGS // for MSVC +# define _CRT_SECURE_NO_WARNINGS /* for MSVC */ # define snprintf sprintf_s #endif #ifdef __GNUC__ @@ -35,16 +60,15 @@ int test_compress(const char *input, int inSize, char *output, int outSize) const int length = inSize >> 2; if (inSize > 1024) return -2; if (outSize - (outOffset + 8) < LZ4_compressBound(length)) return -3; - { - const int outBytes = LZ4_compress_fast_continue( - lz4Stream, input + inOffset, output + outOffset + 8, length, outSize-outOffset, 1); + { const int outBytes = LZ4_compress_fast_continue( + lz4Stream, input + inOffset, output + outOffset + 8, + length, outSize-outOffset, 1); if(outBytes <= 0) return -4; memcpy(output + outOffset, &length, 4); /* input length */ memcpy(output + outOffset + 4, &outBytes, 4); /* output length */ inOffset += length; outOffset += outBytes + 8; - } - } + } } if (outOffset + 8 > outSize) return -5; memset(output + outOffset, 0, 4); memset(output + outOffset + 4, 0, 4); -- cgit v0.12