Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1038)

Unified Diff: xfa/include/fwl/core/fwl_note.h

Issue 1508883003: Replace more static casts in FWL (part 3) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | xfa/include/fwl/core/fwl_widgetmgr.h » ('j') | xfa/src/fwl/src/core/fwl_gridimp.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/include/fwl/core/fwl_note.h
diff --git a/xfa/include/fwl/core/fwl_note.h b/xfa/include/fwl/core/fwl_note.h
index 66366e92e44da5081f3778fdbed48e520dc4b1cd..d078387f522e3f12caac6a9b0692fa923d3f85bb 100644
--- a/xfa/include/fwl/core/fwl_note.h
+++ b/xfa/include/fwl/core/fwl_note.h
@@ -169,6 +169,9 @@ class CFWL_Message : public CFWL_Note {
virtual ~CFWL_Message() {}
virtual CFWL_Event* CloneToEvent() { return NULL; }
};
+
+// FIXME: CloneToEvent() relies on events having the same layout as
+// messages, and the hash in the "event" will be wrong, too.
#define BEGIN_FWL_MESSAGE_DEF(classname, msghashcode) \
class classname : public CFWL_Message { \
public: \
@@ -182,7 +185,7 @@ class CFWL_Message : public CFWL_Note {
virtual CFWL_Event* CloneToEvent() { \
classname* pEvent = new classname; \
pEvent->m_bIsEvent = TRUE; \
- return (CFWL_Event*)pEvent; \
+ return reinterpret_cast<CFWL_Event*>(pEvent); \
}
#define END_FWL_MESSAGE_DEF \
} \
« no previous file with comments | « no previous file | xfa/include/fwl/core/fwl_widgetmgr.h » ('j') | xfa/src/fwl/src/core/fwl_gridimp.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698