Revision: 40899
          http://brlcad.svn.sourceforge.net/brlcad/?rev=40899&view=rev
Author:   d_rossberg
Date:     2010-10-05 07:28:04 +0000 (Tue, 05 Oct 2010)

Log Message:
-----------
no C99 idioms please!
put variable declarations to the begin of the section

Modified Paths:
--------------
    brlcad/trunk/src/librt/bundle.c
    brlcad/trunk/src/librt/mkbundle.c

Modified: brlcad/trunk/src/librt/bundle.c
===================================================================
--- brlcad/trunk/src/librt/bundle.c     2010-10-04 20:47:47 UTC (rev 40898)
+++ brlcad/trunk/src/librt/bundle.c     2010-10-05 07:28:04 UTC (rev 40899)
@@ -584,6 +584,15 @@
     struct xray a_ray;
     int (*a_hit)BU_ARGS((struct application *, struct partition *, struct seg 
*));
     int        (*a_miss)BU_ARGS((struct application *));
+
+    struct application *ray_ap = NULL;
+    int ray_index;
+    int hit;
+    struct rt_i        *       rt_i = bundle->b_ap.a_rt_i;             /**< 
@brief  this librt instance */
+    struct resource *  resource = bundle->b_ap.a_resource;     /**< @brief  
dynamic memory resources */
+    struct xrays *r;
+    struct partition_list *pl;
+
     /*
      * temporarily hijack ap->a_uptr,ap->a_ray,ap->a_hit(),ap->a_miss()
      */
@@ -606,12 +615,6 @@
 
     bundle->b_uptr = (genptr_t)pb;
 
-    struct application *ray_ap = NULL;
-    int ray_index;
-    int hit;
-    struct rt_i        *       rt_i = bundle->b_ap.a_rt_i;             /**< 
@brief  this librt instance */
-    struct resource *  resource = bundle->b_ap.a_resource;     /**< @brief  
dynamic memory resources */
-       struct xrays *r;
        for (BU_LIST_FOR (r,xrays,&bundle->b_rays.l)) {
                ray_ap = (struct application *)bu_calloc( 1, sizeof( struct 
application), "ray application structure" );
                *ray_ap = bundle->b_ap; /* structure copy */
@@ -642,7 +645,6 @@
        status = "MISS (unexpected)";
     }
 
-        struct partition_list *pl;
         if (pb->list != NULL) {
                 while (BU_LIST_WHILE(pl, partition_list, &(pb->list->l))) {
                        BU_LIST_DEQUEUE(&(pl->l));
@@ -677,6 +679,7 @@
 {
     register struct partition *pp;
     struct partition_bundle *bundle = (struct partition_bundle *)ap->a_uptr;
+    struct partition_list *new_shotline;
 
     if ( (pp=PartHeadp->pt_forw) == PartHeadp ) {
        bundle->misses++;
@@ -694,7 +697,6 @@
     }
 
     /* add a new partition to list */
-    struct partition_list *new_shotline;
     BU_GETSTRUCT(new_shotline, partition_list);
 
     /* steal partition list */

Modified: brlcad/trunk/src/librt/mkbundle.c
===================================================================
--- brlcad/trunk/src/librt/mkbundle.c   2010-10-04 20:47:47 UTC (rev 40898)
+++ brlcad/trunk/src/librt/mkbundle.c   2010-10-05 07:28:04 UTC (rev 40899)
@@ -143,13 +143,20 @@
     vect_t b_dir;
 
     fastf_t a = MAGNITUDE(avec);
+    fastf_t b = MAGNITUDE(bvec);
+    fastf_t x,y;
+
+    int numrays = ((int)((2.0 *  a) / gridsize) + 1)*((int)((2.0 *  b) / 
gridsize) + 1);
+
+    int first = 1;
+    int acpr = a / gridsize;
+    int bcpr = b / gridsize;
+
     VMOVE(a_dir,avec);
     VUNITIZE(a_dir);
 
-    fastf_t b = MAGNITUDE(bvec);
     VMOVE(b_dir,bvec);
     VUNITIZE(b_dir);
-    fastf_t x,y;
 
     VMOVE(C,center_ray->r_pt);
     VMOVE(dir,center_ray->r_dir);
@@ -157,11 +164,6 @@
     BU_ASSERT(NEAR_ZERO(VDOT(avec,bvec), VUNITIZE_TOL));
     BU_ASSERT(NEAR_ZERO(VDOT(avec,dir), VUNITIZE_TOL));
 
-    int numrays = ((int)((2.0 *  a) / gridsize) + 1)*((int)((2.0 *  b) / 
gridsize) + 1);
-
-    int first = 1;
-    int acpr = a / gridsize;
-    int bcpr = b / gridsize;
     for ( y=gridsize * (-bcpr); y <= b; y=y+gridsize ) {
        for ( x= gridsize * (-acpr); x <= a; x=x+gridsize ) {
            if (((x*x)/(a*a) + (y*y)/(b*b)) < 1) {


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

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to