diff options
| author | nyamatongwe <devnull@localhost> | 2000-04-07 12:14:52 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2000-04-07 12:14:52 +0000 | 
| commit | fb50301368a095e6cbd6d20220431ea8c8ae2cbc (patch) | |
| tree | 51f5b2a345cab9af83bf566a47900b18fe305295 | |
| parent | 9785733416ef26d325802b81692f6fdc3506be55 (diff) | |
| download | scintilla-mirror-fb50301368a095e6cbd6d20220431ea8c8ae2cbc.tar.gz | |
Changing code to ensure no warnings are produced by compilers.
| -rw-r--r-- | vcbuild/SciLexer.dsp | 6 | ||||
| -rw-r--r-- | win32/PlatWin.cxx | 4 | ||||
| -rw-r--r-- | win32/ScintillaWin.cxx | 26 | ||||
| -rw-r--r-- | 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<const unsigned char *>(s);  	int i=0; -	while (i<len) { +	while ((i<len) && (ui<tlen)) {  		unsigned char ch = us[i++];  		if (ch < 0x80) {  			tbuf[ui] = ch; diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 104f15423..c3501f4b6 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -57,6 +57,8 @@  // GCC has trouble with the standard COM ABI so do it the old C way with explicit vtables. +const char callClassName[] = "CallTip"; +  class ScintillaWin; 	// Forward declaration for COM interface subobjects  class FormatEnumerator { @@ -102,7 +104,9 @@ class ScintillaWin :  	static HINSTANCE hInstance;  	ScintillaWin(HWND hwnd); +	ScintillaWin(const ScintillaWin &) : ScintillaBase() {}  	virtual ~ScintillaWin(); +	ScintillaWin &operator=(const ScintillaWin &) { return *this; }  	virtual void Initialise();  	virtual void Finalise(); @@ -528,7 +532,7 @@ void ScintillaWin::SetHorizontalScrollPos() {  bool ScintillaWin::ModifyScrollBars(int nMax, int nPage) {  	bool modified = false;  	SCROLLINFO sci = { -	    sizeof(sci) +	    sizeof(sci),0,0,0,0,0,0  	};  	sci.fMask = SIF_PAGE | SIF_RANGE;  	::GetScrollInfo(wMain.GetID(), SB_VERT, &sci); @@ -617,14 +621,14 @@ void UTF8FromUCS2(wchar_t *uptr, unsigned int tlen, char *putf, int len) {  	for (unsigned int i = 0; i < tlen && uptr[i]; i++) {  		unsigned int uch = uptr[i];  		if (uch < 0x80) { -			putf[k++] = uch; +			putf[k++] = static_cast<char>(uch);  		} else if (uch < 0x800) { -			putf[k++] = 0xC0 | (uch >> 6); -			putf[k++] = 0x80 | (uch & 0x3f); +			putf[k++] = static_cast<char>(0xC0 | (uch >> 6)); +			putf[k++] = static_cast<char>(0x80 | (uch & 0x3f));  		} else { -			putf[k++] = 0xE0 | (uch >> 12); -			putf[k++] = 0x80 | ((uch >> 6) & 0x3f); -			putf[k++] = 0x80 | (uch & 0x3f); +			putf[k++] = static_cast<char>(0xE0 | (uch >> 12)); +			putf[k++] = static_cast<char>(0x80 | ((uch >> 6) & 0x3f)); +			putf[k++] = static_cast<char>(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<wchar_t *>(::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 $@ | 
