[MOAB-dev] r4582 - MOAB/trunk/src/io

jvporter at wisc.edu jvporter at wisc.edu
Fri Mar 11 03:07:47 CST 2011


Author: jvporter
Date: 2011-03-11 03:07:47 -0600 (Fri, 11 Mar 2011)
New Revision: 4582

Modified:
   MOAB/trunk/src/io/ReadNC.cpp
Log:
Fix ReadNC warnings properly (I hope...)


Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp	2011-03-11 08:02:57 UTC (rev 4581)
+++ MOAB/trunk/src/io/ReadNC.cpp	2011-03-11 09:07:47 UTC (rev 4582)
@@ -500,8 +500,9 @@
       case NC_DOUBLE:
       case NC_FLOAT:
           ddata = (double*)data;
-          if (!verts.empty())
-            dmin = ddata[0], dmax = ddata[0];
+          if (verts.empty()) break;
+
+          dmin = dmax = ddata[0];
           for (unsigned int i = 1; i < verts.size(); i++) {
             if (ddata[i] < dmin) dmin = ddata[i];
             if (ddata[i] > dmax) dmax = ddata[i];
@@ -511,8 +512,9 @@
       case NC_INT:
       case NC_SHORT:
           idata = (int*)data;
-          if (!verts.empty())
-            imin = idata[0], imax = idata[0];
+          if (verts.empty()) break;
+
+          imin = imax = idata[0];
           for (unsigned int i = 1; i < verts.size(); i++) {
             if (idata[i] < imin) imin = idata[i];
             if (idata[i] > imax) imax = idata[i];

























More information about the moab-dev mailing list