[MOAB-dev] r2091 - MOAB/trunk

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Thu Sep 25 11:40:22 CDT 2008


Author: kraftche
Date: 2008-09-25 11:40:22 -0500 (Thu, 25 Sep 2008)
New Revision: 2091

Modified:
   MOAB/trunk/ReadVtk.cpp
Log:
o fix warning: missing 'return' statement

o fix warning: wrong printf-style format specifier

o use long int parsing built into FileTokenizer


Modified: MOAB/trunk/ReadVtk.cpp
===================================================================
--- MOAB/trunk/ReadVtk.cpp	2008-09-25 16:27:05 UTC (rev 2090)
+++ MOAB/trunk/ReadVtk.cpp	2008-09-25 16:40:22 UTC (rev 2091)
@@ -62,6 +62,7 @@
   MBHash& operator = ( const MBHash& src )
     {
     this->value = src.value;
+    return *this;
     }
   bool operator < ( const MBHash& other ) const
     {
@@ -1236,41 +1237,26 @@
                                             std::vector<MBRange>& entities,
                                             const char* )
 {
-  const char* tok = tokens.get_string( );
-  if (!tok)
-    return MB_FAILURE;
   long num_fields;
-  const char* end = 0;
-  num_fields = strtol( tok, (char**)&end, 0 );
-  if ( *end )
+  if (!tokens.get_long_ints(1, &num_fields))
     return MB_FAILURE;
 
   long i;
   for ( i = 0; i < num_fields; ++ i )
     {
-    tok = tokens.get_string( );
+    const char* tok = tokens.get_string( );
     if ( ! tok )
       return MB_FAILURE;
 
     std::string name_alloc( tok );
 
     long num_comp;
-    tok = tokens.get_string( );
-    if ( ! tok )
+    if (!tokens.get_long_ints( 1, &num_comp))
       return MB_FAILURE;
-    end = 0;
-    num_comp = strtol( tok, (char**)&end, 0 );
-    if ( *end )
-      return MB_FAILURE;
 
     long num_tuples;
-    tok = tokens.get_string( );
-    if ( ! tok )
+    if (!tokens.get_long_ints( 1, &num_tuples))
       return MB_FAILURE;
-    end = 0;
-    num_tuples = strtol( tok, (char**)&end, 0 );
-    if ( *end )
-      return MB_FAILURE;
 
     int type = tokens.match_token( vtk_type_names );
     if (!type)
@@ -1280,8 +1266,8 @@
     if ( ( result = vtk_read_tag_data( tokens, type, num_comp, entities, name_alloc.c_str() ) ) != MB_SUCCESS )
       {
       readMeshIface->report_error(
-        "Error reading data for field \"%s\" (%d components, %d tuples, type %d) at line %d",
-        name_alloc.c_str(), num_comp, num_tuples, type, tokens.line_number());
+        "Error reading data for field \"%s\" (%ld components, %ld tuples, type %d) at line %d",
+        name_alloc.c_str(), num_comp, num_tuples, (int)type, tokens.line_number());
       return result;
       }
     }




More information about the moab-dev mailing list