src/DataBuffer.cc

changeset 108
6409ece8297c
parent 96
3384d7aa036a
child 112
def56932f938
--- a/src/DataBuffer.cc	Tue Feb 11 03:29:03 2014 +0200
+++ b/src/DataBuffer.cc	Wed Feb 12 06:15:11 2014 +0200
@@ -32,7 +32,7 @@
 //
 DataBuffer::DataBuffer (int size)
 {
-	SetBuffer (new byte[size]);
+	SetBuffer (new char[size]);
 	SetPosition (&GetBuffer()[0]);
 	SetAllocatedSize (size);
 }
@@ -146,21 +146,9 @@
 
 // ============================================================================
 //
-void DataBuffer::WriteFloat (float a)
-{
-	// TODO: Find a way to store the number without decimal loss.
-	WriteDWord (dhPushNumber);
-	WriteDWord (abs (a));
-
-	if (a < 0)
-		WriteDWord (dhUnaryMinus);
-}
-
-// ============================================================================
-//
 void DataBuffer::WriteStringIndex (const String& a)
 {
-	WriteDWord (dhPushStringIndex);
+	WriteDWord (DH_PushStringIndex);
 	WriteDWord (GetStringTableIndex (a));
 }
 
@@ -193,7 +181,7 @@
 	int newsize = GetAllocatedSize() + bytes + 512;
 
 	delete GetBuffer();
-	SetBuffer (new byte[newsize]);
+	SetBuffer (new char[newsize]);
 	SetAllocatedSize (newsize);
 
 	// Now, copy the stuff back.
@@ -251,4 +239,4 @@
 			return mark;
 
 	return null;
-}
\ No newline at end of file
+}

mercurial