From a153962ffe93e70f2419efeab904b515c99c2eda Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 7 Jun 2008 07:00:09 +0000 Subject: Fixed the bugs in the archive system. Both the List container and FString had inconsistancies when archiving compared to their STL counterparts, they are now compatible on every system I can imagine. Also, List now uses a long instead of an int for sizing, and the other containers should as well. I'll check on that later. That means that the files will all be larger on a 64 bit system, but such is life. The same thing happens when you use STL classes. There may be other inconsistancies down the road, we'll see. --- src/archive.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/archive.cpp') diff --git a/src/archive.cpp b/src/archive.cpp index accdeb1..90211fe 100644 --- a/src/archive.cpp +++ b/src/archive.cpp @@ -473,7 +473,8 @@ Bu::Archive &Bu::operator>>(Bu::Archive &ar, class Bu::Archival *p ) Bu::Archive &Bu::operator<<( Bu::Archive &ar, std::string &s ) { - ar << (uint32_t)s.length(); + // This should be defined as long anyway, this is just insurance + ar << (long)s.length(); ar.write( s.c_str(), s.length() ); return ar; @@ -481,7 +482,7 @@ Bu::Archive &Bu::operator<<( Bu::Archive &ar, std::string &s ) Bu::Archive &Bu::operator>>( Bu::Archive &ar, std::string &s ) { - uint32_t l; + long l; ar >> l; char *tmp = new char[l+1]; tmp[l] = '\0'; -- cgit v1.2.3