Better use of TIFFmin() macro to avoid side effects.

This commit is contained in:
Andrey Kiselev 2005-07-01 15:25:41 +00:00
parent 40c424104d
commit 74ff984d58

View File

@ -1,4 +1,4 @@
/* $Id: tif_color.c,v 1.9 2005-01-15 15:42:50 dron Exp $ */ /* $Id: tif_color.c,v 1.10 2005-07-01 15:25:41 dron Exp $ */
/* /*
* Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1988-1997 Sam Leffler
@ -93,16 +93,16 @@ TIFFXYZToRGB(TIFFCIELabToRGB *cielab, float X, float Y, float Z,
Yb = TIFFmax(Yb, cielab->display.d_Y0B); Yb = TIFFmax(Yb, cielab->display.d_Y0B);
/* Turn luminosity to colour value. */ /* Turn luminosity to colour value. */
i = TIFFmin(cielab->range, i = (int)((Yr - cielab->display.d_Y0R) / cielab->rstep);
(int)((Yr - cielab->display.d_Y0R) / cielab->rstep)); i = TIFFmin(cielab->range, i);
*r = RINT(cielab->Yr2r[i]); *r = RINT(cielab->Yr2r[i]);
i = TIFFmin(cielab->range, i = (int)((Yg - cielab->display.d_Y0G) / cielab->gstep);
(int)((Yg - cielab->display.d_Y0G) / cielab->gstep)); i = TIFFmin(cielab->range, i);
*g = RINT(cielab->Yg2g[i]); *g = RINT(cielab->Yg2g[i]);
i = TIFFmin(cielab->range, i = (int)((Yb - cielab->display.d_Y0B) / cielab->bstep);
(int)((Yb - cielab->display.d_Y0B) / cielab->bstep)); i = TIFFmin(cielab->range, i);
*b = RINT(cielab->Yb2b[i]); *b = RINT(cielab->Yb2b[i]);
/* Clip output. */ /* Clip output. */