summaryrefslogtreecommitdiff
path: root/src
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
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
-rw-r--r--src/serializertext.cpp2
-rw-r--r--src/serializertext.h2
3 files changed, 7 insertions, 4 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 }
diff --git a/src/serializertext.cpp b/src/serializertext.cpp
index f758bf8..9cf4394 100644
--- a/src/serializertext.cpp
+++ b/src/serializertext.cpp
@@ -7,7 +7,7 @@ SerializerText::SerializerText(FILE *fhFile, bool bLoading):
7{ 7{
8} 8}
9 9
10SerializerText::SerializerText(char *sFileName, bool bLoading): 10SerializerText::SerializerText(const char *sFileName, bool bLoading):
11 Serializer(bLoading), 11 Serializer(bLoading),
12 bCloseFile(true) 12 bCloseFile(true)
13{ 13{
diff --git a/src/serializertext.h b/src/serializertext.h
index 46be421..01b7f7b 100644
--- a/src/serializertext.h
+++ b/src/serializertext.h
@@ -8,7 +8,7 @@ class SerializerText : public Serializer
8{ 8{
9public: 9public:
10 SerializerText(FILE *fhFile, bool bLoading); 10 SerializerText(FILE *fhFile, bool bLoading);
11 SerializerText(char *sFileName, bool bLoading); 11 SerializerText(const char *sFileName, bool bLoading);
12 virtual ~SerializerText(); 12 virtual ~SerializerText();
13 13
14 virtual void close(); 14 virtual void close();