From f600bdbfd5ad7b3d67f82e448050c91621ca955c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 2 Oct 2011 21:52:29 +0000 Subject: make MIN/MAX helpers generally available --- qtbz2.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'qtbz2.c') diff --git a/qtbz2.c b/qtbz2.c index be62d06..f263488 100644 --- a/qtbz2.c +++ b/qtbz2.c @@ -1,7 +1,7 @@ /* * Copyright 2005-2010 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v 1.18 2011/02/28 18:21:42 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v 1.19 2011/10/02 21:52:29 vapier Exp $ * * Copyright 2005-2010 Ned Ludd - * Copyright 2005-2010 Mike Frysinger - @@ -46,7 +46,7 @@ static const char * const qtbz2_opts_help[] = { "Write files to stdout", COMMON_OPTS_HELP }; -static const char qtbz2_rcsid[] = "$Id: qtbz2.c,v 1.18 2011/02/28 18:21:42 vapier Exp $"; +static const char qtbz2_rcsid[] = "$Id: qtbz2.c,v 1.19 2011/10/02 21:52:29 vapier Exp $"; #define qtbz2_usage(ret) usage(ret, QTBZ2_FLAGS, qtbz2_long_opts, qtbz2_opts_help, lookup_applet_idx("qtbz2")) static char tbz2_stdout = 0; @@ -148,7 +148,6 @@ tbz2_compose(int dir_fd, const char *tarbz2, const char *xpak, const char *tbz2) return ret; } -#define _TBZ2_MIN(a,b) (a < b ? : b) static void _tbz2_write_file(FILE *src, int dir_fd, const char *dst, size_t len) { @@ -174,7 +173,7 @@ _tbz2_write_file(FILE *src, int dir_fd, const char *dst, size_t len) out = stdout; do { - this_write = fread(buffer, 1, _TBZ2_MIN(len, sizeof(buffer)), src); + this_write = fread(buffer, 1, MIN(len, sizeof(buffer)), src); fwrite(buffer, 1, this_write, out); len -= this_write; } while (len && this_write); -- cgit v1.2.3-65-gdbad