[MOAB-dev] r5452 - MOAB/trunk/itaps/imesh

tautges at mcs.anl.gov tautges at mcs.anl.gov
Mon Mar 26 16:55:26 CDT 2012


Author: tautges
Date: 2012-03-26 16:55:26 -0500 (Mon, 26 Mar 2012)
New Revision: 5452

Modified:
   MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
Log:
When passing the same pointer as allocated and occupied size both, don't
divide by entity size twice in type-specific tag get functions.



Modified: MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
===================================================================
--- MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp	2012-03-26 07:01:54 UTC (rev 5451)
+++ MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp	2012-03-26 21:55:26 UTC (rev 5452)
@@ -1957,7 +1957,7 @@
                      tag_values_allocated,
                      tag_values_size, err);
     *tag_values_allocated /= sizeof(int);
-    *tag_values_size /= sizeof(int);
+    if (tag_values_size != tag_values_allocated) *tag_values_size /= sizeof(int);
   }
 
   void iMesh_getDblArrData (iMesh_Instance instance,
@@ -1976,7 +1976,7 @@
                      tag_values,
                      tag_values_allocated, tag_values_size, err);
     *tag_values_allocated /= sizeof(double);
-    *tag_values_size /= sizeof(double);
+    if (tag_values_size != tag_values_allocated) *tag_values_size /= sizeof(double);
   }
 
   void iMesh_getEHArrData (iMesh_Instance instance,
@@ -1996,7 +1996,7 @@
                      tag_value_allocated,
                      tag_value_size, err);
     *tag_value_allocated /= sizeof(iBase_EntityHandle);
-    *tag_value_size /= sizeof(iBase_EntityHandle);
+    if (tag_value_size != tag_value_allocated) *tag_value_size /= sizeof(iBase_EntityHandle);
   }
 
   void iMesh_getESHArrData (iMesh_Instance instance,
@@ -2016,7 +2016,7 @@
                      tag_value_allocated,
                      tag_value_size, err);
     *tag_value_allocated /= sizeof(iBase_EntityHandle);
-    *tag_value_size /= sizeof(iBase_EntityHandle);
+    if (tag_value_size != tag_value_allocated) *tag_value_size /= sizeof(iBase_EntityHandle);
   }
 
   void iMesh_setArrData (iMesh_Instance instance,













More information about the moab-dev mailing list