Add explicit casts to printing of function pointers (flutter/engine#16370)

Compiling with clang on Windows fails here with a warning about implicit
cast from function pointer to object pointer. Rather than disable that
warning, this makes it an explicit cast. Since this is just test output,
it's not critical that this be a completely safe operation.

Part of #16256
This commit is contained in:
stuartmorgan
2020-02-05 22:31:22 -08:00
committed by GitHub
parent 427ec5300c
commit 91424efae5

View File

@@ -224,16 +224,16 @@ inline std::ostream& operator<<(std::ostream& out,
const FlutterOpenGLTexture& item) { const FlutterOpenGLTexture& item) {
return out << "(FlutterOpenGLTexture) Target: 0x" << std::hex << item.target return out << "(FlutterOpenGLTexture) Target: 0x" << std::hex << item.target
<< std::dec << " Name: " << item.name << " Format: " << item.format << std::dec << " Name: " << item.name << " Format: " << item.format
<< " User Data: " << item.user_data << " User Data: " << item.user_data << " Destruction Callback: "
<< " Destruction Callback: " << item.destruction_callback; << reinterpret_cast<void*>(item.destruction_callback);
} }
inline std::ostream& operator<<(std::ostream& out, inline std::ostream& operator<<(std::ostream& out,
const FlutterOpenGLFramebuffer& item) { const FlutterOpenGLFramebuffer& item) {
return out << "(FlutterOpenGLFramebuffer) Target: 0x" << std::hex return out << "(FlutterOpenGLFramebuffer) Target: 0x" << std::hex
<< item.target << std::dec << " Name: " << item.name << item.target << std::dec << " Name: " << item.name
<< " User Data: " << item.user_data << " User Data: " << item.user_data << " Destruction Callback: "
<< " Destruction Callback: " << item.destruction_callback; << reinterpret_cast<void*>(item.destruction_callback);
} }
inline std::string FlutterPlatformViewMutationTypeToString( inline std::string FlutterPlatformViewMutationTypeToString(
@@ -318,8 +318,8 @@ inline std::ostream& operator<<(std::ostream& out,
const FlutterSoftwareBackingStore& item) { const FlutterSoftwareBackingStore& item) {
return out << "(FlutterSoftwareBackingStore) Allocation: " << item.allocation return out << "(FlutterSoftwareBackingStore) Allocation: " << item.allocation
<< " Row Bytes: " << item.row_bytes << " Height: " << item.height << " Row Bytes: " << item.row_bytes << " Height: " << item.height
<< " User Data: " << item.user_data << " User Data: " << item.user_data << " Destruction Callback: "
<< " Destruction Callback: " << item.destruction_callback; << reinterpret_cast<void*>(item.destruction_callback);
} }
inline std::ostream& operator<<(std::ostream& out, inline std::ostream& operator<<(std::ostream& out,