mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
Fix cppcheck reported issues (#333)
Fixes: https://github.com/microsoft/PowerToys/issues/266
This commit is contained in:
committed by
GitHub
parent
12cd7bb49f
commit
8ac6db8b5a
@@ -73,7 +73,7 @@ void start_initial_powertoys() {
|
||||
}
|
||||
only_enable_some_powertoys = true;
|
||||
}
|
||||
catch (std::exception ex) {
|
||||
catch (std::exception&) {
|
||||
// Couldn't read the general settings correctly.
|
||||
// Load all powertoys.
|
||||
only_enable_some_powertoys = false;
|
||||
|
||||
@@ -71,7 +71,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
Trace::EventLaunch();
|
||||
|
||||
result = run_message_loop();
|
||||
} catch (std::runtime_error err) {
|
||||
} catch (std::runtime_error& err) {
|
||||
std::string err_what = err.what();
|
||||
MessageBoxW(NULL, std::wstring(err_what.begin(),err_what.end()).c_str(), L"Error", MB_OK | MB_ICONERROR);
|
||||
result = -1;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
class PowertoyModule;
|
||||
|
||||
struct PowertoyModuleDeleter {
|
||||
void operator()(PowertoyModuleIface* module) {
|
||||
void operator()(PowertoyModuleIface* module) const {
|
||||
if (module) {
|
||||
powertoys_events().unregister_receiver(module);
|
||||
module->disable();
|
||||
@@ -21,7 +21,7 @@ struct PowertoyModuleDeleter {
|
||||
|
||||
struct PowertoyModuleDLLDeleter {
|
||||
using pointer = HMODULE;
|
||||
void operator()(HMODULE handle) {
|
||||
void operator()(HMODULE handle) const {
|
||||
FreeLibrary(handle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ json::value get_power_toys_settings() {
|
||||
json::value powertoys_config = json::value::parse(powertoy.get_config());
|
||||
result.as_object()[name] = powertoys_config;
|
||||
}
|
||||
catch (json::json_exception ex) {
|
||||
catch (json::json_exception&) {
|
||||
//Malformed JSON.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user