diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/ShellExt/src/shlicons.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/ShellExt/src/shlicons.cpp')
-rw-r--r-- | plugins/ShellExt/src/shlicons.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/ShellExt/src/shlicons.cpp b/plugins/ShellExt/src/shlicons.cpp index 20f941a03e..8f9162a7c0 100644 --- a/plugins/ShellExt/src/shlicons.cpp +++ b/plugins/ShellExt/src/shlicons.cpp @@ -22,14 +22,14 @@ Why didn't they just do this themselves? ... IWICImagingFactory* ARGB_GetWorker()
{
- IWICImagingFactory *res = NULL;
- CoCreateInstance(CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IWICImagingFactory, (void**)&res);
+ IWICImagingFactory *res = nullptr;
+ CoCreateInstance(CLSID_WICImagingFactory, nullptr, CLSCTX_INPROC_SERVER, IID_IWICImagingFactory, (void**)&res);
return res;
}
HBITMAP ARGB_BitmapFromIcon(IWICImagingFactory *Factory, HDC hDC, HICON hIcon)
{
- HBITMAP hBmp = NULL;
+ HBITMAP hBmp = nullptr;
// This code gives an icon to WIC and gets a bitmap object in return, it then creates a DIB section
// which is 32bits and the same H*W as the icon. It then asks the bitmap object to copy itself into the DIB }
@@ -40,7 +40,7 @@ HBITMAP ARGB_BitmapFromIcon(IWICImagingFactory *Factory, HDC hDC, HICON hIcon) bmi.bmiHeader.biCompression = BI_RGB;
bmi.bmiHeader.biBitCount = 32;
- IWICBitmap *bitmap = NULL;
+ IWICBitmap *bitmap = nullptr;
HRESULT hr = Factory->CreateBitmapFromHICON(hIcon, &bitmap);
if (hr == S_OK) {
int cx, cy;
@@ -50,16 +50,16 @@ HBITMAP ARGB_BitmapFromIcon(IWICImagingFactory *Factory, HDC hDC, HICON hIcon) bmi.bmiHeader.biHeight = -cy;
void *pbBuffer;
- hBmp = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pbBuffer, 0, 0);
- if (hBmp != 0) {
+ hBmp = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pbBuffer, nullptr, 0);
+ if (hBmp != nullptr) {
UINT cbStride = cx * sizeof(DWORD); // ARGB = DWORD
UINT cbBuffer = cy * cbStride;
// note: the pbBuffer memory is owned by the DIB and will be freed when the bitmap is released
- hr = bitmap->CopyPixels(NULL, cbStride, cbBuffer, (PBYTE)pbBuffer);
+ hr = bitmap->CopyPixels(nullptr, cbStride, cbBuffer, (PBYTE)pbBuffer);
if (hr != S_OK) {
// the copy failed, delete the DIB
DeleteObject(hBmp);
- hBmp = NULL;
+ hBmp = nullptr;
}
}
}
|