Revision: 54957
          http://brlcad.svn.sourceforge.net/brlcad/?rev=54957&view=rev
Author:   brlcad
Date:     2013-03-29 03:28:44 +0000 (Fri, 29 Mar 2013)
Log Message:
-----------
quell warning about preserving constness to a matp_t parameter by casting 
_before_ passing.

Modified Paths:
--------------
    brlcad/trunk/src/librt/primitives/nmg/nmg.c

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg.c 2013-03-29 03:21:07 UTC (rev 
54956)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg.c 2013-03-29 03:28:44 UTC (rev 
54957)
@@ -1590,6 +1590,7 @@
        case NMG_KIND_FACE_G_SNURB: {
            struct face_g_snurb *fg = (struct face_g_snurb *)op;
            struct disk_face_g_snurb *d;
+           const matp_t matrix = (const matp_t)mat;
            d = &((struct disk_face_g_snurb *)ip)[iindex];
            NMG_CK_FACE_G_SNURB(fg);
            NMG_CK_DISKMAGIC(d->magic, DISK_FACE_G_SNURB_MAGIC);
@@ -1597,19 +1598,27 @@
            fg->order[0] = ntohl(*(uint32_t*)(d->u_order));
            fg->order[1] = ntohl(*(uint32_t*)(d->v_order));
            fg->u.k_size = ntohl(*(uint32_t*)(d->u_size));
-           fg->u.knots = rt_nmg_import4_fastf(basep, ecnt,
-                                              ntohl(*(uint32_t*)(d->u_knots)), 
(const matp_t)NULL,
-                                              fg->u.k_size, 0);
+           fg->u.knots = rt_nmg_import4_fastf(basep,
+                                              ecnt,
+                                              ntohl(*(uint32_t*)(d->u_knots)),
+                                              (const matp_t)NULL,
+                                              fg->u.k_size,
+                                              0);
            fg->v.k_size = ntohl(*(uint32_t*)(d->v_size));
-           fg->v.knots = rt_nmg_import4_fastf(basep, ecnt,
-                                              ntohl(*(uint32_t*)(d->v_knots)), 
(const matp_t)NULL,
-                                              fg->v.k_size, 0);
+           fg->v.knots = rt_nmg_import4_fastf(basep,
+                                              ecnt,
+                                              ntohl(*(uint32_t*)(d->v_knots)),
+                                              (const matp_t)NULL,
+                                              fg->v.k_size,
+                                              0);
            fg->s_size[0] = ntohl(*(uint32_t*)(d->us_size));
            fg->s_size[1] = ntohl(*(uint32_t*)(d->vs_size));
            fg->pt_type = ntohl(*(uint32_t*)(d->pt_type));
            /* Transform ctl_points by 'mat' */
-           fg->ctl_points = rt_nmg_import4_fastf(basep, ecnt,
-                                                 
ntohl(*(uint32_t*)(d->ctl_points)), (const matp_t)mat,
+           fg->ctl_points = rt_nmg_import4_fastf(basep,
+                                                 ecnt,
+                                                 
ntohl(*(uint32_t*)(d->ctl_points)),
+                                                 matrix,
                                                  fg->s_size[0] * fg->s_size[1],
                                                  fg->pt_type);
        }
@@ -1757,9 +1766,12 @@
            if (eg->order == 0) return 0;
 
            eg->k.k_size = ntohl(*(uint32_t*)(d->k_size));
-           eg->k.knots = rt_nmg_import4_fastf(basep, ecnt,
-                                              ntohl(*(uint32_t*)(d->knots)), 
(const matp_t)NULL,
-                                              eg->k.k_size, 0);
+           eg->k.knots = rt_nmg_import4_fastf(basep,
+                                              ecnt,
+                                              ntohl(*(uint32_t*)(d->knots)),
+                                              (const matp_t)NULL,
+                                              eg->k.k_size,
+                                              0);
            eg->c_size = ntohl(*(uint32_t*)(d->c_size));
            eg->pt_type = ntohl(*(uint32_t*)(d->pt_type));
            /*
@@ -1770,14 +1782,20 @@
                /* UV coords on snurb surface don't get xformed */
                eg->ctl_points = rt_nmg_import4_fastf(basep,
                                                      ecnt,
-                                                     
ntohl(*(uint32_t*)(d->ctl_points)), (const matp_t)NULL,
-                                                     eg->c_size, eg->pt_type);
+                                                     
ntohl(*(uint32_t*)(d->ctl_points)),
+                                                     (const matp_t)NULL,
+                                                     eg->c_size,
+                                                     eg->pt_type);
            } else {
+               const matp_t matrix = (const matp_t)mat;
+
                /* XYZ coords on planar face DO get xformed */
                eg->ctl_points = rt_nmg_import4_fastf(basep,
                                                      ecnt,
-                                                     
ntohl(*(uint32_t*)(d->ctl_points)), (const matp_t)mat,
-                                                     eg->c_size, eg->pt_type);
+                                                     
ntohl(*(uint32_t*)(d->ctl_points)),
+                                                     matrix,
+                                                     eg->c_size,
+                                                     eg->pt_type);
            }
        }
            return 0;

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


------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to