diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-28 08:58:48 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-09-07 02:42:30 -0500 |
commit | ed75aa271956824c89b7c9df2c06e4ad09a74734 (patch) | |
tree | 432c17088789736364b2932b9085e5b17a8cc71a /extensions | |
parent | 5ca2d1e26513095670b3fd2dce6a464a415cab89 (diff) |
create clang plugin to warn about C-style casts
We don't like C-style casts in our nice C++ code
Change-Id: I94e7ec90de9275cd6e20c4146d4f3a74bed93c9d
Reviewed-on: https://gerrit.libreoffice.org/10367
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/nsplugin/source/npshell.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/extensions/source/nsplugin/source/npshell.cxx b/extensions/source/nsplugin/source/npshell.cxx index b73c3e8841d3..84aff99c9d5d 100644 --- a/extensions/source/nsplugin/source/npshell.cxx +++ b/extensions/source/nsplugin/source/npshell.cxx @@ -507,7 +507,7 @@ NPP_New(NPMIMEType pluginType, PLUGIN_MSG msg; memset((char*)&msg, 0, sizeof(PLUGIN_MSG)); msg.msg_id = SO_NEW_INSTANCE; - msg.instance_id = (plugin_Int32)instance; + msg.instance_id = reinterpret_cast<plugin_Int32>(instance); if (!sendMsg(&msg, sizeof(PLUGIN_MSG), 1)) return NPERR_GENERIC_ERROR; @@ -528,7 +528,7 @@ NPP_Destroy(NPP instance, NPSavedData** /*save*/) PLUGIN_MSG msg; memset((char*)&msg, 0, sizeof(PLUGIN_MSG)); msg.msg_id = SO_DESTROY; - msg.instance_id = (plugin_Int32)instance; + msg.instance_id = reinterpret_cast<plugin_Int32>(instance); #ifdef UNIX msg.wnd_id =(plugin_Int32)((PluginInstance*) instance->pdata)->window; #endif //end of UNIX @@ -580,14 +580,14 @@ NPP_SetWindow(NPP instance, NPWindow* window) PLUGIN_MSG msg; memset((char*)&msg, 0, sizeof(msg)); msg.msg_id = SO_SET_WINDOW; - msg.instance_id = (plugin_Int32)instance; + msg.instance_id = reinterpret_cast<plugin_Int32>(instance); if ( window ) { // Set window info for instance #ifdef UNIX ws_info = (NPSetWindowCallbackStruct *)window->ws_info; - This->window = (Window) window->window; + This->window = reinterpret_cast<Window>( window->window); This->x = window->x; This->y = window->y; This->width = window->width; @@ -608,7 +608,7 @@ NPP_SetWindow(NPP instance, NPWindow* window) debug_fprintf(NSP_LOG_APPEND, "W=(%d) H=(%d)\n", window->width, window->height); // fill the window dependent part of the message - msg.wnd_id = (plugin_Int32) window->window; + msg.wnd_id = reinterpret_cast<plugin_Int32>(window->window); msg.wnd_x = window->x; msg.wnd_y = window->y; msg.wnd_w = window->width; @@ -815,7 +815,7 @@ NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname) PLUGIN_MSG msg; memset((char*)&msg, 0, sizeof(PLUGIN_MSG)); msg.msg_id = SO_SET_URL; - msg.instance_id = (plugin_Int32)instance; + msg.instance_id = reinterpret_cast<plugin_Int32>(instance); #ifdef UNIX msg.wnd_id =(plugin_Int32)(This->window); sprintf(msg.url, "file://%s", localPathNew); @@ -831,7 +831,7 @@ NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname) // send SO_SET_WINDOW message // memset((char*)&msg, 0, sizeof(PLUGIN_MSG)); msg.msg_id = SO_SET_WINDOW; - msg.instance_id = (plugin_Int32)instance; + msg.instance_id = reinterpret_cast<plugin_Int32>(instance); // msg.wnd_id =(plugin_Int32)((PluginInstance*) instance->pdata)->window; #ifdef UNIX msg.wnd_x = This->x; @@ -869,7 +869,7 @@ NPP_Print(NPP instance, NPPrint* printInfo) PLUGIN_MSG msg; memset((char*)&msg, 0, sizeof(PLUGIN_MSG)); msg.msg_id = SO_PRINT; - msg.instance_id = (plugin_Int32)instance; + msg.instance_id = reinterpret_cast<plugin_Int32>(instance); if(!sendMsg(&msg, sizeof(PLUGIN_MSG), 1)) debug_fprintf(NSP_LOG_APPEND, "NPP_StreamAsFile send SO_SET_WINDOW return failure \n"); /**************************************/ |