Fix useless cast warning
This commit is contained in:
parent
2f507cc24d
commit
2b1a2c7a19
@ -333,6 +333,10 @@ namespace detail {
|
|||||||
unsigned long long to_ull(T t) {
|
unsigned long long to_ull(T t) {
|
||||||
return static_cast<unsigned long long>(t);
|
return static_cast<unsigned long long>(t);
|
||||||
}
|
}
|
||||||
|
template<typename T>
|
||||||
|
unsigned long long to_uintptr(T t) {
|
||||||
|
return static_cast<uintptr_t>(t);
|
||||||
|
}
|
||||||
|
|
||||||
// A way to cast to U without "warning: useless cast to type"
|
// A way to cast to U without "warning: useless cast to type"
|
||||||
template<typename U, typename V>
|
template<typename U, typename V>
|
||||||
|
|||||||
@ -138,7 +138,7 @@ namespace detail {
|
|||||||
// On x86/x64/arm, as far as I can tell, the frame return address is always one after the call
|
// On x86/x64/arm, as far as I can tell, the frame return address is always one after the call
|
||||||
// So we just decrement to get the pc back inside the `call` / `bl`
|
// So we just decrement to get the pc back inside the `call` / `bl`
|
||||||
// This is done with _Unwind too but conditionally based on info from _Unwind_GetIPInfo.
|
// This is done with _Unwind too but conditionally based on info from _Unwind_GetIPInfo.
|
||||||
trace.push_back(static_cast<uintptr_t>(frame.AddrPC.Offset) - 1);
|
trace.push_back(to_uintptr(frame.AddrPC.Offset) - 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// base
|
// base
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user