Skip to content

Commit

Permalink
Add explicit casts to printing of function pointers (flutter#16370)
Browse files Browse the repository at this point in the history
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 flutter#16256
  • Loading branch information
stuartmorgan authored and NoamDev committed Feb 27, 2020
1 parent c102a90 commit d1457e3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions shell/platform/embedder/tests/embedder_assertions.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,16 @@ inline std::ostream& operator<<(std::ostream& out,
const FlutterOpenGLTexture& item) {
return out << "(FlutterOpenGLTexture) Target: 0x" << std::hex << item.target
<< std::dec << " Name: " << item.name << " Format: " << item.format
<< " User Data: " << item.user_data
<< " Destruction Callback: " << item.destruction_callback;
<< " User Data: " << item.user_data << " Destruction Callback: "
<< reinterpret_cast<void*>(item.destruction_callback);
}

inline std::ostream& operator<<(std::ostream& out,
const FlutterOpenGLFramebuffer& item) {
return out << "(FlutterOpenGLFramebuffer) Target: 0x" << std::hex
<< item.target << std::dec << " Name: " << item.name
<< " User Data: " << item.user_data
<< " Destruction Callback: " << item.destruction_callback;
<< " User Data: " << item.user_data << " Destruction Callback: "
<< reinterpret_cast<void*>(item.destruction_callback);
}

inline std::string FlutterPlatformViewMutationTypeToString(
Expand Down Expand Up @@ -318,8 +318,8 @@ inline std::ostream& operator<<(std::ostream& out,
const FlutterSoftwareBackingStore& item) {
return out << "(FlutterSoftwareBackingStore) Allocation: " << item.allocation
<< " Row Bytes: " << item.row_bytes << " Height: " << item.height
<< " User Data: " << item.user_data
<< " Destruction Callback: " << item.destruction_callback;
<< " User Data: " << item.user_data << " Destruction Callback: "
<< reinterpret_cast<void*>(item.destruction_callback);
}

inline std::ostream& operator<<(std::ostream& out,
Expand Down

0 comments on commit d1457e3

Please sign in to comment.