From dd871397f2ef6c73a7b83a49ecc1d3d4c0232eb4 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 9 Oct 2009 18:53:54 +0000 Subject: 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 --- common/object.cpp | 12 ++++++------ common/piece.cpp | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'common') 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) -- cgit v1.2.3