[MOAB-dev] r5917 - MOAB/trunk/tools/dagmc

iulian at mcs.anl.gov iulian at mcs.anl.gov
Fri Dec 14 17:15:04 CST 2012


Author: iulian
Date: 2012-12-14 17:15:04 -0600 (Fri, 14 Dec 2012)
New Revision: 5917

Modified:
   MOAB/trunk/tools/dagmc/cub2h5m.cc
Log:
remove some warnings and also format the source (tabs-> 2 spaces)


Modified: MOAB/trunk/tools/dagmc/cub2h5m.cc
===================================================================
--- MOAB/trunk/tools/dagmc/cub2h5m.cc	2012-12-14 22:06:31 UTC (rev 5916)
+++ MOAB/trunk/tools/dagmc/cub2h5m.cc	2012-12-14 23:15:04 UTC (rev 5917)
@@ -22,156 +22,182 @@
 
 using namespace moab;
 
-void tokenize( const std::string& str,
-	       std::vector<std::string>& tokens,
-	       const char* delimiters )
+void tokenize(const std::string& str, std::vector<std::string>& tokens,
+    const char* delimiters)
 {
-  std::string::size_type last = str.find_first_not_of( delimiters, 0 );
-  std::string::size_type pos  = str.find_first_of( delimiters, last );
-  if ( std::string::npos == pos )
+  std::string::size_type last = str.find_first_not_of(delimiters, 0);
+  std::string::size_type pos = str.find_first_of(delimiters, last);
+  if (std::string::npos == pos)
     tokens.push_back(str);
   else
-    while (std::string::npos != pos && std::string::npos != last) {
-      tokens.push_back( str.substr( last, pos - last ) );
-      last = str.find_first_not_of( delimiters, pos );
-      pos  = str.find_first_of( delimiters, last );
-      if(std::string::npos == pos)
-	pos = str.size();
+    while (std::string::npos != pos && std::string::npos != last)
+    {
+      tokens.push_back(str.substr(last, pos - last));
+      last = str.find_first_not_of(delimiters, pos);
+      pos = str.find_first_of(delimiters, last);
+      if (std::string::npos == pos)
+        pos = str.size();
     }
 }
 
-ErrorCode get_group_names( Interface* MBI,
-                           const EntityHandle group_set,
-                           const Tag nameTag,
-                           std::vector<std::string> &grp_names ) {
-    // get names
+ErrorCode get_group_names(Interface* MBI, const EntityHandle group_set,
+    const Tag nameTag, std::vector<std::string> &grp_names)
+{
+  // get names
   char name0[NAME_TAG_SIZE];
-  std::fill(name0, name0+NAME_TAG_SIZE, '\0');
-  ErrorCode result = MBI->tag_get_data( nameTag, &group_set, 1, &name0);
-  if (MB_SUCCESS != result && MB_TAG_NOT_FOUND != result) return MB_FAILURE;


More information about the moab-dev mailing list