sources/network/bytestream.cpp

changeset 10
3874575d924d
parent 9
e7a09ceb4505
child 11
cffa2777d917
--- a/sources/network/bytestream.cpp	Thu Dec 11 16:17:35 2014 +0200
+++ b/sources/network/bytestream.cpp	Fri Dec 12 00:55:51 2014 +0200
@@ -124,13 +124,13 @@
 		return false;
 	}
 
-	short int val = 0;
+	short int result = 0;
 
 	for (int i = 0; i < 2; ++i)
-		val |= *m_cursor++ << (i * 8);
+		result |= m_cursor[i] << (i * 8);
 
-	*ok = true;
-	return true;
+	m_cursor += 2;
+	return result;
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -143,13 +143,13 @@
 		return -1;
 	}
 
-	long int val = 0;
+	long int result = 0;
 
 	for (int i = 0; i < 4; ++i)
-		val |= *m_cursor++ << (i * 8);
+		result |= m_cursor[i] << (i * 8);
 
-	*ok = true;
-	return val;
+	m_cursor += 4;
+	return result;
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -188,7 +188,6 @@
 	}
 
 	m_cursor = stringEnd + 1;
-	*ok = true;
 	unsigned int length = stringEnd - m_cursor;
 
 	// ensure we won't write past the buffer (note: we still moved
@@ -214,7 +213,6 @@
 
 	memcpy (buffer, m_cursor, length);
 	m_cursor += length;
-	*ok = true;
 }
 
 // -------------------------------------------------------------------------------------------------

mercurial