Revision: 65154
http://sourceforge.net/p/brlcad/code/65154
Author: carlmoore
Date: 2015-06-02 16:51:46 +0000 (Tue, 02 Jun 2015)
Log Message:
-----------
if using ABS, still need numop++, but don't care about that member of val;
also, in 2 places, if we are being kicked out of program, don't care about that
member of op array
Modified Paths:
--------------
brlcad/trunk/src/util/bwmod.c
Modified: brlcad/trunk/src/util/bwmod.c
===================================================================
--- brlcad/trunk/src/util/bwmod.c 2015-06-02 15:50:21 UTC (rev 65153)
+++ brlcad/trunk/src/util/bwmod.c 2015-06-02 16:51:46 UTC (rev 65154)
@@ -93,28 +93,31 @@
val[ numop++ ] = atof(bu_optarg);
break;
case 'd':
- op[ numop ] = MULT;
d = atof(bu_optarg);
-
if (ZERO(d)) {
bu_exit(2, "bwmod: cannot divide by zero!\n");
}
+ op[ numop ] = MULT;
val[ numop++ ] = 1.0 / d;
break;
case 'A':
op[ numop ] = ABS;
- val[ numop++ ] = 0;
+/* If using ABS, don't care what val[ numop ] is, but still must increment
numop.
+ * (The following would increment numop AFTER it's used as "val" subscript.)
+ */
+/* val[ numop++ ] = 0.0; */
+ numop++;
break;
case 'e':
op[ numop ] = POW;
val[ numop++ ] = atof(bu_optarg);
break;
case 'r':
- op[ numop ] = POW;
d = atof(bu_optarg);
if (ZERO(d)) {
bu_exit(2, "bwmod: zero root!\n");
}
+ op[ numop ] = POW;
val[ numop++ ] = 1.0 / d;
break;
case 'c':
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits