Skip to content

Commit d318004

Browse files
committed
[[ UnicodeFileFormat ]] Changed 'version' parameter on load to be a uint32_t - 5500 => 5.5.0.0
1 parent 4acaedf commit d318004

40 files changed

Lines changed: 116 additions & 117 deletions

engine/src/aclip.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ IO_stat MCAudioClip::extendedsave(MCObjectOutputStream& p_stream, uint4 p_part)
958958
return defaultextendedsave(p_stream, p_part);
959959
}
960960

961-
IO_stat MCAudioClip::extendedload(MCObjectInputStream& p_stream, const char *p_version, uint4 p_length)
961+
IO_stat MCAudioClip::extendedload(MCObjectInputStream& p_stream, uint32_t p_version, uint4 p_length)
962962
{
963963
return defaultextendedload(p_stream, p_version, p_length);
964964
}
@@ -1000,7 +1000,7 @@ IO_stat MCAudioClip::save(IO_handle stream, uint4 p_part, bool p_force_ext)
10001000
return savepropsets(stream);
10011001
}
10021002

1003-
IO_stat MCAudioClip::load(IO_handle stream, const char *version)
1003+
IO_stat MCAudioClip::load(IO_handle stream, uint32_t version)
10041004
{
10051005
IO_stat stat;
10061006

engine/src/aclip.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ class MCAudioClip : public MCObject
111111

112112
IO_stat save(IO_handle stream, uint4 p_part, bool p_force_ext);
113113
IO_stat extendedsave(MCObjectOutputStream& p_stream, uint4 p_part);
114-
IO_stat load(IO_handle stream, const char *version);
115-
IO_stat extendedload(MCObjectInputStream& p_stream, const char *p_version, uint4 p_length);
114+
IO_stat load(IO_handle stream, uint32_t version);
115+
IO_stat extendedload(MCObjectInputStream& p_stream, uint32_t version, uint4 p_length);
116116

117117
MCStack *getmessagestack()
118118
{

engine/src/block.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ bool MCBlock::visit(MCVisitStyle p_style, uint32_t p_part, MCObjectVisitor *p_vi
118118

119119
// MW-2012-03-04: [[ StackFile5500 ]] If 'is_ext' is true then the record is an extended
120120
// record.
121-
IO_stat MCBlock::load(IO_handle stream, const char *version, bool is_ext)
121+
IO_stat MCBlock::load(IO_handle stream, uint32_t version, bool is_ext)
122122
{
123123
IO_stat stat;
124124

@@ -154,7 +154,7 @@ IO_stat MCBlock::load(IO_handle stream, const char *version, bool is_ext)
154154
// is a font record to read.
155155
if (flags & F_FONT)
156156
{
157-
if (strncmp(version, "1.3", 3) > 0)
157+
if (version > 1300)
158158
{
159159
uint2 t_font_index;
160160
if ((stat = IO_read_uint2(&t_font_index, stream)) != IO_NORMAL)
@@ -211,7 +211,7 @@ IO_stat MCBlock::load(IO_handle stream, const char *version, bool is_ext)
211211
atts->backcolor = new MCColor;
212212
if ((stat = IO_read_mccolor(*atts->backcolor, stream)) != IO_NORMAL)
213213
return stat;
214-
if (strncmp(version, "2.0", 3) < 0 || flags & F_HAS_BACK_COLOR_NAME)
214+
if (version < 2000 || flags & F_HAS_BACK_COLOR_NAME)
215215
{
216216
// MW-2012-01-06: [[ Block Changes ]] We no longer use the backcolor name
217217
// so load, delete and unset the flag.

engine/src/block.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class MCBlock : public MCDLlist
7979

8080
// MW-2012-03-04: [[ StackFile5500 ]] If 'is_ext' is true then this block has
8181
// an extension style attribute section.
82-
IO_stat load(IO_handle stream, const char *version, bool is_ext);
82+
IO_stat load(IO_handle stream, uint32_t version, bool is_ext);
8383
IO_stat save(IO_handle stream, uint4 p_part);
8484

8585
// MW-2012-02-14: [[ FontRefs ]] To open a block, we need the parent's fontref.

engine/src/button.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4170,7 +4170,7 @@ IO_stat MCButton::extendedsave(MCObjectOutputStream& p_stream, uint4 p_part)
41704170
return t_stat;
41714171
}
41724172

4173-
IO_stat MCButton::extendedload(MCObjectInputStream& p_stream, const char *p_version, uint4 p_remaining)
4173+
IO_stat MCButton::extendedload(MCObjectInputStream& p_stream, uint32_t p_version, uint4 p_remaining)
41744174
{
41754175
IO_stat t_stat;
41764176
t_stat = IO_NORMAL;
@@ -4296,7 +4296,7 @@ IO_stat MCButton::save(IO_handle stream, uint4 p_part, bool p_force_ext)
42964296
return IO_NORMAL;
42974297
}
42984298

4299-
IO_stat MCButton::load(IO_handle stream, const char *version)
4299+
IO_stat MCButton::load(IO_handle stream, uint32_t version)
43004300
{
43014301
IO_stat stat;
43024302

@@ -4307,7 +4307,7 @@ IO_stat MCButton::load(IO_handle stream, const char *version)
43074307
if ((m_font_flags & FF_HAS_UNICODE_TAG) != 0)
43084308
m_font_flags |= FF_HAS_UNICODE;
43094309

4310-
if (strncmp(version, "2.3", 3) <= 0)
4310+
if (version <= 2300)
43114311
{
43124312
uint4 iconid;
43134313
uint4 hiliteiconid = 0;
@@ -4416,7 +4416,7 @@ IO_stat MCButton::load(IO_handle stream, const char *version)
44164416
return stat;
44174417
if ((stat = IO_read_uint1(&mnemonic, stream)) != IO_NORMAL)
44184418
return stat;
4419-
if (strncmp(version, "2.0", 3) <= 0)
4419+
if (version <= 2000)
44204420
{
44214421
if (flags & F_DEFAULT)
44224422
rect = MCU_reduce_rect(rect, MOTIF_DEFAULT_WIDTH);

engine/src/button.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ class MCButton : public MCControl
188188
// virtual functions from MCControl
189189
virtual IO_stat save(IO_handle stream, uint4 p_part, bool p_force_ext);
190190
virtual IO_stat extendedsave(MCObjectOutputStream& p_stream, uint4 p_part);
191-
virtual IO_stat load(IO_handle stream, const char *version);
192-
virtual IO_stat extendedload(MCObjectInputStream& p_stream, const char *p_version, uint4 p_length);
191+
virtual IO_stat load(IO_handle stream, uint32_t version);
192+
virtual IO_stat extendedload(MCObjectInputStream& p_stream, uint32_t version, uint4 p_length);
193193

194194
virtual MCControl *clone(Boolean attach, Object_pos p, bool invisible);
195195
virtual MCControl *findnum(Chunk_term type, uint2 &num);

engine/src/card.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3265,7 +3265,7 @@ void MCCard::draw(MCDC *dc, const MCRectangle& dirty, bool p_isolated)
32653265
// SAVING AND LOADING
32663266
//
32673267

3268-
IO_stat MCCard::extendedload(MCObjectInputStream& p_stream, const char *p_version, uint4 p_length)
3268+
IO_stat MCCard::extendedload(MCObjectInputStream& p_stream, uint32_t p_version, uint4 p_length)
32693269
{
32703270
return defaultextendedload(p_stream, p_version, p_length);
32713271
}
@@ -3275,7 +3275,7 @@ IO_stat MCCard::extendedsave(MCObjectOutputStream& p_stream, uint4 p_part)
32753275
return defaultextendedsave(p_stream, p_part);
32763276
}
32773277

3278-
IO_stat MCCard::load(IO_handle stream, const char *version)
3278+
IO_stat MCCard::load(IO_handle stream, uint32_t version)
32793279
{
32803280
IO_stat stat;
32813281

@@ -3285,7 +3285,7 @@ IO_stat MCCard::load(IO_handle stream, const char *version)
32853285
//---- 2.7+:
32863286
// . F_OPAQUE is now valid - default true
32873287
// . ink is now valid - default GXcopy
3288-
if (strncmp(version, "2.7", 3) < 0)
3288+
if (version < 2700)
32893289
{
32903290
flags |= F_OPAQUE;
32913291
ink = GXcopy;
@@ -3320,7 +3320,7 @@ IO_stat MCCard::load(IO_handle stream, const char *version)
33203320
return IO_NORMAL;
33213321
}
33223322

3323-
IO_stat MCCard::loadobjects(IO_handle stream, const char *version)
3323+
IO_stat MCCard::loadobjects(IO_handle stream, uint32_t version)
33243324
{
33253325
IO_stat stat = IO_NORMAL;
33263326

engine/src/card.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ class MCCard : public MCObject
102102
MCObject *hittest(int32_t x, int32_t y);
103103

104104
// MCCard functions
105-
IO_stat load(IO_handle stream, const char *version);
106-
IO_stat extendedload(MCObjectInputStream& p_stream, const char *p_version, uint4 p_length);
105+
IO_stat load(IO_handle stream, uint32_t version);
106+
IO_stat extendedload(MCObjectInputStream& p_stream, uint32_t version, uint4 p_length);
107107
IO_stat save(IO_handle stream, uint4 p_part, bool p_force_ext);
108108
IO_stat extendedsave(MCObjectOutputStream& p_stream, uint4 p_part);
109109

110110
IO_stat saveobjects(IO_handle stream, uint4 p_part);
111-
IO_stat loadobjects(IO_handle stream, const char *version);
111+
IO_stat loadobjects(IO_handle stream, uint32_t version);
112112

113113
void kfocusset(MCControl *target);
114114
MCCard *clone(Boolean attach, Boolean controls);

engine/src/cdata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ MCCdata::~MCCdata()
8383
}
8484
}
8585

86-
IO_stat MCCdata::load(IO_handle stream, MCObject *parent, const char *version)
86+
IO_stat MCCdata::load(IO_handle stream, MCObject *parent, uint32_t version)
8787
{
8888
IO_stat stat;
8989

engine/src/cdata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MCCdata : public MCDLlist
3333
MCCdata(uint4 newid);
3434
MCCdata(const MCCdata &fref);
3535
~MCCdata();
36-
IO_stat load(IO_handle stream, MCObject *parent, const char *version);
36+
IO_stat load(IO_handle stream, MCObject *parent, uint32_t version);
3737
IO_stat save(IO_handle stream, Object_type type, uint4 p_part);
3838
uint4 getid();
3939
void setid(uint4 newid);

0 commit comments

Comments
 (0)