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

Resolve build warnings #1719

Merged
merged 4 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Vienna Tests/CriteriaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ import XCTest

class CriteriaTests: XCTestCase {

override func setUpWithError() throws {
try super.setUpWithError()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
try super.tearDownWithError()
}

// MARK: Criteria Tests

func testCriteriaTreeInitWithString() {
Expand Down
10 changes: 0 additions & 10 deletions Vienna Tests/ExportTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ import XCTest

class ExportTests: XCTestCase {

override func setUpWithError() throws {
try super.setUpWithError()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
try super.tearDownWithError()
}

/// Test helper method to return an array of folders for export
func foldersArray() -> [Any] {
guard let database = Database.shared else {
Expand Down
20 changes: 11 additions & 9 deletions Vienna.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@
BuildIndependentTargetsInParallel = YES;
CLASSPREFIX = VNA;
LastSwiftUpdateCheck = 1410;
LastUpgradeCheck = 1500;
LastUpgradeCheck = 1520;
ORGANIZATIONNAME = "Vienna project";
TargetAttributes = {
035B703419E0E4AE00197334 = {
Expand Down Expand Up @@ -2966,14 +2966,14 @@
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
WARNING_CFLAGS = (
"-Wcustom-atomic-properties",
"-Wextra-semi",
"-Wcustom-atomic-properties",
"-Wgnu-conditional-omitted-operand",
"-Widiomatic-parentheses",
"-Wmethod-signatures",
"-Wmissing-method-return-type",
"-Wmissing-variable-declarations",
"-Wunreachable-code-break",
"-Wunreachable-code-return",
"-Woverriding-method-mismatch",
"-Wunused-macros",
"-Xclang",
"-analyzer-tidy-checker=readability-braces-around-statements,readability-misleading-indentation",
Expand Down Expand Up @@ -3006,14 +3006,14 @@
SWIFT_OBJC_BRIDGING_HEADER = "Vienna/Sources/Vienna-Bridging-Header.h";
SWIFT_VERSION = 5.0;
WARNING_CFLAGS = (
"-Wcustom-atomic-properties",
"-Wextra-semi",
"-Wcustom-atomic-properties",
"-Wgnu-conditional-omitted-operand",
"-Widiomatic-parentheses",
"-Wmethod-signatures",
"-Wmissing-method-return-type",
"-Wmissing-variable-declarations",
"-Wunreachable-code-break",
"-Wunreachable-code-return",
"-Woverriding-method-mismatch",
"-Wunused-macros",
"-Xclang",
"-analyzer-tidy-checker=readability-braces-around-statements,readability-misleading-indentation",
Expand Down Expand Up @@ -3058,7 +3058,7 @@
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
Expand All @@ -3073,6 +3073,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
Expand Down Expand Up @@ -3118,7 +3119,7 @@
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
Expand All @@ -3132,6 +3133,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
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 = "1500"
LastUpgradeVersion = "1520"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Vienna.xcodeproj/xcshareddata/xcschemes/Vienna.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Vienna/Sources/Fetching/RefreshManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ -(void)reset301Status:(NSTimer *)timer
* Add the specified connection to the connections queue
* that we manage.
*/
-(NSOperation *)addConnection:(NSMutableURLRequest *)urlRequest completionHandler:(void (^)(NSData *data, NSURLResponse *response,
-(NSOperation *)addConnection:(NSURLRequest *)urlRequest completionHandler:(void (^)(NSData *data, NSURLResponse *response,
NSError *error))completionHandler
{
TRVSURLSessionOperation *op =
Expand Down
4 changes: 2 additions & 2 deletions Vienna/Sources/Main window/ArticleListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ -(void)initTableView;
-(BOOL)copyTableSelection:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard;
-(void)setTableViewFont;
-(void)showSortDirection;
-(void)handleReadingPaneChange:(NSNotificationCenter *)nc;
-(void)handleReadingPaneChange:(NSNotification *)notification;
-(BOOL)viewNextUnreadInCurrentFolder:(NSInteger)currentRow;
-(void)markCurrentRead:(NSTimer *)aTimer;
-(void)refreshImmediatelyArticleAtCurrentRow;
Expand Down Expand Up @@ -792,7 +792,7 @@ -(void)handleLoadFullHTMLChange:(NSNotification *)note
/* handleReadingPaneChange
* Respond to the change to the reading pane orientation.
*/
-(void)handleReadingPaneChange:(NSNotificationCenter *)nc
-(void)handleReadingPaneChange:(NSNotification *)notification
{
if (self == self.controller.articleController.mainArticleView) {
[self setOrientation:[Preferences standardPreferences].layout];
Expand Down
2 changes: 1 addition & 1 deletion Vienna/Sources/Main window/FolderView.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ - (void)keyDown:(NSEvent *)theEvent
[super keyDown:theEvent];
}

- (void)setDataSource:(id)aSource
- (void)setDataSource:(id<NSOutlineViewDataSource>)aSource
{
_directDataSource = aSource;
_filterDataSource = [[FoldersFilterableDataSourceImpl alloc] initWithDataSource:aSource];
Expand Down
2 changes: 1 addition & 1 deletion Vienna/Sources/Main window/TreeNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ -(BOOL)canHaveChildren
*/
-(NSString *)description
{
return [NSString stringWithFormat:@"%@ (Parent=%p, # of children=%ld)",
return [NSString stringWithFormat:@"%@ (Parent=%@, # of children=%ld)",
folder.name, parentNode, (unsigned long)children.count];
}

Expand Down
13 changes: 6 additions & 7 deletions Vienna/Sources/Main window/UnifiedDisplayView.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ @interface UnifiedDisplayView () <CustomWKHoverUIDelegate>
@property (nonatomic) OverlayStatusBar *statusBar;

-(void)initTableView;
-(void)handleReadingPaneChange:(NSNotificationCenter *)nc;
-(void)handleCellDidResize:(NSNotificationCenter *)nc;
-(void)handleReadingPaneChange:(NSNotification *)notification;
-(void)handleCellDidResize:(NSNotification *)notification;
-(BOOL)viewNextUnreadInCurrentFolder:(NSInteger)currentRow;
-(void)markCurrentRead:(NSTimer *)aTimer;
-(void)makeRowSelectedAndVisible:(NSInteger)rowIndex;
Expand Down Expand Up @@ -166,9 +166,9 @@ -(void)dealloc
[rowHeightArray removeAllObjects];
}

- (void)handleCellDidResize:(NSNotification *)nc
- (void)handleCellDidResize:(NSNotification *)notification
{
ArticleCellView * cell = nc.object;
ArticleCellView * cell = notification.object;
NSUInteger row = cell.articleRow;
CGFloat fittingHeight = cell.fittingHeight;
if (row < rowHeightArray.count) {
Expand All @@ -184,8 +184,7 @@ - (void)handleCellDidResize:(NSNotification *)nc
[cell setInProgress:NO];
}

#pragma mark -
#pragma ArticleBaseView delegate
#pragma mark - ArticleBaseView delegate

/* ensureSelectedArticle
* Ensure that there is a selected article and that it is visible.
Expand Down Expand Up @@ -332,7 +331,7 @@ -(void)printDocument:(id)sender
/* handleReadingPaneChange
* Respond to the change to the reading pane orientation.
*/
-(void)handleReadingPaneChange:(NSNotificationCenter *)nc
-(void)handleReadingPaneChange:(NSNotification *)notification
{
if (self == self.controller.articleController.mainArticleView) {
[articleList reloadData];
Expand Down
3 changes: 3 additions & 0 deletions Vienna/Sources/Shared/HelperFunctions.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ BOOL hasOSScriptsMenu(void)
[pasteboard declareTypes:@[NSPasteboardTypeString] owner:nil];
@try {
if ([pasteboard setString:urlString forType:NSPasteboardTypeString]) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
url = [WebView URLFromPasteboard:pasteboard];
#pragma clang diagnostic pop
}
} @catch (NSException *exception) {
NSLog(@"Failed to convert URL for string %@", urlString);
Expand Down
2 changes: 1 addition & 1 deletion Vienna/Sources/Shared/StringExtensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

@import Foundation;

#define SafeString(s) s ? s : @""
#define SafeString(s) s ? (s) : @""

NS_ASSUME_NONNULL_BEGIN

Expand Down