Revision: 52713
          http://brlcad.svn.sourceforge.net/brlcad/?rev=52713&view=rev
Author:   brlcad
Date:     2012-10-03 12:09:15 +0000 (Wed, 03 Oct 2012)
Log Message:
-----------
scan into double, copy into fastf_t

Modified Paths:
--------------
    brlcad/trunk/src/libged/center.c
    brlcad/trunk/src/libged/combmem.c

Modified: brlcad/trunk/src/libged/center.c
===================================================================
--- brlcad/trunk/src/libged/center.c    2012-10-03 10:54:17 UTC (rev 52712)
+++ brlcad/trunk/src/libged/center.c    2012-10-03 12:09:15 UTC (rev 52713)
@@ -67,20 +67,24 @@
            return GED_ERROR;
        }
     } else {
-       if (sscanf(argv[1], "%lf", &center[X]) != 1) {
+       double scan[3];
+
+       if (sscanf(argv[1], "%lf", &scan[X]) != 1) {
            bu_vls_printf(gedp->ged_result_str, "ged_center: bad X value - 
%s\n", argv[1]);
            return GED_ERROR;
        }
 
-       if (sscanf(argv[2], "%lf", &center[Y]) != 1) {
+       if (sscanf(argv[2], "%lf", &scan[Y]) != 1) {
            bu_vls_printf(gedp->ged_result_str, "ged_center: bad Y value - 
%s\n", argv[2]);
            return GED_ERROR;
        }
 
-       if (sscanf(argv[3], "%lf", &center[Z]) != 1) {
+       if (sscanf(argv[3], "%lf", &scan[Z]) != 1) {
            bu_vls_printf(gedp->ged_result_str, "ged_center: bad Z value - 
%s\n", argv[3]);
            return GED_ERROR;
        }
+
+       VMOVE(center, scan);
     }
 
     VSCALE(center, center, gedp->ged_wdbp->dbip->dbi_local2base);

Modified: brlcad/trunk/src/libged/combmem.c
===================================================================
--- brlcad/trunk/src/libged/combmem.c   2012-10-03 10:54:17 UTC (rev 52712)
+++ brlcad/trunk/src/libged/combmem.c   2012-10-03 12:09:15 UTC (rev 52713)
@@ -558,10 +558,10 @@
     tree_index = 0;
     for (i = 2; i < (size_t)argc; i += 15) {
        mat_t mat;
-       fastf_t az, el, tw;
-       fastf_t tx, ty, tz;
-       fastf_t sa, sx, sy, sz;
-       fastf_t kx, ky, kz;
+       double az, el, tw;
+       double tx, ty, tz;
+       double sa, sx, sy, sz;
+       double kx, ky, kz;
        hvect_t svec = HINIT_ZERO;
        point_t key_pt = VINIT_ZERO;
        vect_t aetvec = VINIT_ZERO;
@@ -605,10 +605,16 @@
        RT_TREE_INIT(tp);
        COMBMEM_SET_PART_III(tp, tree, rt_tree_array, tree_index, argv[i+1]);
 
-       if (etype == ETYPES_REL && tree_index < old_node_count && 
old_rt_tree_array[tree_index].tl_tree->tr_l.tl_mat &&
-           BU_STR_EQUAL(old_rt_tree_array[tree_index].tl_tree->tr_l.tl_name, 
tp->tr_l.tl_name)) {
+       if (etype == ETYPES_REL
+           && tree_index < old_node_count
+           && old_rt_tree_array[tree_index].tl_tree->tr_l.tl_mat
+           && 
BU_STR_EQUAL(old_rt_tree_array[tree_index].tl_tree->tr_l.tl_name, 
tp->tr_l.tl_name))
+       {
+           fastf_t azf = az, elf = el, twf = tw;
+           fastf_t txf = tx, tyf = ty, tzf = tz;
+           fastf_t saf = sa, sxf = sx, syf = sy, szf = sz;
 
-           COMBMEM_CHECK_MAT(tp, tree_index, old_rt_tree_array, mat, aetvec, 
tvec, svec, key_pt, az, el, tw, tx, ty, tz, sa, sx, sy, sz);
+           COMBMEM_CHECK_MAT(tp, tree_index, old_rt_tree_array, mat, aetvec, 
tvec, svec, key_pt, azf, elf, twf, txf, tyf, tzf, saf, sxf, syf, szf);
        } else {
            MAT_COPY(tp->tr_l.tl_mat, mat);
        }
@@ -655,8 +661,8 @@
     tree_index = 0;
     for (i = 2; i < (size_t)argc; i += 8) {
        mat_t mat;
-       fastf_t az, el, tw;
-       fastf_t kx, ky, kz;
+       double az, el, tw;
+       double kx, ky, kz;
        point_t key_pt = VINIT_ZERO;
 
        COMBMEM_SET_PART_II(gedp, argv, op, i, rt_tree_array, tree_index, mat);
@@ -688,15 +694,18 @@
        RT_TREE_INIT(tp);
        COMBMEM_SET_PART_III(tp, tree, rt_tree_array, tree_index, argv[i+1]);
 
-       if (tree_index < old_node_count && 
old_rt_tree_array[tree_index].tl_tree->tr_l.tl_mat &&
-           BU_STR_EQUAL(old_rt_tree_array[tree_index].tl_tree->tr_l.tl_name, 
tp->tr_l.tl_name)) {
+       if (tree_index < old_node_count
+           && old_rt_tree_array[tree_index].tl_tree->tr_l.tl_mat
+           && 
BU_STR_EQUAL(old_rt_tree_array[tree_index].tl_tree->tr_l.tl_name, 
tp->tr_l.tl_name))
+       {
+           fastf_t azf = az, elf = el, twf = tw;
            fastf_t tx, ty, tz;
            fastf_t sa, sx, sy, sz;
            hvect_t svec = HINIT_ZERO;
            vect_t aetvec = VINIT_ZERO;
            vect_t tvec = VINIT_ZERO;
 
-           COMBMEM_CHECK_MAT(tp, tree_index, old_rt_tree_array, mat, aetvec, 
tvec, svec, key_pt, az, el, tw, tx, ty, tz, sa, sx, sy, sz);
+           COMBMEM_CHECK_MAT(tp, tree_index, old_rt_tree_array, mat, aetvec, 
tvec, svec, key_pt, azf, elf, twf, tx, ty, tz, sa, sx, sy, sz);
        } else {
            MAT_COPY(tp->tr_l.tl_mat, mat);
        }
@@ -738,9 +747,9 @@
     tree_index = 0;
     for (i = 2; i < (size_t)argc; i += 9) {
        mat_t mat;
-       fastf_t px, py, pz;
-       fastf_t dx, dy, dz;
-       fastf_t ang;
+       double px, py, pz;
+       double dx, dy, dz;
+       double ang;
        vect_t dir;
        point_t pt;
 
@@ -818,7 +827,7 @@
     tree_index = 0;
     for (i = 2; i < (size_t)argc; i += 5) {
        mat_t mat;
-       fastf_t tx, ty, tz;
+       double tx, ty, tz;
        vect_t tvec = VINIT_ZERO;
 
        COMBMEM_SET_PART_II(gedp, argv, op, i, rt_tree_array, tree_index, mat);
@@ -881,8 +890,8 @@
     tree_index = 0;
     for (i = 2; i < (size_t)argc; i += 9) {
        mat_t mat;
-       fastf_t sa, sx, sy, sz;
-       fastf_t kx, ky, kz;
+       double sa, sx, sy, sz;
+       double kx, ky, kz;
        hvect_t svec = HINIT_ZERO;
        point_t key_pt = VINIT_ZERO;
        vect_t aetvec = VINIT_ZERO;
@@ -913,12 +922,15 @@
        RT_TREE_INIT(tp);
        COMBMEM_SET_PART_III(tp, tree, rt_tree_array, tree_index, argv[i+1]);
 
-       if (tree_index < old_node_count && 
old_rt_tree_array[tree_index].tl_tree->tr_l.tl_mat &&
-           BU_STR_EQUAL(old_rt_tree_array[tree_index].tl_tree->tr_l.tl_name, 
tp->tr_l.tl_name)) {
+       if (tree_index < old_node_count
+           && old_rt_tree_array[tree_index].tl_tree->tr_l.tl_mat
+           && 
BU_STR_EQUAL(old_rt_tree_array[tree_index].tl_tree->tr_l.tl_name, 
tp->tr_l.tl_name))
+       {
            fastf_t az, el, tw;
            fastf_t tx, ty, tz;
+           fastf_t saf = sa, sxf = sx, syf = sy, szf = sz;
 
-           COMBMEM_CHECK_MAT(tp, tree_index, old_rt_tree_array, mat, aetvec, 
tvec, svec, key_pt, az, el, tw, tx, ty, tz, sa, sx, sy, sz);
+           COMBMEM_CHECK_MAT(tp, tree_index, old_rt_tree_array, mat, aetvec, 
tvec, svec, key_pt, az, el, tw, tx, ty, tz, saf, sxf, syf, szf);
        } else {
            MAT_COPY(tp->tr_l.tl_mat, mat);
        }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to