diff options
author | nyamatongwe <unknown> | 2005-03-19 06:52:37 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2005-03-19 06:52:37 +0000 |
commit | 6007ca5bf84031f6e353d05907f195ef448769ca (patch) | |
tree | fd9ab0c0fda9ee1269c62d6b667968ca063370f1 | |
parent | 2a7a8b7e99b33159957d6b6ca9fbb7c77aab738c (diff) | |
download | scintilla-mirror-6007ca5bf84031f6e353d05907f195ef448769ca.tar.gz |
Initialise all SCNotification structs to {0} ensuring all fields are 0 or
NULL. Added options to make files so that this does trigger warnings.
-rw-r--r-- | gtk/ScintillaGTK.cxx | 6 | ||||
-rw-r--r-- | gtk/makefile | 2 | ||||
-rw-r--r-- | src/Editor.cxx | 32 | ||||
-rw-r--r-- | src/ScintillaBase.cxx | 4 | ||||
-rw-r--r-- | win32/makefile | 2 | ||||
-rw-r--r-- | win32/scintilla.mak | 2 |
6 files changed, 24 insertions, 24 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index a1cbffe10..17da56f97 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -889,7 +889,7 @@ sptr_t ScintillaGTK::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam return TargetAsUTF8(reinterpret_cast<char*>(lParam)); case SCI_ENCODEDFROMUTF8: - return EncodedFromUTF8(reinterpret_cast<char*>(wParam), + return EncodedFromUTF8(reinterpret_cast<char*>(wParam), reinterpret_cast<char*>(lParam)); default: @@ -1120,7 +1120,7 @@ void ScintillaGTK::NotifyParent(SCNotification scn) { } void ScintillaGTK::NotifyKey(int key, int modifiers) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_KEY; scn.ch = key; scn.modifiers = modifiers; @@ -1129,7 +1129,7 @@ void ScintillaGTK::NotifyKey(int key, int modifiers) { } void ScintillaGTK::NotifyURIDropped(const char *list) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_URIDROPPED; scn.text = list; diff --git a/gtk/makefile b/gtk/makefile index dc66a30e2..d9a6a65b6 100644 --- a/gtk/makefile +++ b/gtk/makefile @@ -23,7 +23,7 @@ vpath %.h ../src ../include vpath %.cxx ../src INCLUDEDIRS=-I ../include -I ../src -CXXBASEFLAGS=-W -Wall -Wno-char-subscripts -DGTK -DSCI_LEXER $(INCLUDEDIRS) +CXXBASEFLAGS=-Wall -Wno-missing-braces -Wno-char-subscripts -DGTK -DSCI_LEXER $(INCLUDEDIRS) ifdef NOTHREADS THREADFLAGS=-DG_THREADS_IMPL_NONE diff --git a/src/Editor.cxx b/src/Editor.cxx index cd4f63130..9211335df 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3437,7 +3437,7 @@ void Editor::DelCharBack(bool allowLineStartDeletion) { void Editor::NotifyFocus(bool) {} void Editor::NotifyStyleToNeeded(int endStyleNeeded) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_STYLENEEDED; scn.position = endStyleNeeded; NotifyParent(scn); @@ -3448,7 +3448,7 @@ void Editor::NotifyStyleNeeded(Document*, void *, int endStyleNeeded) { } void Editor::NotifyChar(int ch) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_CHARADDED; scn.ch = ch; NotifyParent(scn); @@ -3461,7 +3461,7 @@ void Editor::NotifyChar(int ch) { } void Editor::NotifySavePoint(bool isSavePoint) { - SCNotification scn; + SCNotification scn = {0}; if (isSavePoint) { scn.nmhdr.code = SCN_SAVEPOINTREACHED; } else { @@ -3471,19 +3471,19 @@ void Editor::NotifySavePoint(bool isSavePoint) { } void Editor::NotifyModifyAttempt() { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_MODIFYATTEMPTRO; NotifyParent(scn); } void Editor::NotifyDoubleClick(Point, bool) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_DOUBLECLICK; NotifyParent(scn); } void Editor::NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_HOTSPOTDOUBLECLICK; scn.position = position; scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | @@ -3492,7 +3492,7 @@ void Editor::NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, boo } void Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_HOTSPOTCLICK; scn.position = position; scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | @@ -3501,13 +3501,13 @@ void Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt) } void Editor::NotifyUpdateUI() { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_UPDATEUI; NotifyParent(scn); } void Editor::NotifyPainted() { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_PAINTED; NotifyParent(scn); } @@ -3521,7 +3521,7 @@ bool Editor::NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt) { x += vs.ms[margin].width; } if ((marginClicked >= 0) && vs.ms[marginClicked].sensitive) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_MARGINCLICK; scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | (alt ? SCI_ALT : 0); @@ -3535,7 +3535,7 @@ bool Editor::NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt) { } void Editor::NotifyNeedShown(int pos, int len) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_NEEDSHOWN; scn.position = pos; scn.length = len; @@ -3543,7 +3543,7 @@ void Editor::NotifyNeedShown(int pos, int len) { } void Editor::NotifyDwelling(Point pt, bool state) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = state ? SCN_DWELLSTART : SCN_DWELLEND; scn.position = PositionFromLocationClose(pt); scn.x = pt.x; @@ -3552,7 +3552,7 @@ void Editor::NotifyDwelling(Point pt, bool state) { } void Editor::NotifyZoom() { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_ZOOM; NotifyParent(scn); } @@ -3564,7 +3564,7 @@ void Editor::NotifyModifyAttempt(Document*, void *) { } void Editor::NotifyMove(int position) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_POSCHANGED; scn.position = position; NotifyParent(scn); @@ -3711,7 +3711,7 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) { NotifyChange(); // Send EN_CHANGE } - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_MODIFIED; scn.position = mh.position; scn.modificationType = mh.modificationType; @@ -3841,7 +3841,7 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long } // Send notification - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_MACRORECORD; scn.message = iMessage; scn.wParam = wParam; diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 7735d35db..9526ab968 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -320,7 +320,7 @@ void ScintillaBase::AutoCompleteCompleted() { ac.Show(false); listSelected = selected; - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = listType > 0 ? SCN_USERLISTSELECTION : SCN_AUTOCSELECTION; scn.message = 0; scn.wParam = listType; @@ -384,7 +384,7 @@ void ScintillaBase::CallTipShow(Point pt, const char *defn) { } void ScintillaBase::CallTipClick() { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_CALLTIPCLICK; scn.position = ct.clickPlace; NotifyParent(scn); diff --git a/win32/makefile b/win32/makefile index 98460fc54..19d208448 100644 --- a/win32/makefile +++ b/win32/makefile @@ -29,7 +29,7 @@ LDFLAGS=-mwindows -lstdc++ -limm32 -lole32 -luuid -mno-cygwin # Add -MMD to get dependencies #CXXFLAGS = -g -pg -pedantic -Os -fno-exceptions -fvtable-thunks -fno-rtti INCLUDEDIRS=-I ../include -I ../src -CXXBASEFLAGS = -W -Wall -pedantic $(INCLUDEDIRS) -Os -fno-exceptions $(THUNKFLAGS) -fno-rtti -mno-cygwin +CXXBASEFLAGS=-Wall -Wno-missing-braces -pedantic $(INCLUDEDIRS) -Os -fno-exceptions $(THUNKFLAGS) -fno-rtti -mno-cygwin ifdef DEBUG CXXFLAGS=-DDEBUG $(CXXBASEFLAGS) diff --git a/win32/scintilla.mak b/win32/scintilla.mak index 0ecfb642c..1fa6ec422 100644 --- a/win32/scintilla.mak +++ b/win32/scintilla.mak @@ -52,7 +52,7 @@ CC=bcc32 RC=brcc32 -r LD=ilink32 -CXXFLAGS=-P -tWM -w -w-prc -w-inl -RT- -x- +CXXFLAGS=-P -tWM -w -w-prc -w-inl -w-pin -RT- -x- # Above turns off warnings for clarfying parentheses and inlines with for not expanded CXXDEBUG=-Od -v -DDEBUG CXXNDEBUG=-O1 -DNDEBUG |