mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 02:30:47 +00:00
Change encoding/decoding to protect against differences in integer size.
This commit is contained in:
parent
05572b2d01
commit
35698d41b6
12 changed files with 233 additions and 163 deletions
|
@ -306,9 +306,14 @@ yBottomInRect(NSSize innerSize, NSRect outerRect, BOOL flipped)
|
|||
}
|
||||
else
|
||||
{
|
||||
[aCoder encodeValueOfObjCType: @encode(int) at: &_imageAlignment];
|
||||
[aCoder encodeValueOfObjCType: @encode(int) at: &_frameStyle];
|
||||
[aCoder encodeValueOfObjCType: @encode(int) at: &_imageScaling];
|
||||
int32_t tmp;
|
||||
|
||||
tmp = _imageAlignment;
|
||||
[aCoder encodeValueOfObjCType: @encode(int32_t) at: &tmp];
|
||||
tmp = _frameStyle;
|
||||
[aCoder encodeValueOfObjCType: @encode(int32_t) at: &tmp];
|
||||
tmp = _imageScaling;
|
||||
[aCoder encodeValueOfObjCType: @encode(int32_t) at: &tmp];
|
||||
[aCoder encodeSize: _original_image_size];
|
||||
}
|
||||
}
|
||||
|
@ -338,9 +343,14 @@ yBottomInRect(NSSize innerSize, NSRect outerRect, BOOL flipped)
|
|||
}
|
||||
else
|
||||
{
|
||||
[aDecoder decodeValueOfObjCType: @encode(int) at: &_imageAlignment];
|
||||
[aDecoder decodeValueOfObjCType: @encode(int) at: &_frameStyle];
|
||||
[aDecoder decodeValueOfObjCType: @encode(int) at: &_imageScaling];
|
||||
int32_t tmp;
|
||||
|
||||
[aDecoder decodeValueOfObjCType: @encode(int32_t) at: &tmp];
|
||||
_imageAlignment = tmp;
|
||||
[aDecoder decodeValueOfObjCType: @encode(int32_t) at: &tmp];
|
||||
_frameStyle = tmp;
|
||||
[aDecoder decodeValueOfObjCType: @encode(int32_t) at: &tmp];
|
||||
_imageScaling = tmp;
|
||||
_original_image_size = [aDecoder decodeSize];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue