diff --git a/Android/build.sh b/Android/build.sh index 76d8a96..e0e6eed 100755 --- a/Android/build.sh +++ b/Android/build.sh @@ -24,7 +24,7 @@ platform=${ANDROID_PLATFORM:-35} jar=$sdk/platforms/android-$platform/android.jar [ -f "$jar" ] || { echo "No $jar: install the platform with sdkmanager \"platforms;android-$platform\"." >&2; exit 1; } tools=$(ls -d "$sdk"/build-tools/* | sort -V | tail -1) -version=${APP_VERSION:-0.9.14} +version=${APP_VERSION:-0.9.17} IFS=. read -r major minor patch <<<"$version.0.0" code=$((major * 10000 + minor * 100 + ${patch%%[^0-9]*})) diff --git a/App/QRCode.swift b/App/QRCode.swift index f825dbd..fa9b8e1 100644 --- a/App/QRCode.swift +++ b/App/QRCode.swift @@ -50,7 +50,7 @@ enum QRCode { /// The code as text rows of "1" (dark) and "0", for JSON. static func rows(_ text: String) -> [String]? { - encode(text)?.map { row in String(row.map { $0 ? "1" : "0" }) } + encode(text)?.map { row in row.map { $0 ? "1" : "0" }.joined() } } /// The code drawn with half blocks for a terminal, two rows to a line, with a quiet zone of two modules diff --git a/App/StatusJSON.swift b/App/StatusJSON.swift index 1d45e6b..09998a0 100644 --- a/App/StatusJSON.swift +++ b/App/StatusJSON.swift @@ -440,7 +440,7 @@ struct LocalResponse { extension StatusReport { /// Tokenmeter's version. The Mac app reads it from its Info.plist, which build-library-app.sh writes; the /// Linux service has no Info.plist, so it uses `releaseVersion`. Keep that in step with the build scripts. - static let releaseVersion = "0.9.14" + static let releaseVersion = "0.9.17" static var appVersion: String { Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? releaseVersion } diff --git a/Linux/Compression.swift b/Linux/Compression.swift index 043bd23..2e07d1a 100644 --- a/Linux/Compression.swift +++ b/Linux/Compression.swift @@ -15,7 +15,7 @@ enum Gzip { return nil } defer { deflateEnd(&stream) } - var packed = Data(count: Int(deflateBound(&stream, UInt(data.count)))) + var packed = Data(count: Int(deflateBound(&stream, uLong(data.count)))) let capacity = packed.count let status: Int32 = data.withUnsafeBytes { source in packed.withUnsafeMutableBytes { target in diff --git a/Linux/WindowsCalls.swift b/Linux/WindowsCalls.swift index ca0cdba..eb219e0 100644 --- a/Linux/WindowsCalls.swift +++ b/Linux/WindowsCalls.swift @@ -25,7 +25,7 @@ enum WindowsCalls { static func memory() -> Memory? { var status = MEMORYSTATUSEX() status.dwLength = DWORD(MemoryLayout.size) - guard GlobalMemoryStatusEx(&status).boolValue else { return nil } + guard GlobalMemoryStatusEx(&status) else { return nil } let gib = 1_073_741_824.0 // The page file figures count physical memory too: what is beyond it is the page file's own. let pageTotal = max(0, Double(status.ullTotalPageFile) - Double(status.ullTotalPhys)) @@ -43,7 +43,7 @@ enum WindowsCalls { var idle = FILETIME() var kernel = FILETIME() var user = FILETIME() - guard GetSystemTimes(&idle, &kernel, &user).boolValue else { return nil } + guard GetSystemTimes(&idle, &kernel, &user) else { return nil } // Kernel time includes the idle time. let idleSeconds = seconds(idle) return ProcessorTime(idle: idleSeconds, busy: max(0, seconds(kernel) - idleSeconds) + seconds(user)) @@ -55,7 +55,7 @@ enum WindowsCalls { var exited = FILETIME() var kernel = FILETIME() var user = FILETIME() - guard GetProcessTimes(GetCurrentProcess(), &created, &exited, &kernel, &user).boolValue else { return 0 } + guard GetProcessTimes(GetCurrentProcess(), &created, &exited, &kernel, &user) else { return 0 } return seconds(kernel) + seconds(user) } @@ -63,7 +63,7 @@ enum WindowsCalls { static func diskSpace(_ path: String) -> (free: Double, total: Double)? { var free = ULARGE_INTEGER() var total = ULARGE_INTEGER() - let found = path.withCString(encodedAs: UTF16.self) { GetDiskFreeSpaceExW($0, &free, &total, nil).boolValue } + let found = path.withCString(encodedAs: UTF16.self) { GetDiskFreeSpaceExW($0, &free, &total, nil) } guard found else { return nil } return (Double(free.QuadPart), Double(total.QuadPart)) } diff --git a/Linux/kde/app/AppVersion.js b/Linux/kde/app/AppVersion.js index 1d09cd5..b7053a3 100644 --- a/Linux/kde/app/AppVersion.js +++ b/Linux/kde/app/AppVersion.js @@ -3,4 +3,4 @@ // update keeps saying the version it is, while the service reports its own (backend.snapshot.version). // scripts/package-linux.sh and package-flatpak.sh write it from the package's version; keep it in step with // StatusReport.releaseVersion when bumping (a unit test checks it). -var version = "0.9.14" +var version = "0.9.17" diff --git a/Linux/kde/mock/machines.json b/Linux/kde/mock/machines.json index af14fa1..6708682 100644 --- a/Linux/kde/mock/machines.json +++ b/Linux/kde/mock/machines.json @@ -7,7 +7,7 @@ "report": { "schema": 1, "app": "Tokenmeter", - "version": "0.9.14", + "version": "0.9.17", "host": "studio", "chip": "Apple M3 Ultra", "time": "2026-11-13T19:00:00Z", diff --git a/Linux/kde/mock/settings.json b/Linux/kde/mock/settings.json index db3cba1..c2fd093 100644 --- a/Linux/kde/mock/settings.json +++ b/Linux/kde/mock/settings.json @@ -15,7 +15,7 @@ "addresses": [ "192.168.1.20" ], - "version": "0.9.14", + "version": "0.9.17", "shareHistory": false, "footprint": { "cpuPercent": 0.4, diff --git a/Linux/kde/plasmoid/metadata.json b/Linux/kde/plasmoid/metadata.json index 8a84114..94e1afe 100644 --- a/Linux/kde/plasmoid/metadata.json +++ b/Linux/kde/plasmoid/metadata.json @@ -7,7 +7,7 @@ "Icon": "tokenmeter", "Category": "System Information", "License": "Apache-2.0", - "Version": "0.9.14", + "Version": "0.9.17", "Website": "https://github.com/tokenmeter1/Tokenmeter" }, "X-Plasma-API-Minimum-Version": "6.0", diff --git a/build-library-app.sh b/build-library-app.sh index 00b486a..9ea0dbc 100755 --- a/build-library-app.sh +++ b/build-library-app.sh @@ -18,7 +18,7 @@ for word in "$@"; do esac done app="$project_dir/Tokenmeter.app" -version=${APP_VERSION:-0.9.14} +version=${APP_VERSION:-0.9.17} build=${APP_BUILD:-1} # SwiftUI's @State is a compiler macro in the macOS 26 SDK. The Command Line Tools ship that SDK without diff --git a/scripts/package-flatpak.sh b/scripts/package-flatpak.sh index 35ab0f6..ca9bc7b 100755 --- a/scripts/package-flatpak.sh +++ b/scripts/package-flatpak.sh @@ -7,7 +7,7 @@ # Needs flatpak and flatpak-builder; the KDE runtime and SDK are fetched from Flathub. set -eu project_dir=$(cd "$(dirname "$0")/.." && pwd) -version=${APP_VERSION:-0.9.14} +version=${APP_VERSION:-0.9.17} arch=$(uname -m) id=io.github.tokenmeter1.tokenmeter name="Tokenmeter-$version-linux-$arch" diff --git a/scripts/package-linux.sh b/scripts/package-linux.sh index d1f72f1..25ed87f 100755 --- a/scripts/package-linux.sh +++ b/scripts/package-linux.sh @@ -4,7 +4,7 @@ # and install.sh. Needs the Swift toolchain; run it on Linux. set -eu project_dir=$(cd "$(dirname "$0")/.." && pwd) -version=${APP_VERSION:-0.9.14} +version=${APP_VERSION:-0.9.17} arch=$(uname -m) name="Tokenmeter-$version-linux-$arch" diff --git a/scripts/package-service.sh b/scripts/package-service.sh index 7042774..b7242cd 100755 --- a/scripts/package-service.sh +++ b/scripts/package-service.sh @@ -18,7 +18,7 @@ # On a Mac, SIGN_IDENTITY signs the program with a Developer ID; without it the program is ad-hoc signed. set -eu project_dir=$(cd "$(dirname "$0")/.." && pwd) -version=${APP_VERSION:-0.9.14} +version=${APP_VERSION:-0.9.17} case "$(uname -s)" in Darwin) os=macos ;; Linux) os=linux ;; diff --git a/scripts/package.sh b/scripts/package.sh index d5af922..16bc2d1 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -16,7 +16,7 @@ set -euo pipefail project_dir=${0:A:h:h} app="$project_dir/Tokenmeter.app" dist="$project_dir/dist" -export APP_VERSION=${APP_VERSION:-0.9.14} +export APP_VERSION=${APP_VERSION:-0.9.17} identity=${SIGN_IDENTITY:-} profile=${NOTARY_PROFILE:-}