summaryrefslogtreecommitdiff
path: root/src/serializerbinary.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-11-26 00:44:26 +0000
committerMike Buland <eichlan@xagasoft.com>2006-11-26 00:44:26 +0000
commit6ede639c090aa80ba5e9b6be631b87727d741fbe (patch)
tree5b6038d56f1525917f43b8611ccb22891c7c1519 /src/serializerbinary.cpp
parent61c71a9f23a094d7d03ecdf8f36b4a3bbadc7fd4 (diff)
downloadlibbu++-6ede639c090aa80ba5e9b6be631b87727d741fbe.tar.gz
libbu++-6ede639c090aa80ba5e9b6be631b87727d741fbe.tar.bz2
libbu++-6ede639c090aa80ba5e9b6be631b87727d741fbe.tar.xz
libbu++-6ede639c090aa80ba5e9b6be631b87727d741fbe.zip
Serializers are in debug mode, beware.
Diffstat (limited to '')
-rw-r--r--src/serializerbinary.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/serializerbinary.cpp b/src/serializerbinary.cpp
index bfe3cc9..cb3c8bf 100644
--- a/src/serializerbinary.cpp
+++ b/src/serializerbinary.cpp
@@ -43,12 +43,15 @@ void SerializerBinary::close()
43 43
44void SerializerBinary::write(const void * pData, int32_t nSize) 44void SerializerBinary::write(const void * pData, int32_t nSize)
45{ 45{
46 fwrite(pData, nSize, 1, fhFile); 46 uint32_t nWrite = fwrite(pData, nSize, 1, fhFile);
47 printf("fwrite( 0x%08X, %d, 1, fhFile ) = %u;\n", pData, nSize, nWrite );
47} 48}
48 49
49void SerializerBinary::read(void * pData, int32_t nSize) 50void SerializerBinary::read(void * pData, int32_t nSize)
50{ 51{
51 if( fread(pData, nSize, 1, fhFile) < 1 ) 52 uint32_t nRead = fread(pData, nSize, 1, fhFile);
53 printf("fread( 0x%08X, %d, 1, fhFile ) = %u;\n", pData, nSize, nRead );
54 if( nRead < 1 )
52 { 55 {
53 throw FileException( excodeEOF, "End of file read"); 56 throw FileException( excodeEOF, "End of file read");
54 } 57 }