Revision: 42167
http://brlcad.svn.sourceforge.net/brlcad/?rev=42167&view=rev
Author: brlcad
Date: 2011-01-12 19:44:40 +0000 (Wed, 12 Jan 2011)
Log Message:
-----------
'new' might be used before initialized so initialize it, but rename it too
because 'new' makes the c++ compilers angry.
Modified Paths:
--------------
brlcad/trunk/src/anim/anim_time.c
Modified: brlcad/trunk/src/anim/anim_time.c
===================================================================
--- brlcad/trunk/src/anim/anim_time.c 2011-01-12 19:38:56 UTC (rev 42166)
+++ brlcad/trunk/src/anim/anim_time.c 2011-01-12 19:44:40 UTC (rev 42167)
@@ -62,29 +62,31 @@
gettime(fastf_t dist, fastf_t a, fastf_t b, fastf_t c, fastf_t init)
{
- fastf_t old, new, temp;
+ fastf_t oldtime = 0.0;
+ fastf_t newtime = 0.0;
+ fastf_t temp = 0.0;
int countdown, success;
- countdown = MAXITS;
- old = init;
success = 0;
+ countdown = MAXITS;
+ oldtime = init;
while (countdown-->0) {
- temp = (3.0*a*old+2.0*b)*old+c;
+ temp = (3.0*a*oldtime+2.0*b)*oldtime+c;
if (temp<VDIVIDE_TOL) {
- new = 0.75*old;
+ newtime = 0.75*oldtime;
} else {
- new = old - (((a*old+b)*old+c)*old-dist)/temp;
+ newtime = oldtime - (((a*oldtime+b)*oldtime+c)*oldtime-dist)/temp;
}
- if (((new-old)<DELTA)&&((old-new)<DELTA)) {
+ if (((newtime-oldtime)<DELTA)&&((oldtime-newtime)<DELTA)) {
success = 1;
break;
}
if (debug)
- printf("c: %d %f\t%f\n", countdown, new, new-old);
- old = new;
+ printf("c: %d %f\t%f\n", countdown, newtime, newtime-oldtime);
+ oldtime = newtime;
}
if (!success) fprintf(stderr, "warning - max iterations reached\n");
- return new;
+ return newtime;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits