diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-02 15:58:45 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-02 15:58:45 +0000 |
commit | 4eae29d3547aedf0388002a55b640571e6a91b5b (patch) | |
tree | e564b735e070ab67c980f39a50dabf60b87e587c /webkit | |
parent | 8d54bd6a28c7b81936271b3cf1eb8e9ec768bd26 (diff) | |
download | chromium_src-4eae29d3547aedf0388002a55b640571e6a91b5b.zip chromium_src-4eae29d3547aedf0388002a55b640571e6a91b5b.tar.gz chromium_src-4eae29d3547aedf0388002a55b640571e6a91b5b.tar.bz2 |
Fix a bunch more type changes as part of the npapi.h merging
This makes two types of changes
- More int* -> int*_t transitions, since npapi.h switched over
- Replace TRUE/FALSE, which have been removed from the upstream npapi.h. Since all our usage is C++, true/false seemed cleaner than 1/0.
BUG=42645
TEST=Compiling still works
Review URL: http://codereview.chromium.org/2484002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48725 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/npapi_extension_thunk.cc | 50 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_host.cc | 16 | ||||
-rw-r--r-- | webkit/tools/npapi_layout_test_plugin/PluginObject.cpp | 24 | ||||
-rw-r--r-- | webkit/tools/npapi_layout_test_plugin/main.cpp | 26 |
4 files changed, 59 insertions, 57 deletions
diff --git a/webkit/glue/plugins/npapi_extension_thunk.cc b/webkit/glue/plugins/npapi_extension_thunk.cc index 5e06021..bcf4be1 100644 --- a/webkit/glue/plugins/npapi_extension_thunk.cc +++ b/webkit/glue/plugins/npapi_extension_thunk.cc @@ -27,7 +27,8 @@ static NPAPI::PluginInstance* FindInstance(NPP id) { // 2D device API --------------------------------------------------------------- -static NPError Device2DQueryCapability(NPP id, int32 capability, int32* value) { +static NPError Device2DQueryCapability(NPP id, int32_t capability, + int32_t* value) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { plugin->webplugin()->delegate()->Device2DQueryCapability(capability, value); @@ -63,7 +64,7 @@ static NPError Device2DInitializeContext(NPP id, static NPError Device2DSetStateContext(NPP id, NPDeviceContext* context, - int32 state, + int32_t state, intptr_t value) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { @@ -75,7 +76,7 @@ static NPError Device2DSetStateContext(NPP id, static NPError Device2DGetStateContext(NPP id, NPDeviceContext* context, - int32 state, + int32_t state, intptr_t* value) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { @@ -120,26 +121,27 @@ static NPError Device2DDestroyContext(NPP id, static NPError Device2DCreateBuffer(NPP id, NPDeviceContext* context, size_t size, - int32* buffer_id) { + int32_t* buffer_id) { return NPERR_GENERIC_ERROR; } static NPError Device2DDestroyBuffer(NPP id, NPDeviceContext* context, - int32 buffer_id) { + int32_t buffer_id) { return NPERR_GENERIC_ERROR; } static NPError Device2DMapBuffer(NPP id, NPDeviceContext* context, - int32 buffer_id, + int32_t buffer_id, NPDeviceBuffer* buffer) { return NPERR_GENERIC_ERROR; } // 3D device API --------------------------------------------------------------- -static NPError Device3DQueryCapability(NPP id, int32 capability, int32* value) { +static NPError Device3DQueryCapability(NPP id, int32_t capability, + int32_t* value) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { plugin->webplugin()->delegate()->Device3DQueryCapability(capability, value); @@ -175,7 +177,7 @@ static NPError Device3DInitializeContext(NPP id, static NPError Device3DSetStateContext(NPP id, NPDeviceContext* context, - int32 state, + int32_t state, intptr_t value) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { @@ -187,7 +189,7 @@ static NPError Device3DSetStateContext(NPP id, static NPError Device3DGetStateContext(NPP id, NPDeviceContext* context, - int32 state, + int32_t state, intptr_t* value) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { @@ -222,7 +224,7 @@ static NPError Device3DDestroyContext(NPP id, static NPError Device3DCreateBuffer(NPP id, NPDeviceContext* context, size_t size, - int32* buffer_id) { + int32_t* buffer_id) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { return plugin->webplugin()->delegate()->Device3DCreateBuffer( @@ -233,7 +235,7 @@ static NPError Device3DCreateBuffer(NPP id, static NPError Device3DDestroyBuffer(NPP id, NPDeviceContext* context, - int32 buffer_id) { + int32_t buffer_id) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { return plugin->webplugin()->delegate()->Device3DDestroyBuffer( @@ -244,7 +246,7 @@ static NPError Device3DDestroyBuffer(NPP id, static NPError Device3DMapBuffer(NPP id, NPDeviceContext* context, - int32 buffer_id, + int32_t buffer_id, NPDeviceBuffer* buffer) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { @@ -256,7 +258,7 @@ static NPError Device3DMapBuffer(NPP id, // Experimental 3D device API -------------------------------------------------- -static NPError Device3DGetNumConfigs(NPP id, int32* num_configs) { +static NPError Device3DGetNumConfigs(NPP id, int32_t* num_configs) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { return plugin->webplugin()->delegate()->Device3DGetNumConfigs(num_configs); @@ -265,8 +267,8 @@ static NPError Device3DGetNumConfigs(NPP id, int32* num_configs) { } static NPError Device3DGetConfigAttribs(NPP id, - int32 config, - int32* attrib_list) { + int32_t config, + int32_t* attrib_list) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { return plugin->webplugin()->delegate()->Device3DGetConfigAttribs( @@ -277,8 +279,8 @@ static NPError Device3DGetConfigAttribs(NPP id, } static NPError Device3DCreateContext(NPP id, - int32 config, - const int32* attrib_list, + int32_t config, + const int32_t* attrib_list, NPDeviceContext** context) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { @@ -294,8 +296,8 @@ static NPError Device3DSynchronizeContext( NPP id, NPDeviceContext* context, NPDeviceSynchronizationMode mode, - const int32* input_attrib_list, - int32* output_attrib_list, + const int32_t* input_attrib_list, + int32_t* output_attrib_list, NPDeviceSynchronizeContextCallbackPtr callback, void* callback_data) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); @@ -315,7 +317,7 @@ static NPError Device3DSynchronizeContext( static NPError Device3DRegisterCallback( NPP id, NPDeviceContext* context, - int32 callback_type, + int32_t callback_type, NPDeviceGenericCallbackPtr callback, void* callback_data) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); @@ -332,8 +334,8 @@ static NPError Device3DRegisterCallback( // Audio device API ------------------------------------------------------------ -static NPError DeviceAudioQueryCapability(NPP id, int32 capability, - int32* value) { +static NPError DeviceAudioQueryCapability(NPP id, int32_t capability, + int32_t* value) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { plugin->webplugin()->delegate()->DeviceAudioQueryCapability(capability, @@ -370,7 +372,7 @@ static NPError DeviceAudioInitializeContext(NPP id, static NPError DeviceAudioSetStateContext(NPP id, NPDeviceContext* context, - int32 state, + int32_t state, intptr_t value) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin) { @@ -382,7 +384,7 @@ static NPError DeviceAudioSetStateContext(NPP id, static NPError DeviceAudioGetStateContext(NPP id, NPDeviceContext* context, - int32 state, + int32_t state, intptr_t* value) { scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); return plugin->webplugin()->delegate()->DeviceAudioGetStateContext( diff --git a/webkit/glue/plugins/plugin_host.cc b/webkit/glue/plugins/plugin_host.cc index a6e0fde..f78efd1 100644 --- a/webkit/glue/plugins/plugin_host.cc +++ b/webkit/glue/plugins/plugin_host.cc @@ -606,7 +606,7 @@ void NPN_InvalidateRect(NPP id, NPRect *invalidRect) { rect.right = invalidRect->right; rect.top = invalidRect->top; rect.bottom = invalidRect->bottom; - ::InvalidateRect(plugin->window_handle(), &rect, FALSE); + ::InvalidateRect(plugin->window_handle(), &rect, false); return; } #endif @@ -712,13 +712,13 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { break; case NPNVSupportsXEmbedBool: - *reinterpret_cast<NPBool*>(value) = TRUE; + *reinterpret_cast<NPBool*>(value) = true; rv = NPERR_NO_ERROR; break; #endif case NPNVSupportsWindowless: { NPBool* supports_windowless = reinterpret_cast<NPBool*>(value); - *supports_windowless = TRUE; + *supports_windowless = true; rv = NPERR_NO_ERROR; break; } @@ -762,7 +762,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { // only want to use it as a fallback to keep plugins from crashing: if a // plugin knows enough to ask, we want them to use CoreGraphics. NPBool* supports_qd = reinterpret_cast<NPBool*>(value); - *supports_qd = FALSE; + *supports_qd = false; rv = NPERR_NO_ERROR; break; } @@ -774,14 +774,14 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { case NPNVsupportsCocoaBool: { // we do support these drawing and event models. NPBool* supports_model = reinterpret_cast<NPBool*>(value); - *supports_model = TRUE; + *supports_model = true; rv = NPERR_NO_ERROR; break; } case NPNVsupportsCoreAnimationBool: { // We only support the Core Animation model on 10.6 and higher NPBool* supports_model = reinterpret_cast<NPBool*>(value); - *supports_model = SupportsSharingAcceleratedSurfaces() ? TRUE : FALSE; + *supports_model = SupportsSharingAcceleratedSurfaces() ? true : false; rv = NPERR_NO_ERROR; break; } @@ -789,7 +789,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { // This drawing model was never widely supported, and we don't plan to // support it. NPBool* supports_model = reinterpret_cast<NPBool*>(value); - *supports_model = FALSE; + *supports_model = false; rv = NPERR_NO_ERROR; break; } @@ -1060,7 +1060,7 @@ NPBool NPN_ConvertPoint(NPP id, double sourceX, double sourceY, destX, destY, destSpace); } NOTREACHED(); - return FALSE; + return false; } } // extern "C" diff --git a/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp b/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp index 026d74f..390f9ec 100644 --- a/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp +++ b/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp @@ -327,7 +327,7 @@ static NPIdentifier stringVariantToIdentifier(NPVariant variant) static NPIdentifier int32VariantToIdentifier(NPVariant variant) { assert(NPVARIANT_IS_INT32(variant)); - int32 integer = NPVARIANT_TO_INT32(variant); + int32_t integer = NPVARIANT_TO_INT32(variant); return browser->getintidentifier(integer); } @@ -336,7 +336,7 @@ static NPIdentifier doubleVariantToIdentifier(NPVariant variant) assert(NPVARIANT_IS_DOUBLE(variant)); double value = NPVARIANT_TO_DOUBLE(variant); // Sadly there is no "getdoubleidentifier" - int32 integer = static_cast<int32>(value); + int32_t integer = static_cast<int32_t>(value); return browser->getintidentifier(integer); } @@ -372,7 +372,7 @@ static bool testIdentifierToInt(PluginObject*, const NPVariant* args, uint32_t a NPIdentifier identifier = variantToIdentifier(args[0]); if (!identifier) return false; - int32 integer = browser->intfromidentifier(identifier); + int32_t integer = browser->intfromidentifier(identifier); INT32_TO_NPVARIANT(integer, *result); return true; } @@ -573,7 +573,7 @@ static bool testGetIntIdentifier(PluginObject*, const NPVariant* args, uint32_t return false; } - INT32_TO_NPVARIANT(static_cast<int32>(reinterpret_cast<intptr_t>(identifier)), *result); + INT32_TO_NPVARIANT(static_cast<int32_t>(reinterpret_cast<intptr_t>(identifier)), *result); return true; } @@ -677,7 +677,7 @@ static bool testPostURLFile(PluginObject* obj, const NPVariant* args, uint32_t a if (written != 1) return false; - NPError error = browser->posturl(obj->npp, url, target, pathString.UTF8Length, path, TRUE); + NPError error = browser->posturl(obj->npp, url, target, pathString.UTF8Length, path, true); free(path); free(target); @@ -966,13 +966,13 @@ static NPObject *pluginAllocate(NPP npp, NPClass *theClass) newInstance->npp = npp; newInstance->testObject = browser->createobject(npp, getTestClass()); - newInstance->eventLogging = FALSE; + newInstance->eventLogging = false; newInstance->onStreamLoad = 0; newInstance->onStreamDestroy = 0; newInstance->onURLNotify = 0; - newInstance->logDestroy = FALSE; - newInstance->logSetWindow = FALSE; - newInstance->returnErrorFromNewStream = FALSE; + newInstance->logDestroy = false; + newInstance->logSetWindow = false; + newInstance->returnErrorFromNewStream = false; newInstance->stream = 0; newInstance->firstUrl = NULL; @@ -980,9 +980,9 @@ static NPObject *pluginAllocate(NPP npp, NPClass *theClass) newInstance->lastUrl = NULL; newInstance->lastHeaders = NULL; - newInstance->testDocumentOpenInDestroyStream = FALSE; - newInstance->testWindowOpen = FALSE; - newInstance->testKeyboardFocusForPlugins = FALSE; + newInstance->testDocumentOpenInDestroyStream = false; + newInstance->testWindowOpen = false; + newInstance->testKeyboardFocusForPlugins = false; return (NPObject*)newInstance; } diff --git a/webkit/tools/npapi_layout_test_plugin/main.cpp b/webkit/tools/npapi_layout_test_plugin/main.cpp index 0445204..94abff7 100644 --- a/webkit/tools/npapi_layout_test_plugin/main.cpp +++ b/webkit/tools/npapi_layout_test_plugin/main.cpp @@ -111,7 +111,7 @@ EXPORT void NPAPI NP_Shutdown(void) static void executeScript(const PluginObject* obj, const char* script); -NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char *argn[], char *argv[], NPSavedData *saved) +NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16_t argc, char *argn[], char *argv[], NPSavedData *saved) { if (browser->version >= 14) { PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass()); @@ -124,7 +124,7 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch else if (strcasecmp(argn[i], "onURLNotify") == 0 && !obj->onURLNotify) obj->onURLNotify = strdup(argv[i]); else if (strcasecmp(argn[i], "logfirstsetwindow") == 0) - obj->logSetWindow = TRUE; + obj->logSetWindow = true; else if (strcasecmp(argn[i], "testnpruntime") == 0) testNPRuntime(instance); else if (strcasecmp(argn[i], "logSrc") == 0) { @@ -137,11 +137,11 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch } else if (strcasecmp(argn[i], "cleardocumentduringnew") == 0) { executeScript(obj, "document.body.innerHTML = ''"); } else if (strcasecmp(argn[i], "testdocumentopenindestroystream") == 0) { - obj->testDocumentOpenInDestroyStream = TRUE; + obj->testDocumentOpenInDestroyStream = true; } else if (strcasecmp(argn[i], "testwindowopen") == 0) { - obj->testWindowOpen = TRUE; + obj->testWindowOpen = true; } else if (strcasecmp(argn[i], "src") == 0 && strstr(argv[i], "plugin-document-has-focus.pl")) - obj->testKeyboardFocusForPlugins = TRUE; + obj->testKeyboardFocusForPlugins = true; } instance->pdata = obj; @@ -183,12 +183,12 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window) if (obj->logSetWindow) { log(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height); fflush(stdout); - obj->logSetWindow = FALSE; + obj->logSetWindow = false; } if (obj->testWindowOpen) { testWindowOpen(instance); - obj->testWindowOpen = FALSE; + obj->testWindowOpen = false; } if (obj->testKeyboardFocusForPlugins) { @@ -242,18 +242,18 @@ NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason) if (obj->testDocumentOpenInDestroyStream) { testDocumentOpen(instance); - obj->testDocumentOpenInDestroyStream = FALSE; + obj->testDocumentOpenInDestroyStream = false; } return NPERR_NO_ERROR; } -int32 NPP_WriteReady(NPP instance, NPStream *stream) +int32_t NPP_WriteReady(NPP instance, NPStream *stream) { return 0; } -int32 NPP_Write(NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer) +int32_t NPP_Write(NPP instance, NPStream *stream, int32_t offset, int32_t len, void *buffer) { return 0; } @@ -266,7 +266,7 @@ void NPP_Print(NPP instance, NPPrint *platformPrint) { } -int16 NPP_HandleEvent(NPP instance, void *event) +int16_t NPP_HandleEvent(NPP instance, void *event) { PluginObject* obj = static_cast<PluginObject*>(instance->pdata); if (!obj->eventLogging) @@ -303,7 +303,7 @@ int16 NPP_HandleEvent(NPP instance, void *event) log(instance, "keyUp '%c'", MapVirtualKey(evt->wParam, MAPVK_VK_TO_CHAR)); if (obj->testKeyboardFocusForPlugins) { obj->eventLogging = false; - obj->testKeyboardFocusForPlugins = FALSE; + obj->testKeyboardFocusForPlugins = false; executeScript(obj, "layoutTestController.notifyDone();"); } break; @@ -461,7 +461,7 @@ NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value) *((const char **)value) = "Simple Netscape plug-in that handles test content for WebKit"; break; case NPPVpluginNeedsXEmbed: - *((NPBool *)value) = TRUE; + *((NPBool *)value) = true; break; #endif case NPPVpluginScriptableNPObject: { |