Skip to content

Commit

Permalink
fix(core): fix GCC 10 compatibility
Browse files Browse the repository at this point in the history
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
  • Loading branch information
the-nic committed Aug 19, 2020
1 parent 72053a5 commit 8507204
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion SoObjects/Mailer/SOGoMailObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

@class WOResponse;

NSArray *SOGoMailCoreInfoKeys;
extern NSArray *SOGoMailCoreInfoKeys;

@interface SOGoMailObject : SOGoMailBaseObject
{
Expand Down
38 changes: 19 additions & 19 deletions UI/SOGoUI/SOGoAptFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,43 +65,43 @@ - (void)dealloc {
/* accessors */

- (void)setTooltip {
self->formatAction = @selector(tooltipForApt::);
self->formatAction = @selector(tooltipForApt:_refDate:);
}

- (void)setSingleLineFullDetails {
self->formatAction = @selector(singleLineFullDetailsForApt::);
self->formatAction = @selector(singleLineFullDetailsForApt:_refDate:);
}

- (void)setFullDetails {
self->formatAction = @selector(fullDetailsForApt::);
self->formatAction = @selector(fullDetailsForApt:_refDate:);
}

- (void)setPrivateTooltip {
self->formatAction = @selector(tooltipForPrivateApt::);
self->formatAction = @selector(tooltipForPrivateApt:_refDate:);
}

- (void)setPrivateDetails {
self->formatAction = @selector(detailsForPrivateApt::);
self->formatAction = @selector(detailsForPrivateApt:_refDate:);
}

- (void)setTitleOnly {
self->formatAction = @selector(titleForApt::);
self->formatAction = @selector(titleForApt:_refDate:);
}

- (void)setShortTitleOnly {
self->formatAction = @selector(shortTitleForApt::);
self->formatAction = @selector(shortTitleForApt:_refDate:);
}

- (void)setShortMonthTitleOnly {
self->formatAction = @selector(shortMonthTitleForApt::);
self->formatAction = @selector(shortMonthTitleForApt:_refDate:);
}

- (void)setPrivateSuppressAll {
self->formatAction = @selector(suppressApt::);
self->formatAction = @selector(suppressApt:_refDate:);
}

- (void)setPrivateTitleOnly {
self->formatAction = @selector(titleOnlyForPrivateApt::);
self->formatAction = @selector(titleOnlyForPrivateApt:_refDate:);
}

- (void)setPrivateTitle:(NSString *)_privateTitle {
Expand Down Expand Up @@ -218,7 +218,7 @@ - (void)appendTimeInfoFromApt:(id)_apt

- (NSString *)titleForApt:(id)_apt :(NSCalendarDate *)_refDate {
NSString *title;

title = [_apt valueForKey:@"title"];
if (![title isNotEmpty])
title = [self titlePlaceholder];
Expand All @@ -227,11 +227,11 @@ - (NSString *)titleForApt:(id)_apt :(NSCalendarDate *)_refDate {

- (NSString *)shortTitleForApt:(id)_apt :(NSCalendarDate *)_refDate {
NSString *title;

title = [self titleForApt:_apt :_refDate];
if ([title length] > 50)
title = [[title substringToIndex: 49] stringByAppendingString:@"..."];

return title;
}

Expand All @@ -248,14 +248,14 @@ - (NSString *)shortMonthTitleForApt:(id)_apt :(NSCalendarDate *)_refDate {
[self appendTimeInfoForDate: startDate usingReferenceDate: nil
toBuffer: title];
[title appendFormat: @" %@", [self titleForApt:_apt :_refDate]];

return title;
}

- (NSString *)singleLineFullDetailsForApt:(id)_apt :(NSCalendarDate *)_refDate {
NSMutableString *aptDescr;
NSString *s;

aptDescr = [NSMutableString stringWithCapacity:60];
[self appendTimeInfoFromApt:_apt
usingReferenceDate:_refDate
Expand Down Expand Up @@ -288,7 +288,7 @@ - (NSString *) fullDetailsForApt: (id)_apt
s = [self shortTitleForApt: _apt : _refDate];
if ([s length] > 0)
[aptDescr appendFormat:@"<br />%@", s];

return aptDescr;
}

Expand All @@ -311,7 +311,7 @@ - (NSString *) titleOnlyForPrivateApt: (id)_apt
: (NSCalendarDate *) _refDate
{
NSString *s;

s = [self privateTitle];
if (!s)
s = @"";
Expand Down Expand Up @@ -348,11 +348,11 @@ - (NSString *) tooltipForPrivateApt: (id) _apt
{
NSMutableString *aptDescr;
NSString *s;

aptDescr = [NSMutableString stringWithCapacity: 25];
[self appendTimeInfoFromApt: _apt
usingReferenceDate: _refDate
toBuffer: aptDescr];
toBuffer: aptDescr];
if ((s = [self privateTitle]) != nil)
[aptDescr appendFormat:@"\n%@", s];

Expand Down

0 comments on commit 8507204

Please sign in to comment.