diff options
author | Moonchild <moonchild@palemoon.org> | 2023-11-04 01:24:20 +0100 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2023-11-08 13:47:43 +0100 |
commit | eb7be8c637b7b382161d009b302ae9713470c553 (patch) | |
tree | 710cc937d09e944c7d52954179cec73b5c72383d | |
parent | 080c8cc1347937f274e2d7cdab5aea31f00c608f (diff) | |
download | uxp-eb7be8c637b7b382161d009b302ae9713470c553.tar.gz |
Issue #2342: Use [[nodiscard]] in IPDL generation and fix warnings
DOM plugin code had two warning in IPC caught by [[nodiscard]], these
were fixed in one go.
-rwxr-xr-x | dom/plugins/ipc/PluginModuleParent.cpp | 5 | ||||
-rw-r--r-- | dom/plugins/ipc/PluginUtilsWin.cpp | 4 | ||||
-rw-r--r-- | ipc/ipdl/ipdl/cxx/cgen.py | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index 4dff7b0f41..c4461bc901 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -2210,7 +2210,10 @@ PluginModuleParent::NPP_NewInternal(NPMIMEType pluginType, NPP instance, if (supportsAsyncRender) { // Prefs indicates we want async plugin rendering, make sure // the flash module has support. - CallModuleSupportsAsyncRender(&supportsAsyncRender); + if (!CallModuleSupportsAsyncRender(&supportsAsyncRender)) { + // The actual support call failed. Should not happen; abort. + return NS_ERROR_FAILURE; + } } #ifdef _WIN64 // For 64-bit builds force windowless if the flash library doesn't support diff --git a/dom/plugins/ipc/PluginUtilsWin.cpp b/dom/plugins/ipc/PluginUtilsWin.cpp index db6387a511..83b91b6b29 100644 --- a/dom/plugins/ipc/PluginUtilsWin.cpp +++ b/dom/plugins/ipc/PluginUtilsWin.cpp @@ -34,7 +34,9 @@ public: for (auto iter = mAudioNotificationSet->ConstIter(); !iter.Done(); iter.Next()) {
PluginModuleParent* pluginModule = iter.Get()->GetKey();
- pluginModule->SendNPP_SetValue_NPNVaudioDeviceChangeDetails(mChangeDetails);
+ if (!pluginModule->SendNPP_SetValue_NPNVaudioDeviceChangeDetails(mChangeDetails)) {
+ // Sending of notification failed. Ignore for now.
+ }
}
return NS_OK;
}
diff --git a/ipc/ipdl/ipdl/cxx/cgen.py b/ipc/ipdl/ipdl/cxx/cgen.py index 30f2f2bca6..7dfb194ea6 100644 --- a/ipc/ipdl/ipdl/cxx/cgen.py +++ b/ipc/ipdl/ipdl/cxx/cgen.py @@ -185,7 +185,7 @@ class CxxCodeGen(CodePrinter, Visitor): self.printdent() if md.warn_unused: - self.write('MOZ_MUST_USE ') + self.write('[[nodiscard]] ') if md.inline: self.write('inline ') if md.never_inline: |