[MOAB-dev] r5921 - MOAB/trunk/itaps/igeom

iulian at mcs.anl.gov iulian at mcs.anl.gov
Mon Dec 17 18:37:02 CST 2012


Author: iulian
Date: 2012-12-17 18:37:02 -0600 (Mon, 17 Dec 2012)
New Revision: 5921

Modified:
   MOAB/trunk/itaps/igeom/FBiGeom_MOAB.cpp
Log:
eliminate warnings;
usually the "size" variables were not returned before
the allocation happens either in each function (see CHECK_SIZE macro), or the
user allocates it in advance


Modified: MOAB/trunk/itaps/igeom/FBiGeom_MOAB.cpp
===================================================================
--- MOAB/trunk/itaps/igeom/FBiGeom_MOAB.cpp	2012-12-17 21:59:54 UTC (rev 5920)
+++ MOAB/trunk/itaps/igeom/FBiGeom_MOAB.cpp	2012-12-18 00:37:02 UTC (rev 5921)
@@ -387,6 +387,8 @@
     index1 += index1_step;
     index2 += index2_step;
   }
+  // it is now safe to set the size
+  *is_adjacent_info_size = count;
 
   RETURN(iBase_SUCCESS);
 }
@@ -410,21 +412,22 @@
                              int* on_coordinates_allocated, int* on_coordinates_size, int* err) {
   CHECK_SIZE(*on_coordinates, *on_coordinates_allocated,
              near_coordinates_size, double, NULL);
+
   for (int i = 0; i < entity_handles_size; i++) {
     if (storage_order == iBase_INTERLEAVED) {
-      FBiGeom_getEntClosestPt(instance, entity_handles[i], near_coordinates[3
-                                                                            * i], near_coordinates[3 * i + 1], near_coordinates[3 * i + 2],
-                              on_coordinates[3 * i], on_coordinates[3 * i + 1],
-                              on_coordinates[3 * i + 2], err);
+      FBiGeom_getEntClosestPt(instance, entity_handles[i],
+          near_coordinates[3*i], near_coordinates[3*i+1], near_coordinates[3*i+2],
+          on_coordinates[3*i], on_coordinates[3*i+1], on_coordinates[3*i+2],
+          err);
     } else if (storage_order == iBase_BLOCKED) {
       FBiGeom_getEntClosestPt(instance, entity_handles[i],
-                              near_coordinates[i], near_coordinates[i + entity_handles_size],
-                              near_coordinates[i + 2 * entity_handles_size],
-                              on_coordinates[i], on_coordinates[i + entity_handles_size],
-                              on_coordinates[i + 2 * entity_handles_size], err);
+          near_coordinates[i], near_coordinates[i+entity_handles_size], near_coordinates[i+2*entity_handles_size],
+          on_coordinates[i], on_coordinates[i+entity_handles_size], on_coordinates[i+2*entity_handles_size],
+          err);
     }
     FWDERR();
   }
+  *on_coordinates_size = near_coordinates_size;
 
   RETURN(iBase_SUCCESS);
 }
@@ -503,7 +506,7 @@
     norm_y += norm_step;
     norm_z += norm_step;
   }
-
+  *normals_size = count;
   RETURN(iBase_SUCCESS);


More information about the moab-dev mailing list