From 94d3ece8d8168066e02dee0d7dce481518c678cb Mon Sep 17 00:00:00 2001 From: Andrey Kiselev Date: Wed, 22 Sep 2004 13:48:20 +0000 Subject: [PATCH] Implemented TIFFhowmany8() macro. --- libtiff/tiffiop.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libtiff/tiffiop.h b/libtiff/tiffiop.h index 56598da1..0f314cb9 100644 --- a/libtiff/tiffiop.h +++ b/libtiff/tiffiop.h @@ -1,4 +1,4 @@ -/* $Id: tiffiop.h,v 1.25 2004-09-14 07:01:49 dron Exp $ */ +/* $Id: tiffiop.h,v 1.26 2004-09-22 13:48:20 dron Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -206,9 +206,9 @@ struct tiff { (TIFFWriteFile(tif, (tdata_t) buf, (tsize_t) size) == (tsize_t) size) #endif -/* NB: the uint32 casts are to silence certain ANSI-C compilers */ -#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) -#define TIFFroundup(x, y) (TIFFhowmany(x,y)*((uint32)(y))) +#define TIFFhowmany(x, y) (((x)+((y)-1))/(y)) +#define TIFFhowmany8(x) (((x)&0x07)?((x)>>3)+1:(x)>>3) +#define TIFFroundup(x, y) (TIFFhowmany(x,y)*(y)) #define TIFFmax(A,B) ((A)>(B)?(A):(B)) #define TIFFmin(A,B) ((A)<(B)?(A):(B))