Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #536 from tladesignz/develop
Browse files Browse the repository at this point in the history
Fixed annoying compiler warnings which partially leak through to consuming app
  • Loading branch information
SBiOSoftWhare authored Apr 8, 2019
2 parents 843045c + 2468154 commit bce056d
Show file tree
Hide file tree
Showing 35 changed files with 353 additions and 327 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Improvements:
* Upgraded to Xcode 10.2, fixed most of the compiler warnings.

Changes in MatrixKit in 0.9.8 (2019-03-21)
==========================================

Expand Down
31 changes: 27 additions & 4 deletions MatrixKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@
3219CB601AA6F2780027D7E2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0610;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = matrix.org;
TargetAttributes = {
3203F2671D2E9CAE0021F170 = {
Expand All @@ -1497,7 +1497,7 @@
};
buildConfigurationList = 3219CB631AA6F2780027D7E2 /* Build configuration list for PBXProject "MatrixKit" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -1919,20 +1919,32 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand Down Expand Up @@ -1961,20 +1973,31 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand All @@ -1997,10 +2020,10 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = 7J4U792NQT;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
INFOPLIST_FILE = "$(SRCROOT)/Samples/MatrixKitSample/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.matrix.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -2013,10 +2036,10 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = 7J4U792NQT;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
INFOPLIST_FILE = "$(SRCROOT)/Samples/MatrixKitSample/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.matrix.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -28,7 +28,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3219CB831AA6F2780027D7E2"
BlueprintIdentifier = "3203F2671D2E9CAE0021F170"
BuildableName = "MatrixKitTests.xctest"
BlueprintName = "MatrixKitTests"
ReferencedContainer = "container:MatrixKit.xcodeproj">
Expand All @@ -46,7 +46,7 @@
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3219CB831AA6F2780027D7E2"
BlueprintIdentifier = "3203F2671D2E9CAE0021F170"
BuildableName = "MatrixKitTests.xctest"
BlueprintName = "MatrixKitTests"
ReferencedContainer = "container:MatrixKit.xcodeproj">
Expand Down
52 changes: 26 additions & 26 deletions MatrixKit/Controllers/MXKAccountDetailsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,37 +198,37 @@ - (void)setMxAccount:(MXKAccount *)account
// Add observer on user's information
accountUserInfoObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXKAccountUserInfoDidChangeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
// Ignore any refresh when saving is in progress
if (isSavingInProgress)
if (self->isSavingInProgress)
{
return;
}

NSString *accountUserId = notif.object;

if ([accountUserId isEqualToString:_mxAccount.mxCredentials.userId])
if ([accountUserId isEqualToString:self->_mxAccount.mxCredentials.userId])
{
// Update displayName
if (![currentDisplayName isEqualToString:_mxAccount.userDisplayName])
if (![self->currentDisplayName isEqualToString:self->_mxAccount.userDisplayName])
{
currentDisplayName = _mxAccount.userDisplayName;
self.userDisplayName.text = _mxAccount.userDisplayName;
self->currentDisplayName = self->_mxAccount.userDisplayName;
self.userDisplayName.text = self->_mxAccount.userDisplayName;
}
// Update user's avatar
[self updateUserPicture:_mxAccount.userAvatarUrl force:NO];
[self updateUserPicture:self->_mxAccount.userAvatarUrl force:NO];

// Update button management
[self updateSaveUserInfoButtonStatus];

// Display user's presence
UIColor *presenceColor = [MXKAccount presenceColor:_mxAccount.userPresence];
UIColor *presenceColor = [MXKAccount presenceColor:self->_mxAccount.userPresence];
if (presenceColor)
{
userPictureButton.layer.borderWidth = 2;
userPictureButton.layer.borderColor = presenceColor.CGColor;
self->userPictureButton.layer.borderWidth = 2;
self->userPictureButton.layer.borderColor = presenceColor.CGColor;
}
else
{
userPictureButton.layer.borderWidth = 0;
self->userPictureButton.layer.borderWidth = 0;
}
}
}];
Expand All @@ -251,16 +251,16 @@ - (BOOL)shouldLeave:(blockMXKAccountDetailsViewController_onReadyToLeave)handler

UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:[NSBundle mxk_localizedStringForKey:@"message_unsaved_changes"] preferredStyle:UIAlertControllerStyleAlert];

[alertsArray addObject:alert];
[self->alertsArray addObject:alert];
[alert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"discard"]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {

[alertsArray removeObject:alert];
[self->alertsArray removeObject:alert];

// Discard changes
self.userDisplayName.text = currentDisplayName;
[self updateUserPicture:_mxAccount.userAvatarUrl force:YES];
self.userDisplayName.text = self->currentDisplayName;
[self updateUserPicture:self->_mxAccount.userAvatarUrl force:YES];

// Ready to leave
if (handler)
Expand All @@ -274,10 +274,10 @@ - (BOOL)shouldLeave:(blockMXKAccountDetailsViewController_onReadyToLeave)handler
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {

[alertsArray removeObject:alert];
[self->alertsArray removeObject:alert];

// Start saving (Report handler to leave at the end).
onReadyToLeaveHandler = handler;
self->onReadyToLeaveHandler = handler;
[self saveUserInfo];

}]];
Expand Down Expand Up @@ -482,7 +482,7 @@ - (void)saveUserInfo
[uploader uploadData:UIImageJPEGRepresentation(updatedPicture, 0.5) filename:nil mimeType:@"image/jpeg" success:^(NSString *url)
{
// Store uploaded picture url and trigger picture saving
uploadedPictureURL = url;
self->uploadedPictureURL = url;
[self saveUserInfo];
} failure:^(NSError *error)
{
Expand Down Expand Up @@ -542,11 +542,11 @@ - (void)handleErrorDuringPictureSaving:(NSError*)error
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {

[alertsArray removeObject:alert];
[self->alertsArray removeObject:alert];

// Remove change
self.userDisplayName.text = currentDisplayName;
[self updateUserPicture:_mxAccount.userAvatarUrl force:YES];
self.userDisplayName.text = self->currentDisplayName;
[self updateUserPicture:self->_mxAccount.userAvatarUrl force:YES];
// Loop to end saving
[self saveUserInfo];

Expand All @@ -556,7 +556,7 @@ - (void)handleErrorDuringPictureSaving:(NSError*)error
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {

[alertsArray removeObject:alert];
[self->alertsArray removeObject:alert];

// Loop to retry saving
[self saveUserInfo];
Expand Down Expand Up @@ -717,22 +717,22 @@ - (void)showValidationEmailDialogWithMessage:(NSString*)message
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {

[alertsArray removeObject:alert];
[self->alertsArray removeObject:alert];

emailSubmitButton.enabled = YES;
self->emailSubmitButton.enabled = YES;

}]];

[alert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"continue"]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {

[alertsArray removeObject:alert];
[self->alertsArray removeObject:alert];

__weak typeof(self) weakSelf = self;

// We always bind emails when registering, so let's do the same here
[submittedEmail add3PIDToUser:YES success:^{
[self->submittedEmail add3PIDToUser:YES success:^{

if (weakSelf)
{
Expand Down Expand Up @@ -827,7 +827,7 @@ - (IBAction)onButtonPressed:(id)sender
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {

[alertsArray removeObject:alert];
[self->alertsArray removeObject:alert];

}]];

Expand Down
14 changes: 7 additions & 7 deletions MatrixKit/Controllers/MXKAttachmentsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id <UIV
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(coordinator.transitionDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

// Cell width will be updated, force collection layout refresh to take into account the changes
[_attachmentsCollection.collectionViewLayout invalidateLayout];
[self->_attachmentsCollection.collectionViewLayout invalidateLayout];

// Refresh the current attachment display
[self refreshAttachmentCollectionContentOffset];
Expand Down Expand Up @@ -561,12 +561,12 @@ - (void)prepareVideoForItem:(NSInteger)item success:(void(^)(void))success failu
if (attachment.isEncrypted)
{
[attachment decryptToTempFile:^(NSString *file) {
if (tempFile)
if (self->tempFile)
{
[[NSFileManager defaultManager] removeItemAtPath:tempFile error:nil];
[[NSFileManager defaultManager] removeItemAtPath:self->tempFile error:nil];
}
tempFile = file;
videoFile = file;
self->tempFile = file;
self->videoFile = file;
success();
} failure:^(NSError *error) {
if (failure) failure(error);
Expand All @@ -582,7 +582,7 @@ - (void)prepareVideoForItem:(NSInteger)item success:(void(^)(void))success failu
else
{
[attachment prepare:^{
videoFile = attachment.cacheFilePath;
self->videoFile = attachment.cacheFilePath;
success();
} failure:^(NSError *error) {
if (failure) failure(error);
Expand Down Expand Up @@ -1006,7 +1006,7 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa
{
selectedCell.moviePlayer.view.hidden = NO;
selectedCell.centerIcon.hidden = YES;
selectedCell.moviePlayer.contentURL = [NSURL fileURLWithPath:videoFile];
selectedCell.moviePlayer.contentURL = [NSURL fileURLWithPath:self->videoFile];
[selectedCell.moviePlayer play];

[pieChartView removeFromSuperview];
Expand Down
Loading

0 comments on commit bce056d

Please sign in to comment.