summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo2009-10-09 18:53:54 +0000
committerleo2009-10-09 18:53:54 +0000
commitdd871397f2ef6c73a7b83a49ecc1d3d4c0232eb4 (patch)
treea13cd7a65413dfbee7781389f5d999c0a876bb9f
parent1220f210a73c42edf1d90fbba2bdee2c28490bed (diff)
Fixed crash loading files on 64-bit systems.
git-svn-id: http://svn.leocad.org/branches/leocad-0.75@839 c7d43263-9d01-0410-8a33-9dba5d9f93d6
-rwxr-xr-xcommon/object.cpp12
-rw-r--r--common/piece.cpp6
2 files changed, 9 insertions, 9 deletions
diff --git a/common/object.cpp b/common/object.cpp
index 1b8a91c..0d8c079 100755
--- a/common/object.cpp
+++ b/common/object.cpp
@@ -80,16 +80,16 @@ Object::~Object ()
bool Object::FileLoad (File& file)
{
- unsigned char version;
+ lcuint8 version;
file.ReadByte (&version, 1);
if (version > LC_KEY_SAVE_VERSION)
return false;
- unsigned short time;
+ lcuint16 time;
float param[4];
- unsigned char type;
- unsigned long n;
+ lcuint8 type;
+ lcuint32 n;
file.ReadLong (&n, 1);
while (n--)
@@ -116,9 +116,9 @@ bool Object::FileLoad (File& file)
void Object::FileSave (File& file) const
{
- unsigned char version = LC_KEY_SAVE_VERSION;
+ lcuint8 version = LC_KEY_SAVE_VERSION;
LC_OBJECT_KEY *node;
- unsigned long n;
+ lcuint32 n;
file.WriteByte (&version, 1);
diff --git a/common/piece.cpp b/common/piece.cpp
index e7b36ae..5431d00 100644
--- a/common/piece.cpp
+++ b/common/piece.cpp
@@ -163,13 +163,13 @@ bool Piece::FileLoad (File& file, char* name)
if (version < 9)
{
- unsigned short time;
+ lcuint16 time;
float param[4];
unsigned char type;
if (version > 5)
{
- unsigned long keys;
+ lcuint32 keys;
file.ReadLong (&keys, 1);
while (keys--)
@@ -303,7 +303,7 @@ bool Piece::FileLoad (File& file, char* name)
if (ch == 0)
m_pGroup = (Group*)-1;
else
- m_pGroup = (Group*)(unsigned long)ch;
+ m_pGroup = (Group*)(lcuint32)ch;
file.ReadByte(&ch, 1);
if (ch & 0x01)