[cig-commits] r15645 - long/3D/SNAC/trunk/StGermain/Base/Automation/src

echoi at geodynamics.org echoi at geodynamics.org
Thu Sep 3 21:37:01 PDT 2009


Author: echoi
Date: 2009-09-03 21:37:00 -0700 (Thu, 03 Sep 2009)
New Revision: 15645

Modified:
   long/3D/SNAC/trunk/StGermain/Base/Automation/src/VariableDumpStream.c
Log:
_VariableDumpStream_Dump was hardwired to read double variables as float.
As a first step to release this limit, int type is now supported.


Modified: long/3D/SNAC/trunk/StGermain/Base/Automation/src/VariableDumpStream.c
===================================================================
--- long/3D/SNAC/trunk/StGermain/Base/Automation/src/VariableDumpStream.c	2009-09-03 17:24:47 UTC (rev 15644)
+++ long/3D/SNAC/trunk/StGermain/Base/Automation/src/VariableDumpStream.c	2009-09-04 04:37:00 UTC (rev 15645)
@@ -142,7 +142,6 @@
 	int* loop = (int*)_loop;
 	float tmp;
 	
-	
 	if ( self->data == NULL || self->numItems == 0 )
 	{
 		return True;
@@ -170,11 +169,20 @@
 			}
 		}
 		else {
-			tmp = Variable_GetValueDoubleAsFloat( self->data, varI );
-			self->_write(
-				stream,
-				&tmp,
-				sizeof(float), 1 );
+			if( *self->data->dataTypes == Variable_DataType_Int ) {
+				int tmp1 = Variable_GetValueInt( self->data, varI );
+				self->_write(
+					stream,
+					&tmp1,
+					sizeof(int), 1 );
+			}
+			else {
+				tmp = Variable_GetValueDoubleAsFloat( self->data, varI );
+				self->_write(
+					stream,
+					&tmp,
+					sizeof(float), 1 );
+			}
 		}
 	}
 



More information about the CIG-COMMITS mailing list