From 67696b2ac658ddea036a2b6b284df993c8363222 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Sat, 11 Jan 2020 09:58:41 +0200 Subject: io: use min() instead of MIN() --- src/io.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/io.c b/src/io.c index 75c445b..ec7b38a 100644 --- a/src/io.c +++ b/src/io.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -64,7 +63,7 @@ ssize_t apk_istream_read(struct apk_istream *is, void *ptr, size_t size) while (left) { if (is->ptr != is->end) { - r = MIN(left, is->end - is->ptr); + r = min(left, is->end - is->ptr); if (ptr) { memcpy(ptr, is->ptr, r); ptr += r; @@ -505,20 +504,20 @@ ssize_t apk_istream_splice(struct apk_istream *is, int fd, size_t size, else if (r == EBADF || r == EFBIG || r == ENOSPC || r == EIO) return -r; } - bufsz = MIN(bufsz, 2*1024*1024); + bufsz = min(bufsz, 2*1024*1024); buf = mmapbase; } if (mmapbase == MAP_FAILED) { if (!splice_buffer) splice_buffer = malloc(256*1024); buf = splice_buffer; if (!buf) return -ENOMEM; - bufsz = MIN(bufsz, 256*1024); + bufsz = min(bufsz, 256*1024); } while (done < size) { if (cb != NULL) cb(cb_ctx, done); - togo = MIN(size - done, bufsz); + togo = min(size - done, bufsz); r = apk_istream_read(is, buf, togo); if (r <= 0) { if (r) goto err; -- cgit v1.2.3-70-g09d2