[CPP][Analyzers] turn on warning 4189 (#21522)

* Turn on 4189 and fix code

* changes from PR comments
This commit is contained in:
sosssego
2022-11-14 22:15:58 +00:00
committed by GitHub
parent 0a19f0dfc7
commit f408c34aca
14 changed files with 24 additions and 32 deletions

View File

@@ -20,7 +20,7 @@ namespace notifications
}
const auto now = timeutil::now();
const size_t buf_size = sizeof(now);
if (RegSetValueExW(key, nullptr, 0, REG_QWORD, reinterpret_cast<const BYTE*>(&now), sizeof(now)) != ERROR_SUCCESS)
if (RegSetValueExW(key, nullptr, 0, REG_QWORD, reinterpret_cast<const BYTE*>(&now), buf_size) != ERROR_SUCCESS)
{
RegCloseKey(key);
return false;

View File

@@ -405,7 +405,7 @@ void notifications::update_toast_progress_bar(std::wstring_view tag, progress_ba
map.Insert(L"progressTitle", params.progress_title);
NotificationData data(map);
NotificationUpdateResult res = notifier.Update(data, tag, DEFAULT_TOAST_GROUP);
notifier.Update(data, tag, DEFAULT_TOAST_GROUP);
}
void notifications::remove_toasts_by_tag(std::wstring_view tag)