Skip to content
Open
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
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PackageDescription

let package = Package(
name: "FaultOrdering",
platforms: [.iOS(.v17)],
platforms: [.iOS(.v17), .macOS(.v13)],
products: [
.library(name: "FaultOrdering", type: .dynamic, targets: ["FaultOrdering"]),
.library(name: "FaultOrderingTests", targets: ["FaultOrderingTests"]),
Expand Down
6 changes: 5 additions & 1 deletion Sources/EMGFaultOrdering/EMGObjCHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@
// Created by Noah Martin on 5/17/25.
//

#if TARGET_OS_IOS
@import UIKit;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this import is actually used in the file, can we just delete it?

#elif TARGET_OS_OSX
@import AppKit;
#endif
@import FaultOrderingSwift;

#import "EMGObjCHelper.h"

@implementation EMGObjCHelper

+ (NSObject*)startServerWithCallback:(NSData* (^)())callback {
return [[EMGServer alloc] initWithCallback:callback];
return [[EMGServer alloc] initWithCallback:callback];
}

@end
2 changes: 1 addition & 1 deletion Sources/FaultOrderingTests/FaultOrderingTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class FaultOrderingTest {
private func getUsedAddresses(app: XCUIApplication, addresses: [Int]) -> Result {
let data = try! JSONEncoder().encode(addresses)
// Make the linkmap available to the app
let s = Server(callback: { return data })
_ = Server(callback: { return data })

// Launch the app for setup
var launchEnvironment = app.launchEnvironment
Expand Down
8 changes: 4 additions & 4 deletions Sources/FaultOrderingTests/Linkmap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func getLinkmap() throws -> [Int: Symbol] {
continue
}

var components = line.split(separator: "\t", maxSplits: 2).map(String.init)
let components = line.split(separator: "\t", maxSplits: 2).map(String.init)
guard components.count == 3 else {
continue
}
Expand Down Expand Up @@ -107,18 +107,18 @@ func getLinkmap() throws -> [Int: Symbol] {
}
} else if inSections {
if line.contains("__TEXT\t__text") {
var components = line.split(separator: "\t", maxSplits: 2).map(String.init)
let components = line.split(separator: "\t", maxSplits: 2).map(String.init)
guard components.count == 3 else {
continue
}
textSectionStart = UInt64(components[0].dropFirst(2), radix: 16) ?? 0
textSectionSize = UInt64(components[1].dropFirst(2), radix: 16) ?? 0
}
} else if inObjectFiles {
if let bracketIndex = line.index(of: "]") {
if let bracketIndex = line.firstIndex(of: "]") {
let line = line[line.index(bracketIndex, offsetBy: 2)...]
if let match = try? /^(.*?)(?:\((.*)\))?$/.firstMatch(in: line) {
if let file = match.2.map { String($0) } {
if let file = match.2.map({ String($0) }) {
objects.append(ObjectFile(file: file, library: String(match.1)))
} else {
objects.append(ObjectFile(file: String(match.1), library: nil))
Expand Down