[MOAB-dev] r3097 - in MOAB/trunk: . test/perf

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Sat Aug 8 08:47:41 CDT 2009


Author: kraftche
Date: 2009-08-08 08:47:41 -0500 (Sat, 08 Aug 2009)
New Revision: 3097

Modified:
   MOAB/trunk/ReadHDF5.cpp
   MOAB/trunk/ReadHDF5.hpp
   MOAB/trunk/test/perf/seqperf.cpp
Log:
fix warnings

Modified: MOAB/trunk/ReadHDF5.cpp
===================================================================
--- MOAB/trunk/ReadHDF5.cpp	2009-08-08 13:47:29 UTC (rev 3096)
+++ MOAB/trunk/ReadHDF5.cpp	2009-08-08 13:47:41 UTC (rev 3097)
@@ -256,7 +256,7 @@
     filePtr = mhdf_openFile( filename, 0, NULL, &status );
     if (!filePtr)
     {
-      readUtil->report_error( mhdf_message( &status ));
+      readUtil->report_error( "%s", mhdf_message( &status ));
       free( dataBuffer );
       return error(MB_FAILURE);
     }
@@ -978,7 +978,7 @@
   mhdf_closeData( filePtr, data_id, &status );
   if (mhdf_isError( &status ))
   {
-    readUtil->report_error( mhdf_message(&status) );
+    readUtil->report_error( "%s", mhdf_message(&status) );
     return error(MB_FAILURE);
   }
   
@@ -2738,7 +2738,7 @@
       mhdf_getTagValues( filePtr, info.name, hdf_type, info.default_value, info.global_value, &status );
       if (mhdf_isError( &status ))
       {
-        readUtil->report_error( mhdf_message( &status ) );
+        readUtil->report_error( "%s", mhdf_message( &status ) );
         if (hdf_type) H5Tclose( hdf_type );
         return error(MB_FAILURE);
       }

Modified: MOAB/trunk/ReadHDF5.hpp
===================================================================
--- MOAB/trunk/ReadHDF5.hpp	2009-08-08 13:47:29 UTC (rev 3096)
+++ MOAB/trunk/ReadHDF5.hpp	2009-08-08 13:47:41 UTC (rev 3097)
@@ -81,7 +81,7 @@
   inline int is_error( mhdf_Status& status ) {
     int i;
     if ((i = mhdf_isError(&status))) 
-      readUtil->report_error( mhdf_message(&status) );
+      readUtil->report_error( "%s", mhdf_message(&status) );
     return i;
   }
   

Modified: MOAB/trunk/test/perf/seqperf.cpp
===================================================================
--- MOAB/trunk/test/perf/seqperf.cpp	2009-08-08 13:47:29 UTC (rev 3096)
+++ MOAB/trunk/test/perf/seqperf.cpp	2009-08-08 13:47:41 UTC (rev 3097)
@@ -50,8 +50,10 @@
     long r = rand();
     if (count > RAND_MAX) {
       r += RAND_MAX * rand();
-      if (count > ((long)RAND_MAX*RAND_MAX))
-        r += (long)RAND_MAX*(long)RAND_MAX*(long)rand();
+      if (count/RAND_MAX > RAND_MAX) {
+        long t = (long)RAND_MAX * rand();
+        r += (long)RAND_MAX * t;
+      }
     }
     std::swap( array[i], array[r%count] );
   }



More information about the moab-dev mailing list