Change encoding/decoding to protect against differences in integer size.

This commit is contained in:
fredkiefer 2021-01-08 17:18:36 +01:00
parent 05572b2d01
commit 35698d41b6
12 changed files with 233 additions and 163 deletions

View file

@ -250,8 +250,11 @@ static Class pathComponentCellClass;
}
else
{
[coder decodeValueOfObjCType: @encode(NSUInteger)
at: &_pathStyle];
uint32_t tmp;
[coder decodeValueOfObjCType: @encode(uint32_t)
at: &tmp];
_pathStyle = tmp;
[self setPathComponentCells: [coder decodeObject]];
}
@ -270,8 +273,11 @@ static Class pathComponentCellClass;
}
else
{
[coder encodeValueOfObjCType: @encode(NSUInteger)
at: &_pathStyle];
uint32_t tmp;
tmp = _pathStyle;
[coder encodeValueOfObjCType: @encode(uint32_t)
at: &tmp];
[coder encodeObject: [self pathComponentCells]];
}
}