Skip to content

Commit

Permalink
Resolve warning by replacing generic get with specific types
Browse files Browse the repository at this point in the history
AX/Sources/AX/AXValue.swift:130:13: Forming 'UnsafeMutableRawPointer' to a variable of type 'V'; this is likely incorrect because 'V' may contain an object reference.
rustle committed Oct 15, 2023
1 parent 08b8269 commit 1b37967
Showing 1 changed file with 50 additions and 2 deletions.
52 changes: 50 additions & 2 deletions Sources/AX/AXValue.swift
Original file line number Diff line number Diff line change
@@ -120,9 +120,57 @@ public extension AXValue {
var type: AXValueType {
AXValueGetType(self)
}
func get<V>(
func get(
_ type: AXValueType,
_ result: inout V
_ result: inout CGPoint
) throws {
guard AXValueGetValue(
self,
type,
&result
) else {
throw AXError.failure
}
}
func get(
_ type: AXValueType,
_ result: inout CGSize
) throws {
guard AXValueGetValue(
self,
type,
&result
) else {
throw AXError.failure
}
}
func get(
_ type: AXValueType,
_ result: inout CGRect
) throws {
guard AXValueGetValue(
self,
type,
&result
) else {
throw AXError.failure
}
}
func get(
_ type: AXValueType,
_ result: inout ApplicationServices.AXError
) throws {
guard AXValueGetValue(
self,
type,
&result
) else {
throw AXError.failure
}
}
func get(
_ type: AXValueType,
_ result: inout CFRange
) throws {
guard AXValueGetValue(
self,

0 comments on commit 1b37967

Please sign in to comment.