aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2013-09-10 14:44:16 +1000
committerNeil <nyamatongwe@gmail.com>2013-09-10 14:44:16 +1000
commita1edd2b133bf3ae4d263cea2f46aacb4b51fccb5 (patch)
tree95cd567b68fc22493443eedd8b9e86739551d07a /win32
parent790cde271408e20b2ffbbe53670e860582df29e4 (diff)
downloadscintilla-mirror-a1edd2b133bf3ae4d263cea2f46aacb4b51fccb5.tar.gz
Use C++ struct initialization {} so can drop -Wno-missing-braces setting for gcc.
Diffstat (limited to 'win32')
-rw-r--r--win32/PlatWin.cxx7
-rw-r--r--win32/ScintillaWin.cxx3
-rw-r--r--win32/makefile2
3 files changed, 5 insertions, 7 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 0c690fd7c..3f8c32eb6 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -212,8 +212,7 @@ struct FormatAndMetrics {
};
HFONT FormatAndMetrics::HFont() {
- LOGFONTW lf;
- memset(&lf, 0, sizeof(lf));
+ LOGFONTW lf = {};
#if defined(USE_D2D)
if (technology == SCWIN_TECH_GDI) {
if (0 == ::GetObjectW(hfont, sizeof(lf), &lf)) {
@@ -782,7 +781,7 @@ void SurfaceGDI::AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fil
int height = rc.Height();
// Ensure not distorted too much by corners when small
cornerSize = Platform::Minimum(cornerSize, (Platform::Minimum(width, height) / 2) - 2);
- BITMAPINFO bpih = {sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0};
+ BITMAPINFO bpih = {{sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0}};
void *image = 0;
HBITMAP hbmMem = CreateDIBSection(reinterpret_cast<HDC>(hMemDC), &bpih,
DIB_RGB_COLORS, &image, NULL, 0);
@@ -845,7 +844,7 @@ void SurfaceGDI::DrawRGBAImage(PRectangle rc, int width, int height, const unsig
rc.top += static_cast<int>((rc.Height() - height) / 2);
rc.bottom = rc.top + height;
- BITMAPINFO bpih = {sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0};
+ BITMAPINFO bpih = {{sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0}};
unsigned char *image = 0;
HBITMAP hbmMem = CreateDIBSection(reinterpret_cast<HDC>(hMemDC), &bpih,
DIB_RGB_COLORS, reinterpret_cast<void **>(&image), NULL, 0);
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index c3222435e..03106b769 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -2283,8 +2283,7 @@ void ScintillaWin::ScrollMessage(WPARAM wParam) {
//DWORD dwStart = timeGetTime();
//Platform::DebugPrintf("Scroll %x %d\n", wParam, lParam);
- SCROLLINFO sci;
- memset(&sci, 0, sizeof(sci));
+ SCROLLINFO sci = {};
sci.cbSize = sizeof(sci);
sci.fMask = SIF_ALL;
diff --git a/win32/makefile b/win32/makefile
index 159d66fdf..9ddfd594a 100644
--- a/win32/makefile
+++ b/win32/makefile
@@ -26,7 +26,7 @@ ifneq "$(shell g++ -c CheckD2D.cxx 2>&1)" ""
D2DFLAGS=-DDISABLE_D2D
endif
-CXXBASEFLAGS=--std=c++0x -Wall -Wno-missing-braces -pedantic $(INCLUDEDIRS) -fno-rtti $(D2DFLAGS)
+CXXBASEFLAGS=--std=c++0x -Wall -pedantic $(INCLUDEDIRS) -fno-rtti $(D2DFLAGS)
ifdef DEBUG
CXXFLAGS=-DDEBUG -g $(CXXBASEFLAGS)