fix(core): fix GCC 10 compatibility

With GCC 10, SOGoAptFormatter.m FTBS with the following error:

    SOGoAptFormatter.m: In function ‘-[SOGoAptFormatter setPrivateTitleOnly]’:
    SOGoAptFormatter.m:104:56: error: expected ‘)’ before ‘::’ token
      104 |   self->formatAction = @selector(titleOnlyForPrivateApt::);

Simply name the second argument, so gcc is happy.

Also add the `external` keyword to a header declared variable.

Fixes #5029
pull/284/head^2
Nicolas Höft 2020-08-19 18:28:30 +02:00 committed by GitHub
parent 72053a5801
commit 8507204e0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 20 deletions

View File

@ -51,7 +51,7 @@
@class WOResponse; @class WOResponse;
NSArray *SOGoMailCoreInfoKeys; extern NSArray *SOGoMailCoreInfoKeys;
@interface SOGoMailObject : SOGoMailBaseObject @interface SOGoMailObject : SOGoMailBaseObject
{ {

View File

@ -65,43 +65,43 @@
/* accessors */ /* accessors */
- (void)setTooltip { - (void)setTooltip {
self->formatAction = @selector(tooltipForApt::); self->formatAction = @selector(tooltipForApt:_refDate:);
} }
- (void)setSingleLineFullDetails { - (void)setSingleLineFullDetails {
self->formatAction = @selector(singleLineFullDetailsForApt::); self->formatAction = @selector(singleLineFullDetailsForApt:_refDate:);
} }
- (void)setFullDetails { - (void)setFullDetails {
self->formatAction = @selector(fullDetailsForApt::); self->formatAction = @selector(fullDetailsForApt:_refDate:);
} }
- (void)setPrivateTooltip { - (void)setPrivateTooltip {
self->formatAction = @selector(tooltipForPrivateApt::); self->formatAction = @selector(tooltipForPrivateApt:_refDate:);
} }
- (void)setPrivateDetails { - (void)setPrivateDetails {
self->formatAction = @selector(detailsForPrivateApt::); self->formatAction = @selector(detailsForPrivateApt:_refDate:);
} }
- (void)setTitleOnly { - (void)setTitleOnly {
self->formatAction = @selector(titleForApt::); self->formatAction = @selector(titleForApt:_refDate:);
} }
- (void)setShortTitleOnly { - (void)setShortTitleOnly {
self->formatAction = @selector(shortTitleForApt::); self->formatAction = @selector(shortTitleForApt:_refDate:);
} }
- (void)setShortMonthTitleOnly { - (void)setShortMonthTitleOnly {
self->formatAction = @selector(shortMonthTitleForApt::); self->formatAction = @selector(shortMonthTitleForApt:_refDate:);
} }
- (void)setPrivateSuppressAll { - (void)setPrivateSuppressAll {
self->formatAction = @selector(suppressApt::); self->formatAction = @selector(suppressApt:_refDate:);
} }
- (void)setPrivateTitleOnly { - (void)setPrivateTitleOnly {
self->formatAction = @selector(titleOnlyForPrivateApt::); self->formatAction = @selector(titleOnlyForPrivateApt:_refDate:);
} }
- (void)setPrivateTitle:(NSString *)_privateTitle { - (void)setPrivateTitle:(NSString *)_privateTitle {
@ -218,7 +218,7 @@
- (NSString *)titleForApt:(id)_apt :(NSCalendarDate *)_refDate { - (NSString *)titleForApt:(id)_apt :(NSCalendarDate *)_refDate {
NSString *title; NSString *title;
title = [_apt valueForKey:@"title"]; title = [_apt valueForKey:@"title"];
if (![title isNotEmpty]) if (![title isNotEmpty])
title = [self titlePlaceholder]; title = [self titlePlaceholder];
@ -227,11 +227,11 @@
- (NSString *)shortTitleForApt:(id)_apt :(NSCalendarDate *)_refDate { - (NSString *)shortTitleForApt:(id)_apt :(NSCalendarDate *)_refDate {
NSString *title; NSString *title;
title = [self titleForApt:_apt :_refDate]; title = [self titleForApt:_apt :_refDate];
if ([title length] > 50) if ([title length] > 50)
title = [[title substringToIndex: 49] stringByAppendingString:@"..."]; title = [[title substringToIndex: 49] stringByAppendingString:@"..."];
return title; return title;
} }
@ -248,14 +248,14 @@
[self appendTimeInfoForDate: startDate usingReferenceDate: nil [self appendTimeInfoForDate: startDate usingReferenceDate: nil
toBuffer: title]; toBuffer: title];
[title appendFormat: @" %@", [self titleForApt:_apt :_refDate]]; [title appendFormat: @" %@", [self titleForApt:_apt :_refDate]];
return title; return title;
} }
- (NSString *)singleLineFullDetailsForApt:(id)_apt :(NSCalendarDate *)_refDate { - (NSString *)singleLineFullDetailsForApt:(id)_apt :(NSCalendarDate *)_refDate {
NSMutableString *aptDescr; NSMutableString *aptDescr;
NSString *s; NSString *s;
aptDescr = [NSMutableString stringWithCapacity:60]; aptDescr = [NSMutableString stringWithCapacity:60];
[self appendTimeInfoFromApt:_apt [self appendTimeInfoFromApt:_apt
usingReferenceDate:_refDate usingReferenceDate:_refDate
@ -288,7 +288,7 @@
s = [self shortTitleForApt: _apt : _refDate]; s = [self shortTitleForApt: _apt : _refDate];
if ([s length] > 0) if ([s length] > 0)
[aptDescr appendFormat:@"<br />%@", s]; [aptDescr appendFormat:@"<br />%@", s];
return aptDescr; return aptDescr;
} }
@ -311,7 +311,7 @@
: (NSCalendarDate *) _refDate : (NSCalendarDate *) _refDate
{ {
NSString *s; NSString *s;
s = [self privateTitle]; s = [self privateTitle];
if (!s) if (!s)
s = @""; s = @"";
@ -348,11 +348,11 @@
{ {
NSMutableString *aptDescr; NSMutableString *aptDescr;
NSString *s; NSString *s;
aptDescr = [NSMutableString stringWithCapacity: 25]; aptDescr = [NSMutableString stringWithCapacity: 25];
[self appendTimeInfoFromApt: _apt [self appendTimeInfoFromApt: _apt
usingReferenceDate: _refDate usingReferenceDate: _refDate
toBuffer: aptDescr]; toBuffer: aptDescr];
if ((s = [self privateTitle]) != nil) if ((s = [self privateTitle]) != nil)
[aptDescr appendFormat:@"\n%@", s]; [aptDescr appendFormat:@"\n%@", s];