Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stage 6 of clang compiler warning patches. #113

Merged
merged 5 commits into from
Nov 5, 2015

Conversation

ethoms
Copy link
Contributor

@ethoms ethoms commented Nov 3, 2015

Stage 6:

Missing method implementations:
(i) 'changeParticipationStatus' is a missing protocol method in SoObjects/Appointments/SOGoCalendarComponent.m. So I added a dummy one that just returns nil.
(ii) 'appendCollectedSources' is a missing method in 'SOGoParentFolder'. It does exist in a class called 'SOGoContactFolders' which is a subclass (child) of 'SOGoParentFolder'. So I copied that method to 'SOGoParentFolder'. If it's a redundant call as I suspect, it will not make a difference. But if it is called, my changes will fix a method call from failing at runtime. Ideally this should be looked into more thoroughly. However my fix will clears the compiler warning and will not make anything worse than it is already.
NOTE: 'appendCollectedSources' does not exist anywhere else, even in SOPE.

@ethoms
Copy link
Contributor Author

ethoms commented Nov 4, 2015

I adjusted the patch for 'SoObjects/Appointments/SOGoCalendarComponent.m' since I just noticed it had a semi-colon after the method declaration (before the method code). And added a useful comment.

@extrafu
Copy link
Contributor

extrafu commented Nov 4, 2015

The appendCollectedSources change is incorrect.

To avoid the warning, we can do in the following code segment:

`

  • (NSException *) initSubFolders
    {
    NSException *error;

    if (!subFolders)
    {
    subFolders = [NSMutableDictionary new];
    error = [self appendPersonalSources];
    if (!error)
    if ([self respondsToSelector:@selector(appendCollectedSources)])
    error = [self appendCollectedSources];
    if (!error)
    `

The line:
error = [self appendCollectedSources];
could be replaced with:
error = [self performSelector: @selector(appendCollectedSources)];

@ethoms
Copy link
Contributor Author

ethoms commented Nov 4, 2015

Yes, that fixes it. I'll make the changes to the pull request.

I still don't understand though. If a method only exists in a subclass of me, how can I call it? In C/C++ this is just not possible. I'll have to read up on selectors, I'm learning Objective C just to maintain the FreeBSD SOPE/SOGo ports.

extrafu added a commit that referenced this pull request Nov 5, 2015
Stage 6 of clang compiler warning patches.
@extrafu extrafu merged commit 9fb69a8 into Alinto:master Nov 5, 2015
@ethoms ethoms deleted the clang-warnings-stage6 branch November 27, 2015 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants