Correction for issue with gcc 3.4.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20243 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-10-22 12:20:01 +00:00
parent 6ff377994a
commit 78b37d430e
3 changed files with 39 additions and 14 deletions

View file

@ -1,3 +1,10 @@
2004-10-22 08:26 Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSStepperCell.m: Corrected issue with [NSStepperCell
initWithCoder:] for encoding issue with gcc 3.4.
* Header/AppKit/NSStepperCell.h: Took out defines which use
the bitfields in NSCell.h. These now are BOOL variables.
2004-10-21 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSResponder.m (-initWithCoder:): Set missing default

View file

@ -32,15 +32,13 @@
@interface NSStepperCell : NSActionCell <NSCoding>
{
// Think of the following ones as of two BOOL ivars
#define _autorepeat _cell.subclass_bool_one
#define _valueWraps _cell.subclass_bool_two
double _maxValue;
double _minValue;
double _increment;
BOOL highlightUp;
BOOL highlightDown;
BOOL _autorepeat;
BOOL _valueWraps;
}
- (double)maxValue;

View file

@ -341,22 +341,42 @@ static inline void HighlightDownButton(NSRect aRect)
//
- (void) encodeWithCoder: (NSCoder*)aCoder
{
BOOL tmp1, tmp2;
int tmp1, tmp2;
[super encodeWithCoder: aCoder];
tmp1 = _autorepeat;
tmp2 = _valueWraps;
[aCoder encodeValuesOfObjCTypes: "dddii",
&_maxValue, &_minValue, &_increment, &tmp1, &tmp2];
tmp1 = (int)_autorepeat;
tmp2 = (int)_valueWraps;
[aCoder encodeValueOfObjCType: @encode(double)
at: &_maxValue];
[aCoder encodeValueOfObjCType: @encode(double)
at: &_minValue];
[aCoder encodeValueOfObjCType: @encode(double)
at: &_increment];
[aCoder encodeValueOfObjCType: @encode(int)
at: &tmp1];
[aCoder encodeValueOfObjCType: @encode(int)
at: &tmp2];
}
- (id) initWithCoder: (NSCoder*)aDecoder
{
BOOL tmp1, tmp2;
int tmp1, tmp2;
[super initWithCoder: aDecoder];
[aDecoder decodeValuesOfObjCTypes: "dddii",
&_maxValue, &_minValue, &_increment, &tmp1, &tmp2];
_autorepeat = tmp1;
_valueWraps = tmp2;
[aDecoder decodeValueOfObjCType: @encode(double)
at: &_maxValue];
[aDecoder decodeValueOfObjCType: @encode(double)
at: &_minValue];
[aDecoder decodeValueOfObjCType: @encode(double)
at: &_increment];
[aDecoder decodeValueOfObjCType: @encode(int)
at: &tmp1];
[aDecoder decodeValueOfObjCType: @encode(int)
at: &tmp2];
_autorepeat = (BOOL)tmp1;
_valueWraps = (BOOL)tmp2;
return self;
}