[cig-commits] r11616 - short/3D/PyLith/trunk/libsrc/meshio

brad at geodynamics.org brad at geodynamics.org
Thu Mar 27 17:40:24 PDT 2008


Author: brad
Date: 2008-03-27 17:40:23 -0700 (Thu, 27 Mar 2008)
New Revision: 11616

Modified:
   short/3D/PyLith/trunk/libsrc/meshio/PsetFileBinary.cc
Log:
Fixed bug in writing 32-bit Pset file. Need to account for differences between int32_t and int.

Modified: short/3D/PyLith/trunk/libsrc/meshio/PsetFileBinary.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/PsetFileBinary.cc	2008-03-27 23:43:31 UTC (rev 11615)
+++ short/3D/PyLith/trunk/libsrc/meshio/PsetFileBinary.cc	2008-03-28 00:40:23 UTC (rev 11616)
@@ -239,7 +239,9 @@
     BinaryIO::swapByteOrder((char*) &sizeIO, 1, sizeof(sizeIO));
   fout.write((char*) &sizeIO, sizeof(sizeIO));
 
-  std::valarray<int32_t> pointsIO(group.points);
+  std::valarray<int32_t> pointsIO(size);
+  for (int i=0; i < size; ++i)
+    pointsIO[i] = group.points[i];
   pointsIO += 1; // switch from zero base to one base
   if (_flipEndian)
     BinaryIO::swapByteOrder((char*) &pointsIO[0], size, sizeof(int32_t));



More information about the cig-commits mailing list