From 8b68892120dcfd53befc0dc8e8e16353af711a11 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 7 Apr 2000 12:14:52 +0000 Subject: Changing code to ensure no warnings are produced by compilers. --- vcbuild/SciLexer.dsp | 6 +++++- win32/PlatWin.cxx | 4 ++-- win32/ScintillaWin.cxx | 26 ++++++++++++++------------ win32/makefile | 2 +- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/vcbuild/SciLexer.dsp b/vcbuild/SciLexer.dsp index ceaedf345..1fc845331 100644 --- a/vcbuild/SciLexer.dsp +++ b/vcbuild/SciLexer.dsp @@ -70,7 +70,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SciLexer_EXPORTS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MD /W3 /Gm /ZI /Od /I "..\include" /I "..\src" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SCI_LEXER" /FR /FD /GZ /c +# ADD CPP /nologo /MD /W4 /Gm /ZI /Od /I "..\include" /I "..\src" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SCI_LEXER" /FR /FD /GZ /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 @@ -200,6 +200,10 @@ SOURCE=..\src\WindowAccessor.cxx # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\include\Platform.h +# End Source File # End Group # Begin Group "Resource Files" diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 7ce9930e4..eb81b8fa2 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -293,7 +293,7 @@ void Surface::FillRectangle(PRectangle rc, Colour back) { } void Surface::FillRectangle(PRectangle rc, Surface &surfacePattern) { - HBRUSH br = 0; + HBRUSH br; if (surfacePattern.bitmap) br = ::CreatePatternBrush(surfacePattern.bitmap); else // Something is wrong so display in red @@ -330,7 +330,7 @@ int UCS2FromUTF8(const char *s, int len, wchar_t *tbuf, int tlen) { int ui=0; const unsigned char *us = reinterpret_cast(s); int i=0; - while (i(uch); } else if (uch < 0x800) { - putf[k++] = 0xC0 | (uch >> 6); - putf[k++] = 0x80 | (uch & 0x3f); + putf[k++] = static_cast(0xC0 | (uch >> 6)); + putf[k++] = static_cast(0x80 | (uch & 0x3f)); } else { - putf[k++] = 0xE0 | (uch >> 12); - putf[k++] = 0x80 | ((uch >> 6) & 0x3f); - putf[k++] = 0x80 | (uch & 0x3f); + putf[k++] = static_cast(0xE0 | (uch >> 12)); + putf[k++] = static_cast(0x80 | ((uch >> 6) & 0x3f)); + putf[k++] = static_cast(0x80 | (uch & 0x3f)); } } putf[len] = '\0'; @@ -991,7 +995,7 @@ void ScintillaWin::ImeStartComposition() { // Since the style creation code has been made platform independent, // The logfont for the IME is recreated here. int styleHere = (pdoc->StyleAt(currentPos)) & 31; - LOGFONT lf = {0}; + LOGFONT lf = {0,0,0,0,0,0,0,0,0,0,0,0,0,""}; int sizeZoomed = vs.styles[styleHere].size + vs.zoomLevel; if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1 sizeZoomed = 2; @@ -1242,12 +1246,11 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState, SetDragPosition(invalidPosition); - STGMEDIUM medium; + STGMEDIUM medium={0,{0},0}; HRESULT hr = S_OK; wchar_t *udata = 0; char *data = 0; - int dataLen = 0; if (SC_CP_UTF8 == pdoc->dbcsCodePage) { FORMATETC fmtu = {CF_UNICODETEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; @@ -1256,7 +1259,7 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState, udata = static_cast(::GlobalLock(medium.hGlobal)); int tlen = ::GlobalSize(medium.hGlobal); // Convert UCS-2 to UTF-8 - dataLen = UTF8Length(udata, tlen/2); + int dataLen = UTF8Length(udata, tlen/2); data = new char[dataLen+1]; if (data) { UTF8FromUCS2(udata, tlen/2, data, dataLen); @@ -1282,7 +1285,6 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState, POINT rpt = {pt.x, pt.y}; ::ScreenToClient(wMain.GetID(), &rpt); - Point npt(rpt.x, rpt.y); int movePos = PositionFromLocation(Point(rpt.x, rpt.y)); DropAt(movePos, data, *pdwEffect == DROPEFFECT_MOVE, hrRectangular == S_OK); diff --git a/win32/makefile b/win32/makefile index 2fc51baae..a55c08ea8 100644 --- a/win32/makefile +++ b/win32/makefile @@ -19,7 +19,7 @@ LDFLAGS = -lkernel32 -lgdi32 -luser32 -lwinmm -lcomdlg32 -lcomctl32 -limm32 -lol # Add -MMD to get dependencies #CXXFLAGS = -g -pg -pedantic -Os -fno-exceptions -fvtable-thunks -fno-rtti INCLUDEDIRS=-I ../include -I ../src -CXXFLAGS = -pedantic $(INCLUDEDIRS) -Os -fno-exceptions -fvtable-thunks -fno-rtti +CXXFLAGS = -W -Wall -pedantic $(INCLUDEDIRS) -Os -fno-exceptions -fvtable-thunks -fno-rtti .cxx.o: $(CC) $(CXXFLAGS) -c $< -o $@ -- cgit v1.2.3