diff options
author | Mike Buland <eichlan@xagasoft.com> | 2008-06-07 07:00:09 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2008-06-07 07:00:09 +0000 |
commit | a153962ffe93e70f2419efeab904b515c99c2eda (patch) | |
tree | a41cb06283025598fcecead56daaf2cfc4a3f6fe /src/archive.cpp | |
parent | 3ac57795fe8e28915523de6dd95e336a3eaa8064 (diff) | |
download | libbu++-a153962ffe93e70f2419efeab904b515c99c2eda.tar.gz libbu++-a153962ffe93e70f2419efeab904b515c99c2eda.tar.bz2 libbu++-a153962ffe93e70f2419efeab904b515c99c2eda.tar.xz libbu++-a153962ffe93e70f2419efeab904b515c99c2eda.zip |
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.
Diffstat (limited to 'src/archive.cpp')
-rw-r--r-- | src/archive.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 ) | |||
473 | 473 | ||
474 | Bu::Archive &Bu::operator<<( Bu::Archive &ar, std::string &s ) | 474 | Bu::Archive &Bu::operator<<( Bu::Archive &ar, std::string &s ) |
475 | { | 475 | { |
476 | ar << (uint32_t)s.length(); | 476 | // This should be defined as long anyway, this is just insurance |
477 | ar << (long)s.length(); | ||
477 | ar.write( s.c_str(), s.length() ); | 478 | ar.write( s.c_str(), s.length() ); |
478 | 479 | ||
479 | return ar; | 480 | return ar; |
@@ -481,7 +482,7 @@ Bu::Archive &Bu::operator<<( Bu::Archive &ar, std::string &s ) | |||
481 | 482 | ||
482 | Bu::Archive &Bu::operator>>( Bu::Archive &ar, std::string &s ) | 483 | Bu::Archive &Bu::operator>>( Bu::Archive &ar, std::string &s ) |
483 | { | 484 | { |
484 | uint32_t l; | 485 | long l; |
485 | ar >> l; | 486 | ar >> l; |
486 | char *tmp = new char[l+1]; | 487 | char *tmp = new char[l+1]; |
487 | tmp[l] = '\0'; | 488 | tmp[l] = '\0'; |