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

[PLAT-10163] Fixed warnings that appeared in Xcode 14.3 #1561

Merged
merged 1 commit into from
Jun 7, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static IMP set_class_imp(Class _Nonnull class, SEL selector, id _Nonnull impleme
}
}

static void replace_NSURLSession_sessionWithConfigurationDelegateQueue() {
static void replace_NSURLSession_sessionWithConfigurationDelegateQueue(void) {
Class class = NSURLSession.class;
SEL selector = @selector(sessionWithConfiguration:delegate:delegateQueue:);
typedef NSURLSession *(*IMPPrototype)(id, SEL, NSURLSessionConfiguration *,
Expand All @@ -42,7 +42,7 @@ static void replace_NSURLSession_sessionWithConfigurationDelegateQueue() {
});
}

static void replace_NSURLSession_sharedSession() {
static void replace_NSURLSession_sharedSession(void) {
set_class_imp(NSURLSession.class, @selector(sharedSession), ^(__unused id self) {
static NSURLSession *session;
static dispatch_once_t onceToken;
Expand All @@ -60,7 +60,7 @@ static void replace_NSURLSession_sharedSession() {
});
}

void bsg_installNSURLSessionTracing() {
void bsg_installNSURLSessionTracing(void) {
replace_NSURLSession_sessionWithConfigurationDelegateQueue();
replace_NSURLSession_sharedSession();
}
4 changes: 4 additions & 0 deletions Tests/BugsnagTests/BugsnagTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ - (void)testBugsnagMetadataAddition {

// Add some additional metadata once we're sure it's not already there
[client addMetadata:@"aValue2" withKey:@"aKey2" toSection:@"mySection2"];
return NO;
}];

[client notify:exception2 block:^BOOL(BugsnagEvent * _Nonnull event) {
XCTAssertEqualObjects([event getMetadataFromSection:@"mySection1" withKey:@"aKey1"], @"aValue1");
XCTAssertEqualObjects([event getMetadataFromSection:@"mySection2" withKey:@"aKey2"], @"aValue2");
XCTAssertEqual(event.errors[0].errorClass, @"exception2");
XCTAssertEqual(event.errors[0].errorMessage, @"reason2");
return NO;
}];

// Check nil value causes deletions
Expand All @@ -66,6 +68,7 @@ - (void)testBugsnagMetadataAddition {
[client notify:exception1 block:^BOOL(BugsnagEvent * _Nonnull event) {
XCTAssertNil([event getMetadataFromSection:@"mySection1" withKey:@"aKey1"]);
XCTAssertNil([event getMetadataFromSection:@"mySection2" withKey:@"aKey2"]);
return NO;
}];

// Check that event-level metadata alteration doesn't affect configuration-level metadata
Expand All @@ -85,6 +88,7 @@ - (void)testBugsnagMetadataAddition {


[expectation fulfill];
return NO;
}];

[self waitForExpectationsWithTimeout:0.1 handler:^(NSError * _Nullable error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation
userInfo: nil);

Bugsnag.notify(exception) { (event) -> Bool in
let frames = [
let frames: [[String: Any]] = [
["method":"foo()", "file":"src/Giraffe.mm", "lineNumber": 200],
["method":"bar()", "file":"parser.js"],
["method":"yes()"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MetadataRedactionNestedScenario: Scenario {
}

override func run() {
let dictionary = [
let dictionary: [String: [String: Any]] = [
"alpha": [
"password": "foo",
"name": "Bob"
Expand All @@ -32,7 +32,7 @@ class MetadataRedactionNestedScenario: Scenario {
"name": [
"title": "Mr"
]
]
] as [String: Any]
]
]
Bugsnag.addOnSession { (block) -> Bool in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation
userInfo: nil);

Bugsnag.notify(exception) { (event) -> Bool in
let frames = [
let frames: [[String: Any]] = [
["method":"bar()", "file":"foo.js", "lineNumber": 43],
["method":"baz()", "file":"[native code]"],
["method":"is_done()"]
Expand Down
2 changes: 1 addition & 1 deletion features/fixtures/shared/scenarios/spin_malloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static void * spin_malloc(struct _malloc_zone_t *zone, size_t size) {
}

// Override malloc() with a version that deadlocks the current thread.
static inline void install_spin_malloc() {
static inline void install_spin_malloc(void) {
malloc_zone_t *zone = malloc_default_zone();
vm_protect(mach_task_self(), (uintptr_t)zone, sizeof(malloc_zone_t), 0, VM_PROT_READ | VM_PROT_WRITE);
zone->malloc = spin_malloc;
Expand Down