Fix build warnings !150
merged
merged by cmc on 2026-10-07 23:52 UTC
· krz/orgstar:fix-build-warnings into main
10 files changed, +13 −9
Layout: unified · split
Package.swift
+3 −2
| @@ -54,7 +54,8 @@ let package = Package( |
| 54 | 54 | .target(name: "TreeSitterClojure", path: "Sources/TreeSitterClojure", sources: ["src/parser.c"], cSettings: [.headerSearchPath("src")]), |
| 55 | 55 | .target( |
| 56 | 56 | name: "TreeSitterScanners", path: "Sources/TreeSitterScanners", |
| 57 | | sources: ["javascript/scanner.c", "lua/scanner.c", "python/scanner.c", "yaml/scanner.c"] |
| 57 | sources: ["javascript/scanner.c", "lua/scanner.c", "python/scanner.c", "yaml/scanner.c"], |
| 58 | cSettings: [.unsafeFlags(["-Wno-shorten-64-to-32"])] |
| 58 | 59 | ), |
| 59 | 60 | .target( |
| 60 | 61 | name: "OrgHighlight", |
| @@ -89,7 +90,7 @@ let package = Package( |
| 89 | 90 | .executableTarget(name: "OrgstarSpotlight", dependencies: ["OrgCore"], linkerSettings: extensionEntry), |
| 90 | 91 | // The iOS share extension, bundled into the iOS app by scripts/build-ios-app.sh. |
| 91 | 92 | .executableTarget(name: "OrgstarShare", dependencies: ["OrgApp"], linkerSettings: extensionEntry), |
| 92 | | .testTarget(name: "OrgCoreTests", dependencies: ["OrgCore"]), |
| 93 | .testTarget(name: "OrgCoreTests", dependencies: ["OrgCore"], exclude: ["Conformance"]), |
| 93 | 94 | .testTarget(name: "OrgDocumentTests", dependencies: ["OrgDocument"]), |
| 94 | 95 | .testTarget(name: "OrgIndexTests", dependencies: ["OrgIndex"]), |
| 95 | 96 | .testTarget(name: "OrgWorkspaceTests", dependencies: ["OrgWorkspace"]), |
Sources/OrgCore/Agenda/AgendaSearch.swift
+1 −1
| @@ -111,7 +111,7 @@ public struct TagsMatcher: Sendable { |
| 111 | 111 | |
| 112 | 112 | if tagsPart.contains(where: { !$0.isWhitespace }) { |
| 113 | 113 | var alternatives: [[Term]] = [] |
| 114 | | var parts = Self.split(tagsPart) |
| 114 | let parts = Self.split(tagsPart) |
| 115 | 115 | var i = 0 |
| 116 | 116 | while i < parts.count { |
| 117 | 117 | var part = parts[i] |
Sources/OrgCore/Commands/Fill.swift
+1 −1
| @@ -305,7 +305,7 @@ extension EmacsBuffer { |
| 305 | 305 | /// `fill-region-as-paragraph` with left justification and adaptive fill. |
| 306 | 306 | func fillRegionAsParagraph(_ fromOffset: Int, _ toOffset: Int, prefix fixedPrefix: String? = nil) { |
| 307 | 307 | point = min(fromOffset, toOffset) |
| 308 | | var to = max(fromOffset, toOffset) |
| 308 | let to = max(fromOffset, toOffset) |
| 309 | 309 | skipForward(Self.whitespace) |
| 310 | 310 | let fromPlusIndent = point |
| 311 | 311 | point = lineStart(point) |
Sources/OrgCore/Commands/TagCommands.swift
+1 −1
| @@ -62,7 +62,7 @@ public struct SetTags: OrgCommand { |
| 62 | 62 | commitBuffer(context) { buffer in |
| 63 | 63 | try buffer.saveExcursion { |
| 64 | 64 | try buffer.backToHeading() |
| 65 | | try buffer.saveExcursion { |
| 65 | buffer.saveExcursion { |
| 66 | 66 | let line = buffer.saveExcursion { buffer.lookingAt(Self.tagLine) } |
| 67 | 67 | let old = line.flatMap { $0[2] }.map { buffer.substring($0.lowerBound, $0.upperBound).split(separator: ":").map(String.init) } ?? [] |
| 68 | 68 | if tags != old { |
Sources/OrgCore/Config/Elisp.swift
+1 −1
| @@ -584,7 +584,7 @@ public final class Elisp { |
| 584 | 584 | guard let last = args.last else { return .nil } |
| 585 | 585 | var items: [Sexp] = [] |
| 586 | 586 | for arg in args.dropLast() { items += try sequence(arg) } |
| 587 | | return try items.reversed().reduce(last) { cons($1, $0) } |
| 587 | return items.reversed().reduce(last) { cons($1, $0) } |
| 588 | 588 | } |
| 589 | 589 | lisp.define("length") { _, args in |
| 590 | 590 | try arity(args, 1...1, "length") |
Sources/OrgCore/Config/Lisp.swift
+1 −1
| @@ -198,7 +198,7 @@ public enum LispReader { |
| 198 | 198 | case "t": return 9 |
| 199 | 199 | case "s": return 32 |
| 200 | 200 | case "e": return 27 |
| 201 | | case "C", "M", "S", "s", "H", "A": |
| 201 | case "C", "M", "S", "H", "A": |
| 202 | 202 | if peek == "-" { _ = next(); return try character() } |
| 203 | 203 | return Int(e.value) |
| 204 | 204 | default: return Int(e.value) |
Sources/OrgCore/Keymap/Vim.swift
+1 −1
| @@ -599,7 +599,7 @@ public struct Vim: Sendable { |
| 599 | 599 | } |
| 600 | 600 | guard let p = find(kind, last.char, buffer, c, count: n, repeating: true) else { return .invalid } |
| 601 | 601 | return .moved(p, kind == "f" || kind == "t" ? .inclusive : .exclusive) |
| 602 | | case ("s", []), ("S", []) where !operatorPending: |
| 602 | case ("s", []) where !operatorPending, ("S", []) where !operatorPending: |
| 603 | 603 | // evil-snipe with `evil-snipe-scope` line. |
| 604 | 604 | guard keys.count >= 3 else { return .incomplete } |
| 605 | 605 | let chars = keys[1].key + keys[2].key |
Sources/Orgstar/AgendaView.swift
+2 −1
| @@ -738,7 +738,8 @@ struct AgendaRow: View { |
| 738 | 738 | guard let todo = item.todo, text.hasPrefix(todo + " ") else { return Text(text) } |
| 739 | 739 | let rest = String(text.dropFirst(todo.count)) |
| 740 | 740 | let rest_ = Text(rest).foregroundColor(item.isDone ? theme.color("comment") ?? .secondary : theme.color("foreground") ?? .primary) |
| 741 | | return Text(todo).foregroundColor(theme.keywordColor(todo, done: item.isDone)).bold() + rest_ |
| 741 | let todo_ = Text(todo).foregroundColor(theme.keywordColor(todo, done: item.isDone)).bold() |
| 742 | return Text("\(todo_)\(rest_)") |
| 742 | 743 | } |
| 743 | 744 | } |
| 744 | 745 | |
Sources/Orgstar/FastSelectionView.swift
+1
| @@ -1,4 +1,5 @@ |
| 1 | 1 | import OrgCore |
| 2 | import OrgPresentation |
| 2 | 3 | import SwiftUI |
| 3 | 4 | |
| 4 | 5 | /// Fast TODO and tag selection in the echo area: each option with its key. TODO keywords take |
Sources/Orgstar/Keys.swift
+1
| @@ -1,6 +1,7 @@ |
| 1 | 1 | import OrgApp |
| 2 | 2 | import OrgCore |
| 3 | 3 | import OrgEditorAppKit |
| 4 | import OrgPresentation |
| 4 | 5 | import SwiftUI |
| 5 | 6 | |
| 6 | 7 | struct KeyHint: Hashable { |