1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

Merge branch 'v5.0'

This commit is contained in:
Lasse Collin 2011-01-19 11:45:35 +02:00
commit 9d542ceebc
5 changed files with 17 additions and 9 deletions

1
THANKS
View file

@ -47,6 +47,7 @@ has been important. :-) In alphabetical order:
- Mikko Pouru - Mikko Pouru
- Robert Readman - Robert Readman
- Bernhard Reutner-Fischer - Bernhard Reutner-Fischer
- Cristian Rodríguez
- Christian von Roques - Christian von Roques
- Jukka Salmi - Jukka Salmi
- Alexandre Sauvé - Alexandre Sauvé

View file

@ -180,4 +180,10 @@ typedef unsigned char _Bool;
# define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) # define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
#endif #endif
#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
# define lzma_attr_alloc_size(x) __attribute__((__alloc_size__(x)))
#else
# define lzma_attr_alloc_size(x)
#endif
#endif #endif

View file

@ -205,7 +205,7 @@ struct lzma_internal_s {
/// Allocates memory /// Allocates memory
extern void *lzma_alloc(size_t size, lzma_allocator *allocator) extern void *lzma_alloc(size_t size, lzma_allocator *allocator)
lzma_attribute((malloc)); lzma_attribute((malloc)) lzma_attr_alloc_size(1);
/// Frees memory /// Frees memory
extern void lzma_free(void *ptr, lzma_allocator *allocator); extern void lzma_free(void *ptr, lzma_allocator *allocator);

View file

@ -74,9 +74,9 @@ if test $# -eq 1; then
*[-.]xz | *[-.]lzma | *.t[lx]z) *[-.]xz | *[-.]lzma | *.t[lx]z)
;; ;;
*[-.]bz2 | *.tbz | *.tbz2) *[-.]bz2 | *.tbz | *.tbz2)
xz1=$bzip2;; xz1=bzip2;;
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) *[-.][zZ] | *_z | *[-.]gz | *.t[ag]z)
xz1=$gzip;; xz1=gzip;;
*) *)
echo >&2 "$0: $1: Unknown compressed file name suffix" echo >&2 "$0: $1: Unknown compressed file name suffix"
exit 2;; exit 2;;
@ -95,12 +95,12 @@ if test $# -eq 1; then
) )
elif test $# -eq 2; then elif test $# -eq 2; then
case $1 in case $1 in
*[-.]bz2 | *.tbz | *.tbz2) xz1=$bzip2;; *[-.]bz2 | *.tbz | *.tbz2) xz1=bzip2;;
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) xz1=$gzip;; *[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) xz1=gzip;;
esac esac
case $2 in case $2 in
*[-.]bz2 | *.tbz | *.tbz2) xz2=$bzip2;; *[-.]bz2 | *.tbz | *.tbz2) xz2=bzip2;;
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) xz2=$gzip;; *[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) xz2=gzip;;
esac esac
case $1 in case $1 in
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | -) *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | -)

View file

@ -19,11 +19,12 @@
/// \brief Safe realloc() that never returns NULL /// \brief Safe realloc() that never returns NULL
extern void *xrealloc(void *ptr, size_t size); extern void *xrealloc(void *ptr, size_t size)
lzma_attribute((malloc)) lzma_attr_alloc_size(2);
/// \brief Safe strdup() that never returns NULL /// \brief Safe strdup() that never returns NULL
extern char *xstrdup(const char *src); extern char *xstrdup(const char *src) lzma_attribute((malloc));
/// \brief Fancy version of strtoull() /// \brief Fancy version of strtoull()