From ad2eb5b9f610020869e53e54d056eaee3a417af8 Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Thu, 27 May 2004 19:32:39 +0000 Subject: [PATCH] Fix compiler warnings by actually using declared variables b=217089 p=gautheri@noos.fr r/sr=alecf --- modules/plugin/samples/default/os2/plugin.cpp | 5 +++-- modules/plugin/samples/default/windows/plugin.cpp | 5 +++-- plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/plugin/samples/default/os2/plugin.cpp b/modules/plugin/samples/default/os2/plugin.cpp index fd12eb306bb..4b2322570fd 100644 --- a/modules/plugin/samples/default/os2/plugin.cpp +++ b/modules/plugin/samples/default/os2/plugin.cpp @@ -59,7 +59,6 @@ static char szPageUrlForJVM[] = JVM_SMARTUPDATE_URL; //static char szPluginFinderCommandFormatString[] = PLUGINFINDER_COMMAND; static char szPluginFinderCommandBeginning[] = PLUGINFINDER_COMMAND_BEGINNING; static char szPluginFinderCommandEnd[] = PLUGINFINDER_COMMAND_END; -static char szDefaultFileExt[] = "*"; BOOL RegisterNullPluginWindowClass() { @@ -494,10 +493,12 @@ void CPlugin::URLNotify(const char * szURL) int iSize = WinLoadString((HAB)0, m_hInst, IDS_GOING2HTML, sizeof(buf), buf); NPError rc = NPN_NewStream(m_pNPInstance, "text/html", "asd_plugin_finder", &pStream); + if (rc != NPERR_NO_ERROR) + return; //char buf[] = "\n\n\n

NPN_NewStream / NPN_Write - This seems to work.

\n\n\n"; - int32 iBytes = NPN_Write(m_pNPInstance, pStream, strlen(buf), buf); + NPN_Write(m_pNPInstance, pStream, iSize, buf); NPN_DestroyStream(m_pNPInstance, pStream, NPRES_DONE); } diff --git a/modules/plugin/samples/default/windows/plugin.cpp b/modules/plugin/samples/default/windows/plugin.cpp index 1753f2bae62..7bbe2eb0897 100644 --- a/modules/plugin/samples/default/windows/plugin.cpp +++ b/modules/plugin/samples/default/windows/plugin.cpp @@ -60,7 +60,6 @@ static char szPageUrlForJVM[] = JVM_SMARTUPDATE_URL; //static char szPluginFinderCommandFormatString[] = PLUGINFINDER_COMMAND; static char szPluginFinderCommandBeginning[] = PLUGINFINDER_COMMAND_BEGINNING; static char szPluginFinderCommandEnd[] = PLUGINFINDER_COMMAND_END; -static char szDefaultFileExt[] = "*"; BOOL RegisterNullPluginWindowClass() { @@ -554,10 +553,12 @@ void CPlugin::URLNotify(const char * szURL) int iSize = LoadString(m_hInst, IDS_GOING2HTML, buf, sizeof(buf)); NPError rc = NPN_NewStream(m_pNPInstance, "text/html", "asd_plugin_finder", &pStream); + if (rc != NPERR_NO_ERROR) + return; //char buf[] = "\n\n\n

NPN_NewStream / NPN_Write - This seems to work.

\n\n\n"; - int32 iBytes = NPN_Write(m_pNPInstance, pStream, lstrlen(buf), buf); + NPN_Write(m_pNPInstance, pStream, iSize, buf); NPN_DestroyStream(m_pNPInstance, pStream, NPRES_DONE); } diff --git a/plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp b/plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp index 44c7b781671..9835f84694a 100644 --- a/plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp +++ b/plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp @@ -2281,7 +2281,7 @@ CPluginInstancePeer::NewStream(nsMIMEType type, const char* target, // Create a new NPStream. NPStream* ptr = NULL; NPError error = NPN_NewStream(npp, (NPMIMEType)type, target, &ptr); - if (error) + if (error != NPERR_NO_ERROR) return fromNPError[error]; // Create a new Plugin Manager Stream.