From efffb31a794cc846d147095e7d7e3d1081502860 Mon Sep 17 00:00:00 2001 From: Andrey Kiselev Date: Fri, 9 Dec 2005 12:58:08 +0000 Subject: [PATCH] Added TIFFArraySize macro. --- libtiff/tif_luv.c | 6 +++--- libtiff/tiffiop.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libtiff/tif_luv.c b/libtiff/tif_luv.c index cdaffbb5..376174cf 100644 --- a/libtiff/tif_luv.c +++ b/libtiff/tif_luv.c @@ -1,4 +1,4 @@ -/* $Id: tif_luv.c,v 1.13 2004-10-12 18:50:48 dron Exp $ */ +/* $Id: tif_luv.c,v 1.14 2005-12-09 12:58:08 dron Exp $ */ /* * Copyright (c) 1997 Greg Ward Larson @@ -173,7 +173,6 @@ struct logLuvState { #define DecoderState(tif) ((LogLuvState*) (tif)->tif_data) #define EncoderState(tif) ((LogLuvState*) (tif)->tif_data) -#define N(a) (sizeof(a)/sizeof(a[0])) #define SGILOGDATAFMT_UNKNOWN -1 #define MINRUN 4 /* minimum run length */ @@ -1584,7 +1583,8 @@ TIFFInitSGILog(TIFF* tif, int scheme) tif->tif_cleanup = LogLuvCleanup; /* override SetField so we can handle our private pseudo-tag */ - _TIFFMergeFieldInfo(tif, LogLuvFieldInfo, N(LogLuvFieldInfo)); + _TIFFMergeFieldInfo(tif, LogLuvFieldInfo, + TIFFArraySize(LogLuvFieldInfo)); sp->vgetparent = tif->tif_tagmethods.vgetfield; tif->tif_tagmethods.vgetfield = LogLuvVGetField; /* hook for codec tags */ sp->vsetparent = tif->tif_tagmethods.vsetfield; diff --git a/libtiff/tiffiop.h b/libtiff/tiffiop.h index f00efce6..4e3bca80 100644 --- a/libtiff/tiffiop.h +++ b/libtiff/tiffiop.h @@ -1,4 +1,4 @@ -/* $Id: tiffiop.h,v 1.41 2005-11-03 18:22:58 fwarmerdam Exp $ */ +/* $Id: tiffiop.h,v 1.42 2005-12-09 12:58:08 dron Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -229,6 +229,8 @@ struct tiff { #define TIFFmax(A,B) ((A)>(B)?(A):(B)) #define TIFFmin(A,B) ((A)<(B)?(A):(B)) +#define TIFFArraySize(a) (sizeof (a) / sizeof ((a)[0])) + #if defined(__cplusplus) extern "C" { #endif