--- ray/src/common/tmapluv.c 2003/02/25 02:47:22 3.5 +++ ray/src/common/tmapluv.c 2003/07/15 07:28:09 3.8 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: tmapluv.c,v 3.5 2003/02/25 02:47:22 greg Exp $"; +static const char RCSid[] = "$Id: tmapluv.c,v 3.8 2003/07/15 07:28:09 greg Exp $"; #endif /* * Routines for tone-mapping LogLuv encoded pixels. @@ -18,14 +18,11 @@ static const char RCSid[] = "$Id: tmapluv.c,v 3.5 2003 #include "tmprivat.h" #include "tmaptiff.h" -#ifndef BSD -#define bzero(d,n) (void)memset(d,0,n) -#endif #define uvflgop(p,uv,op) ((p)->rgbflg[(uv)>>5] op (1L<<((uv)&0x1f))) #define isuvset(p,uv) uvflgop(p,uv,&) #define setuv(p,uv) uvflgop(p,uv,|=) #define clruv(p,uv) uvflgop(p,uv,&=~) -#define clruvall(p) bzero((MEM_PTR)(p)->rgbflg,sizeof((p)->rgbflg)) +#define clruvall(p) memset((MEM_PTR)(p)->rgbflg,'\0',sizeof((p)->rgbflg)) #ifdef NOPROTO static MEM_PTR luv32Init(); @@ -218,7 +215,7 @@ int len; continue; /* get chrominance */ if (tmTop->flags & TM_F_MESOPIC && ls[i] < BMESUPPER) { - if (uv_decode(uvp, uvp+1, luvs[i]&0x3fff) < 0) { + if (uv_decode(&uvp[0], &uvp[1], luvs[i]&0x3fff) < 0) { uvp[0] = U_NEU; /* should barf? */ uvp[1] = V_NEU; } @@ -228,7 +225,8 @@ int len; SGILOGENCODE_NODITHER)) < 0) j = uv14neu; } else { - j = tmTop->flags&TM_F_BW ? uv14neu : luvs[i]&0x3fff; + j = tmTop->flags&TM_F_BW ? uv14neu : + (int)(luvs[i]&0x3fff); } if (!isuvset(ld, j)) { if (uv_decode(&uvp[0], &uvp[1], j) < 0) {