[brlcad-commits] SF.net SVN: brlcad:[50137] brlcad/trunk/src/liboptical/sh_toyota.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2012-04-17 17:48:30
|
Revision: 50137 http://brlcad.svn.sourceforge.net/brlcad/?rev=50137&view=rev Author: brlcad Date: 2012-04-17 17:48:20 +0000 (Tue, 17 Apr 2012) Log Message: ----------- probably wont fix the overflow issues but should pinpoint how many coverity is detecting. Modified Paths: -------------- brlcad/trunk/src/liboptical/sh_toyota.c Modified: brlcad/trunk/src/liboptical/sh_toyota.c =================================================================== --- brlcad/trunk/src/liboptical/sh_toyota.c 2012-04-17 17:36:08 UTC (rev 50136) +++ brlcad/trunk/src/liboptical/sh_toyota.c 2012-04-17 17:48:20 UTC (rev 50137) @@ -1826,6 +1826,7 @@ char mfile[80]; fastf_t a, l, absorp, absorp_h, absorp_l, lambda_h, lambda_l; + fastf_t abso1, lamb1, lamb2; FILE *fp; int n; @@ -1860,8 +1861,12 @@ fclose(fp); - absorp = (absorp_h - absorp_l)*(lambda - lambda_l) /(lambda_h - lambda_l); - return ( absorp > (DBL_MAX - absorp_l) ) ? DBL_MAX : absorp + absorp_l; + abso1 = absorp_h - absorp_l; + lamb1 = lambda - lambda_l; + lamb2 = lambda_h - lambda_l; + absorp = abso1 * lamb1 / lamb2; + absorp += absorp_l; + return absorp; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |