summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 14:03:45 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 14:03:45 +0000
commit8e588bc047fbb5af60a8eb44f5e5715f035888fc (patch)
treecd40dee12f5e790ea1540b9151e2354b14c092ba
parentAdding upstream version 1.6~pre3. (diff)
downloadlzlib-8e588bc047fbb5af60a8eb44f5e5715f035888fc.tar.xz
lzlib-8e588bc047fbb5af60a8eb44f5e5715f035888fc.zip
Adding upstream version 1.6~pre4.upstream/1.6_pre4
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
-rw-r--r--ChangeLog5
-rw-r--r--Makefile.in18
-rw-r--r--carg_parser.c7
-rwxr-xr-xconfigure2
-rw-r--r--doc/lzlib.info2
-rw-r--r--doc/lzlib.texi4
-rw-r--r--doc/minilzip.14
-rw-r--r--encoder.c2
-rw-r--r--lzcheck.c4
-rw-r--r--lzlib.h2
-rw-r--r--main.c38
-rwxr-xr-xtestsuite/check.sh29
12 files changed, 63 insertions, 54 deletions
diff --git a/ChangeLog b/ChangeLog
index 3582c40..e881401 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-25 Antonio Diaz Diaz <antonio@gnu.org>
+
+ * Version 1.6-pre4 released.
+ * Makefile.in: Use 'CFLAGS' in every invocation of 'CC'.
+
2014-03-30 Antonio Diaz Diaz <antonio@gnu.org>
* Version 1.6-pre3 released.
diff --git a/Makefile.in b/Makefile.in
index 6f69b0a..cabff9a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -21,31 +21,31 @@ lib$(libname).a : lzlib.o
$(AR) -rcs $@ $<
lib$(libname).so.$(pkgversion) : lzlib_sh.o
- $(CC) -shared -Wl,--soname=lib$(libname).so.$(soversion) -o $@ $<
+ $(CC) $(CFLAGS) $(LDFLAGS) -fpic -fPIC -shared -Wl,--soname=lib$(libname).so.$(soversion) -o $@ $<
$(progname) : $(objs) lib$(libname).a
- $(CC) $(LDFLAGS) -o $@ $(objs) lib$(libname).a
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(objs) lib$(libname).a
$(progname)_shared : $(objs) lib$(libname).so.$(pkgversion)
- $(CC) $(LDFLAGS) -o $@ $(objs) lib$(libname).so.$(pkgversion)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(objs) lib$(libname).so.$(pkgversion)
$(progname)_profiled : $(objs) lib$(libname).a
- $(CC) $(LDFLAGS) -pg -o $@ $(objs) lib$(libname).a
+ $(CC) $(CFLAGS) $(LDFLAGS) -pg -o $@ $(objs) lib$(libname).a
bbexample : bbexample.o lib$(libname).a
- $(CC) $(LDFLAGS) -o $@ bbexample.o lib$(libname).a
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ bbexample.o lib$(libname).a
lzcheck : lzcheck.o lib$(libname).a
- $(CC) $(LDFLAGS) -o $@ lzcheck.o lib$(libname).a
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ lzcheck.o lib$(libname).a
main.o : main.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -DPROGVERSION=\"$(pkgversion)\" -c -o $@ $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) -DPROGVERSION=\"$(pkgversion)\" -c -o $@ $<
lzlib_sh.o : lzlib.c
- $(CC) -fpic -fPIC $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) -fpic -fPIC -c -o $@ $<
%.o : %.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
lzdeps = lzlib.h lzip.h cbuffer.c decoder.h decoder.c encoder.h encoder.c
diff --git a/carg_parser.c b/carg_parser.c
index 1dfcb2b..80e60c1 100644
--- a/carg_parser.c
+++ b/carg_parser.c
@@ -176,7 +176,8 @@ static char parse_short_option( struct Arg_parser * const ap,
if( index < 0 )
{
- add_error( ap, "invalid option -- " ); add_error( ap, code_str );
+ add_error( ap, "invalid option -- '" ); add_error( ap, code_str );
+ add_error( ap, "'" );
return 1;
}
@@ -191,8 +192,8 @@ static char parse_short_option( struct Arg_parser * const ap,
{
if( !arg || !arg[0] )
{
- add_error( ap, "option requires an argument -- " );
- add_error( ap, code_str );
+ add_error( ap, "option requires an argument -- '" );
+ add_error( ap, code_str ); add_error( ap, "'" );
return 1;
}
++*argindp; cind = 0;
diff --git a/configure b/configure
index e108358..ca643ce 100755
--- a/configure
+++ b/configure
@@ -6,7 +6,7 @@
# to copy, distribute and modify it.
pkgname=lzlib
-pkgversion=1.6-pre3
+pkgversion=1.6-pre4
soversion=1
progname=minilzip
progname_static=${progname}
diff --git a/doc/lzlib.info b/doc/lzlib.info
index 2017f3f..fc7289d 100644
--- a/doc/lzlib.info
+++ b/doc/lzlib.info
@@ -11,7 +11,7 @@ File: lzlib.info, Node: Top, Next: Introduction, Up: (dir)
Lzlib Manual
************
-This manual is for Lzlib (version 1.6-pre3, 30 March 2014).
+This manual is for Lzlib (version 1.6-pre4, 25 April 2014).
* Menu:
diff --git a/doc/lzlib.texi b/doc/lzlib.texi
index 658db32..24fceab 100644
--- a/doc/lzlib.texi
+++ b/doc/lzlib.texi
@@ -6,8 +6,8 @@
@finalout
@c %**end of header
-@set UPDATED 30 March 2014
-@set VERSION 1.6-pre3
+@set UPDATED 25 April 2014
+@set VERSION 1.6-pre4
@dircategory Data Compression
@direntry
diff --git a/doc/minilzip.1 b/doc/minilzip.1
index b61a79f..c5dc015 100644
--- a/doc/minilzip.1
+++ b/doc/minilzip.1
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
-.TH MINILZIP "1" "March 2014" "minilzip 1.6-pre3" "User Commands"
+.TH MINILZIP "1" "April 2014" "minilzip 1.6-pre4" "User Commands"
.SH NAME
minilzip \- reduces the size of files
.SH SYNOPSIS
@@ -83,7 +83,7 @@ Report bugs to lzip\-bug@nongnu.org
Lzlib home page: http://www.nongnu.org/lzip/lzlib.html
.SH COPYRIGHT
Copyright \(co 2014 Antonio Diaz Diaz.
-Using lzlib 1.6\-pre3
+Using lzlib 1.6\-pre4
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
.br
This is free software: you are free to change and redistribute it.
diff --git a/encoder.c b/encoder.c
index 3c28c4b..9d43d66 100644
--- a/encoder.c
+++ b/encoder.c
@@ -684,7 +684,7 @@ static bool LZe_encode_member( struct LZ_encoder * const e )
const bool best = ( e->matchfinder->match_len_limit > 12 );
const int dis_price_count = best ? 1 : 512;
const int align_price_count = best ? 1 : dis_align_size;
- const int price_count = ( e->matchfinder->match_len_limit > 36 ) ? 1024 : 4096;
+ const int price_count = ( e->matchfinder->match_len_limit > 36 ) ? 1013 : 4093;
int ahead, i;
State * const state = &e->state;
diff --git a/lzcheck.c b/lzcheck.c
index 361a98c..4630703 100644
--- a/lzcheck.c
+++ b/lzcheck.c
@@ -111,7 +111,7 @@ int main( const int argc, const char * const argv[] )
if( out_size != in_size || memcmp( in_buffer + l, out_buffer, out_size ) )
{
- fprintf( stderr, "lzcheck: Sync error at pos %d. in_size = %d, out_size = %d\n",
+ fprintf( stderr, "lzcheck: Sync error at pos %d. in_size = %d, out_size = %d.\n",
l, in_size, out_size );
for( i = 0; i < in_size; ++i )
fputc( in_buffer[l+i], stderr );
@@ -183,7 +183,7 @@ int main( const int argc, const char * const argv[] )
if( out_size != in_size || memcmp( in_buffer + l, out_buffer, out_size ) )
{
- fprintf( stderr, "lzcheck: Sync error at pos %d. in_size = %d, out_size = %d\n",
+ fprintf( stderr, "lzcheck: Sync error at pos %d. in_size = %d, out_size = %d.\n",
l, in_size, out_size );
for( i = 0; i < in_size; ++i )
fputc( in_buffer[l+i], stderr );
diff --git a/lzlib.h b/lzlib.h
index 5fcf34d..724c8e1 100644
--- a/lzlib.h
+++ b/lzlib.h
@@ -29,7 +29,7 @@
extern "C" {
#endif
-static const char * const LZ_version_string = "1.6-pre3";
+static const char * const LZ_version_string = "1.6-pre4";
enum LZ_Errno { LZ_ok = 0, LZ_bad_argument, LZ_mem_error,
LZ_sequence_error, LZ_header_error, LZ_unexpected_eof,
diff --git a/main.c b/main.c
index 5c53b00..d2e8730 100644
--- a/main.c
+++ b/main.c
@@ -35,7 +35,7 @@
#include <unistd.h>
#include <utime.h>
#include <sys/stat.h>
-#if defined(__MSVCRT__) || defined(_MSC_VER)
+#if defined(__MSVCRT__)
#include <io.h>
#define fchmod(x,y) 0
#define fchown(x,y,z) 0
@@ -154,7 +154,7 @@ static void Pp_show_msg( struct Pretty_print * const pp, const char * const msg
for( i = 0; i < len; ++i ) fprintf( stderr, " " );
if( !msg ) fflush( stderr );
}
- if( msg ) fprintf( stderr, "%s.\n", msg );
+ if( msg ) fprintf( stderr, "%s\n", msg );
}
}
@@ -559,7 +559,7 @@ static int do_compress( struct LZ_Encoder * const encoder,
return 1;
}
if( rd > 0 && rd != LZ_compress_write( encoder, buffer, rd ) )
- internal_error( "library error (LZ_compress_write)" );
+ internal_error( "library error (LZ_compress_write)." );
if( rd < size ) LZ_compress_finish( encoder );
/* else LZ_compress_sync_flush( encoder ); */
in_size += rd;
@@ -582,7 +582,7 @@ static int do_compress( struct LZ_Encoder * const encoder,
return 1;
}
}
- else if( in_size == 0 ) internal_error( "library error (LZ_compress_read)" );
+ else if( in_size == 0 ) internal_error( "library error (LZ_compress_read)." );
if( LZ_compress_member_finished( encoder ) )
{
unsigned long long size;
@@ -597,7 +597,7 @@ static int do_compress( struct LZ_Encoder * const encoder,
{
close_and_set_permissions( in_statsp );
if( !next_filename() )
- { Pp_show_msg( pp, "Too many volume files" ); return 1; }
+ { Pp_show_msg( pp, "Too many volume files." ); return 1; }
if( !open_outstream( true ) ) return 1;
delete_output_on_interrupt = true;
}
@@ -650,9 +650,9 @@ int compress( const unsigned long long member_size,
if( !encoder || LZ_compress_errno( encoder ) != LZ_ok )
{
if( !encoder || LZ_compress_errno( encoder ) == LZ_mem_error )
- Pp_show_msg( pp, "Not enough memory. Try a smaller dictionary size" );
+ Pp_show_msg( pp, "Not enough memory. Try a smaller dictionary size." );
else
- internal_error( "invalid argument to encoder" );
+ internal_error( "invalid argument to encoder." );
retval = 1;
}
else retval = do_compress( encoder, member_size, volume_size,
@@ -683,7 +683,7 @@ int do_decompress( struct LZ_Decoder * const decoder, const int infd,
return 1;
}
if( in_size > 0 && in_size != LZ_decompress_write( decoder, buffer, in_size ) )
- internal_error( "library error (LZ_decompress_write)" );
+ internal_error( "library error (LZ_decompress_write)." );
if( in_size < max_in_size ) LZ_decompress_finish( decoder );
}
while( true )
@@ -733,16 +733,16 @@ int do_decompress( struct LZ_Decoder * const decoder, const int infd,
if( lz_errno == LZ_header_error || ( first_member && out_size == 0 ) )
{
if( !first_member ) break; /* trailing garbage */
- Pp_show_msg( pp, "Bad magic number (file not in lzip format)" );
+ Pp_show_msg( pp, "Bad magic number (file not in lzip format)." );
return 2;
}
if( lz_errno == LZ_mem_error )
- { Pp_show_msg( pp, "Not enough memory" ); return 1; }
+ { Pp_show_msg( pp, "Not enough memory." ); return 1; }
if( verbosity >= 0 )
{
Pp_show_msg( pp, 0 );
if( lz_errno == LZ_unexpected_eof )
- fprintf( stderr, "File ends unexpectedly at pos %llu\n",
+ fprintf( stderr, "File ends unexpectedly at pos %llu.\n",
LZ_decompress_total_in_size( decoder ) );
else
fprintf( stderr, "Decoder error at pos %llu: %s.\n",
@@ -753,7 +753,7 @@ int do_decompress( struct LZ_Decoder * const decoder, const int infd,
}
if( LZ_decompress_finished( decoder ) == 1 ) break;
if( in_size == 0 && out_size == 0 )
- internal_error( "library error (LZ_decompress_read)" );
+ internal_error( "library error (LZ_decompress_read)." );
}
return 0;
}
@@ -766,7 +766,7 @@ int decompress( const int infd, struct Pretty_print * const pp,
int retval;
if( !decoder || LZ_decompress_errno( decoder ) != LZ_ok )
- { Pp_show_msg( pp, "Not enough memory" ); retval = 1; }
+ { Pp_show_msg( pp, "Not enough memory." ); retval = 1; }
else retval = do_decompress( decoder, infd, pp, testing );
LZ_decompress_close( decoder );
@@ -797,7 +797,7 @@ void show_error( const char * const msg, const int errcode, const bool help )
if( msg && msg[0] )
{
fprintf( stderr, "%s: %s", program_name, msg );
- if( errcode > 0 ) fprintf( stderr, ": %s", strerror( errcode ) );
+ if( errcode > 0 ) fprintf( stderr, ": %s.", strerror( errcode ) );
fprintf( stderr, "\n" );
}
if( help )
@@ -810,7 +810,7 @@ void show_error( const char * const msg, const int errcode, const bool help )
void internal_error( const char * const msg )
{
if( verbosity >= 0 )
- fprintf( stderr, "%s: internal error: %s.\n", program_name, msg );
+ fprintf( stderr, "%s: internal error: %s\n", program_name, msg );
exit( 3 );
}
@@ -887,9 +887,9 @@ int main( const int argc, const char * const argv[] )
invocation_name = argv[0];
if( LZ_version()[0] != LZ_version_string[0] )
- internal_error( "bad library version" );
+ internal_error( "bad library version." );
if( strcmp( PROGVERSION, LZ_version_string ) != 0 )
- internal_error( "bad library version_string" );
+ internal_error( "bad library version_string." );
if( !ap_init( &parser, argc, argv, options, 0 ) )
{ show_error( "Not enough memory.", 0, false ); return 1; }
@@ -925,11 +925,11 @@ int main( const int argc, const char * const argv[] )
case 't': program_mode = m_test; break;
case 'v': if( verbosity < 4 ) ++verbosity; break;
case 'V': show_version(); return 0;
- default : internal_error( "uncaught option" );
+ default : internal_error( "uncaught option." );
}
} /* end process options */
-#if defined(__MSVCRT__) || defined(__OS2__) || defined(_MSC_VER)
+#if defined(__MSVCRT__) || defined(__OS2__)
setmode( STDIN_FILENO, O_BINARY );
setmode( STDOUT_FILENO, O_BINARY );
#endif
diff --git a/testsuite/check.sh b/testsuite/check.sh
index 038c76d..0244c58 100755
--- a/testsuite/check.sh
+++ b/testsuite/check.sh
@@ -30,25 +30,28 @@ fail=0
printf "testing lzlib-%s..." "$2"
"${LZIP}" -cqm4 in > /dev/null
-if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cqm274 in > /dev/null
-if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cqs-1 in > /dev/null
-if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cqs0 in > /dev/null
-if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cqs4095 in > /dev/null
-if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cqs513MiB in > /dev/null
-if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi
-"${LZIP}" -tq in
-if [ $? = 2 ] ; then printf . ; else fail=1 ; printf - ; fi
-"${LZIP}" -tq < in
-if [ $? = 2 ] ; then printf . ; else fail=1 ; printf - ; fi
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
+printf " in: Bad magic number (file not in lzip format).\n" > msg
+"${LZIP}" -t in 2> out
+if [ $? = 2 ] && cmp out msg ; then printf . ; else printf - ; fail=1 ; fi
+printf " (stdin): Bad magic number (file not in lzip format).\n" > msg
+"${LZIP}" -t < in 2> out
+if [ $? = 2 ] && cmp out msg ; then printf . ; else printf - ; fail=1 ; fi
+rm -f out msg
"${LZIP}" -cdq in
-if [ $? = 2 ] ; then printf . ; else fail=1 ; printf - ; fi
+if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cdq < in
-if [ $? = 2 ] ; then printf . ; else fail=1 ; printf - ; fi
+if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
dd if="${in_lz}" bs=1 count=6 2> /dev/null | "${LZIP}" -tq
if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
dd if="${in_lz}" bs=1 count=20 2> /dev/null | "${LZIP}" -tq
@@ -65,7 +68,7 @@ cmp in copy || fail=1
printf .
"${LZIP}" -cfq "${in_lz}" > out
-if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cF -s16 "${in_lz}" > out || fail=1
"${LZIP}" -cd out | "${LZIP}" -d > copy || fail=1
cmp in copy || fail=1