[MOAB-dev] r4408 - MOAB/trunk/src

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Wed Dec 22 15:37:11 CST 2010


Author: kraftche
Date: 2010-12-22 15:37:11 -0600 (Wed, 22 Dec 2010)
New Revision: 4408

Modified:
   MOAB/trunk/src/Core.cpp
Log:
return MB_ALREADY_ALLOCATED from new tag_get_handle if default values don't match

Modified: MOAB/trunk/src/Core.cpp
===================================================================
--- MOAB/trunk/src/Core.cpp	2010-12-22 18:56:14 UTC (rev 4407)
+++ MOAB/trunk/src/Core.cpp	2010-12-22 21:37:11 UTC (rev 4408)
@@ -1986,6 +1986,12 @@
     // check sizes
     if (!(flags & TAG_VARLEN) && tag_handle->get_size() != size)
       return MB_INVALID_SIZE;
+      
+    // If user passed a default value, check that it matches.  
+    // If user did not pass a default value, assume they're OK
+    // with the existing one.
+    if (default_value && !tag_handle->equals_default_value(default_value,size))
+      return MB_ALREADY_ALLOCATED;
     
     return MB_SUCCESS;
   }




































More information about the moab-dev mailing list