From 449707a88bd31470b3934a911989f74afecad0b0 Mon Sep 17 00:00:00 2001 From: "timeless@mozdev.org" Date: Sun, 23 May 2010 15:32:42 -0700 Subject: [PATCH] Bug 563200 fix deprecated conversion and comparison between signed and unsigned in testplugin/nptest.cpp. r=jst --HG-- extra : rebase_source : 79958d664a02ad215198770a0c979b21ba3fca24 --- modules/plugin/test/testplugin/nptest.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/plugin/test/testplugin/nptest.cpp b/modules/plugin/test/testplugin/nptest.cpp index 2474be67ddfe..101b821f648d 100644 --- a/modules/plugin/test/testplugin/nptest.cpp +++ b/modules/plugin/test/testplugin/nptest.cpp @@ -63,6 +63,10 @@ #define STATIC_ASSERT(condition) \ extern void np_static_assert(int arg[(condition) ? 1 : -1]) +static char sPluginName[] = PLUGIN_NAME; +static char sPluginDescription[] = PLUGIN_DESCRIPTION; +static char sPluginVersion[] = PLUGIN_VERSION; + // // Intentional crash // @@ -531,17 +535,19 @@ bool scriptableConstruct(NPObject* npobj, const NPVariant* args, uint32_t argCou NP_EXPORT(char*) NP_GetPluginVersion() { - return PLUGIN_VERSION; + return sPluginVersion; } #endif +static char sMimeDescription[] = "application/x-test:tst:Test mimetype"; + #if defined(XP_UNIX) NP_EXPORT(char*) NP_GetMIMEDescription() #elif defined(XP_WIN) || defined(XP_OS2) char* NP_GetMIMEDescription() #endif { - return "application/x-test:tst:Test mimetype"; + return sMimeDescription; } #ifdef XP_UNIX @@ -549,10 +555,10 @@ NP_EXPORT(NPError) NP_GetValue(void* future, NPPVariable aVariable, void* aValue) { switch (aVariable) { case NPPVpluginNameString: - *((char**)aValue) = PLUGIN_NAME; + *((char**)aValue) = sPluginName; break; case NPPVpluginDescriptionString: - *((char**)aValue) = PLUGIN_DESCRIPTION; + *((char**)aValue) = sPluginDescription; break; default: return NPERR_INVALID_PARAM; @@ -593,7 +599,7 @@ NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs) initializeIdentifiers(); - for (int i = 0; i < ARRAY_LENGTH(sPluginPropertyValues); i++) { + for (unsigned int i = 0; i < ARRAY_LENGTH(sPluginPropertyValues); i++) { VOID_TO_NPVARIANT(sPluginPropertyValues[i]); } @@ -639,7 +645,7 @@ NPError OSCALL NP_Shutdown() { clearIdentifiers(); - for (int i = 0; i < ARRAY_LENGTH(sPluginPropertyValues); i++) { + for (unsigned int i = 0; i < ARRAY_LENGTH(sPluginPropertyValues); i++) { NPN_ReleaseVariantValue(&sPluginPropertyValues[i]); }