diff options
author | Neil <nyamatongwe@gmail.com> | 2019-04-28 10:20:26 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-04-28 10:20:26 +1000 |
commit | 24b0d88f4d88ba83c52a8588e49c5ea597093618 (patch) | |
tree | e61ef448bc18f4a682f238e6f336ae46ecb04b0f | |
parent | b016d114fe9aadb1e53402193d672bd1141a18a1 (diff) | |
download | scintilla-mirror-24b0d88f4d88ba83c52a8588e49c5ea597093618.tar.gz |
Backport: Fix analysis warnings for GlobalMemory class.
Backport of changeset 7484:e176cb9f97b7.
-rw-r--r-- | win32/ScintillaWin.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index a9361b157..efa0520f8 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -2199,7 +2199,7 @@ public: GlobalMemory &operator=(const GlobalMemory &) = delete; GlobalMemory &operator=(GlobalMemory &&) = delete; ~GlobalMemory() { - PLATFORM_ASSERT(!ptr); + assert(!ptr); assert(!hand); } void Allocate(size_t bytes) noexcept { @@ -2209,15 +2209,15 @@ public: ptr = ::GlobalLock(hand); } } - HGLOBAL Unlock() { - PLATFORM_ASSERT(ptr); + HGLOBAL Unlock() noexcept { + assert(ptr); HGLOBAL handCopy = hand; ::GlobalUnlock(hand); ptr = nullptr; - hand = 0; + hand = {}; return handCopy; } - void SetClip(UINT uFormat) { + void SetClip(UINT uFormat) noexcept { ::SetClipboardData(uFormat, Unlock()); } operator bool() const noexcept { |