diff --git a/Finding.cpp b/Finding.cpp index 36a8df0d..5d76445d 100644 --- a/Finding.cpp +++ b/Finding.cpp @@ -24,7 +24,7 @@ line, when required. */ -#pragma warning( disable : 4800 ) // never mind those "bool" warnings +#pragma warning (disable : 4800) // forcing value to bool 'true' or 'false' (performance warning) static void WrapUpFind (CFindInfo & FindInfo) diff --git a/MUSHclient.cpp b/MUSHclient.cpp index f83fdf5c..4f1ea219 100644 --- a/MUSHclient.cpp +++ b/MUSHclient.cpp @@ -263,7 +263,6 @@ BOOL CMUSHclientApp::InitInstance() // open SQLite database for preferences - char *zErrMsg = 0; int rc; CFileStatus status; diff --git a/MUSHclient.dsp b/MUSHclient.dsp index 384c24ea..5cdd4028 100644 --- a/MUSHclient.dsp +++ b/MUSHclient.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir ".\WinDebug" # PROP Ignore_Export_Lib 0 # ADD BASE CPP /nologo /MT /W3 /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /FR /Yu"stdafx.h" /c -# ADD CPP /nologo /MTd /W3 /Gm /Gi /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "LUA51" /Fr /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MTd /W4 /Gm /Gi /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "LUA51" /Fr /Yu"stdafx.h" /FD /c # ADD MTL /nologo /D "_DEBUG" /mktyplib203 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" @@ -1133,8 +1133,15 @@ SOURCE=.\pcre\pcre_info.c # Begin Source File SOURCE=.\pcre\pcre_maketables.c -# ADD CPP /D "HAVE_CONFIG_H" + +!IF "$(CFG)" == "MUSHclient - Win32 Debug" + # SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "MUSHclient - Win32 Release" + +!ENDIF + # End Source File # Begin Source File @@ -1423,19 +1430,6 @@ SOURCE=.\install\readme.txt # Section MUSHclient : {00000000-0001-0000-0000-000000000000} # 1:23:CG_IDR_POPUP_MAIN_FRAME:126 # End Section -# Section MUSHclient : {F3B1306C-16CC-11D0-B7D0-00A0247B3BFD} -# 0:8:Splash.h:D:\SOURCE\MUSHclient\Splash.h -# 0:10:Splash.cpp:D:\SOURCE\MUSHclient\Splash.cpp -# 1:10:IDB_SPLASH:102 -# 2:10:ResHdrName:resource.h -# 2:11:ProjHdrName:stdafx.h -# 2:10:WrapperDef:_SPLASH_SCRN_ -# 2:12:SplClassName:CSplashWnd -# 2:21:SplashScreenInsertKey:4.0 -# 2:10:HeaderName:Splash.h -# 2:10:ImplemName:Splash.cpp -# 2:7:BmpID16:IDB_SPLASH -# End Section # Section MUSHclient : {F3B13065-16CC-11D0-B7D0-00A0247B3BFD} # 0:8:TipDlg.h:D:\SOURCE\MUSHclient\TipDlg.h # 0:10:TipDlg.cpp:D:\SOURCE\MUSHclient\TipDlg.cpp @@ -1461,6 +1455,19 @@ SOURCE=.\install\readme.txt # 2:18:CG_IDS_FILE_ABSENT:CG_IDS_FILE_ABSENT # 2:10:TipDlg.cpp:TipDlg.cpp # End Section +# Section MUSHclient : {F3B1306C-16CC-11D0-B7D0-00A0247B3BFD} +# 0:8:Splash.h:D:\SOURCE\MUSHclient\Splash.h +# 0:10:Splash.cpp:D:\SOURCE\MUSHclient\Splash.cpp +# 1:10:IDB_SPLASH:102 +# 2:10:ResHdrName:resource.h +# 2:11:ProjHdrName:stdafx.h +# 2:10:WrapperDef:_SPLASH_SCRN_ +# 2:12:SplClassName:CSplashWnd +# 2:21:SplashScreenInsertKey:4.0 +# 2:10:HeaderName:Splash.h +# 2:10:ImplemName:Splash.cpp +# 2:7:BmpID16:IDB_SPLASH +# End Section # Section MUSHclient : {00000000-0000-0000-0000-000000000000} # 1:22:CG_IDR_POPUP_SEND_VIEW:124 # End Section diff --git a/ProcessPreviousLine.cpp b/ProcessPreviousLine.cpp index 8cbdfae2..3feb5777 100644 --- a/ProcessPreviousLine.cpp +++ b/ProcessPreviousLine.cpp @@ -38,7 +38,7 @@ return CFormat ("%c[%dm", ESC, Code); void CMUSHclientDoc::LogLineInHTMLcolour (POSITION startpos) { - COLORREF prevcolour = -1; + COLORREF prevcolour = NO_COLOUR; bool bInSpan = false; COLORREF lastforecolour = 0; COLORREF lastbackcolour = 0; @@ -324,8 +324,8 @@ assemble the full text of the original line. bUnderline = false, bBlink = false, bInverse = false; - unsigned int iForeground = -1; - unsigned int iBackground = -1; + unsigned int iForeground = NO_COLOUR; + unsigned int iBackground = NO_COLOUR; CString str; CString strRun; @@ -952,11 +952,12 @@ POSITION pos; for (iItem = 0; iItem < GetTriggerArray ().GetSize (); iItem++) { - if (trigger_item = EvaluateTrigger (strCurrentLine, + trigger_item = EvaluateTrigger (strCurrentLine, strResponse, iItem, iStartCol, - iEndCol)) + iEndCol); + if (trigger_item) { @@ -969,9 +970,9 @@ POSITION pos; if (trigger_item->iMatch && !trigger_item->bMultiLine) { - int iFlags; - COLORREF iForeColour; - COLORREF iBackColour; + int iFlags = 0; + COLORREF iForeColour = NO_COLOUR; + COLORREF iBackColour = NO_COLOUR; int iCurrentCol = 0; for (pos = prevpos; pos; ) // scan to end of buffer { @@ -983,7 +984,7 @@ POSITION pos; if (i < 0) i = 0; - CStyle * pStyle; + CStyle * pStyle = NULL; int iStyleCol = 0; // find style run @@ -994,10 +995,13 @@ POSITION pos; if (iStyleCol > i) // we are at the column break; } // end of finding style item - - iFlags = pStyle->iFlags & STYLE_BITS; // get style - iForeColour = pStyle->iForeColour; - iBackColour = pStyle->iBackColour; + + if (pStyle) + { + iFlags = pStyle->iFlags & STYLE_BITS; // get style + iForeColour = pStyle->iForeColour; + iBackColour = pStyle->iBackColour; + } break; // done } iCurrentCol += pLine->len; // next line starts where this left off diff --git a/TextView.cpp b/TextView.cpp index 965a817b..44f6eb45 100644 --- a/TextView.cpp +++ b/TextView.cpp @@ -18,7 +18,7 @@ Copyright (C) 2000 Nick Gammon. #include "dialogs\GoToLineDlg.h" #include "dialogs\LuaGsubDlg.h" -#pragma warning (disable:4100) +#pragma warning( disable : 4100) // unreferenced formal parameter #ifdef _DEBUG //#define new DEBUG_NEW @@ -1186,7 +1186,6 @@ void CTextView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) !m_bInsertMode && nStartChar == nEndChar) { - bool bEndLine = false; CString strText; GetEditCtrl().GetWindowText (strText); diff --git a/Utilities.cpp b/Utilities.cpp index 7647128c..598a94b6 100644 --- a/Utilities.cpp +++ b/Utilities.cpp @@ -184,8 +184,10 @@ char * pNew = p; char c; int i; - for ( ; c = *p; p++) + for ( ; *p; p++) { + c = *p; + // look for escape sequences ... if (c == '\\') { @@ -441,7 +443,6 @@ bool GetClipboardColour (COLORREF & colour) { CString strColour; int i; -bool bEnable = true; bool bReverse; CColours * colour_item; @@ -534,7 +535,7 @@ static char base64code[64]= int getBase64Value(char code){ int val= (int)code; - int result; + int result = 0; if (val >= 'A' && val <= 'Z') result= val - 65; diff --git a/chatsock.h b/chatsock.h index 43c5926a..47f290c9 100644 --- a/chatsock.h +++ b/chatsock.h @@ -52,7 +52,7 @@ class CMUSHclientDoc; #define CHAT_SEND_COMMAND 105 // extension, however see zChat #define CHAT_STAMP 106 -#define CHAT_END_OF_COMMAND 255 +#define CHAT_END_OF_COMMAND '\xFF' // 255 // types of ChatNotes diff --git a/dialogs/ColourPickerDlg.cpp b/dialogs/ColourPickerDlg.cpp index 78db06c3..fc748324 100644 --- a/dialogs/ColourPickerDlg.cpp +++ b/dialogs/ColourPickerDlg.cpp @@ -402,7 +402,6 @@ OnSelectColour (); void CColourPickerDlg::OnItemchangedColourlist(NMHDR* pNMHDR, LRESULT* pResult) { - NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; int iSel = m_ctlColourList.GetNextItem(-1, LVNI_SELECTED); diff --git a/dialogs/KeyNameDlg.cpp b/dialogs/KeyNameDlg.cpp index 81c2c3f3..f73846bd 100644 --- a/dialogs/KeyNameDlg.cpp +++ b/dialogs/KeyNameDlg.cpp @@ -58,8 +58,6 @@ void CKeyNameDlg::OnUpdateKeyName(CCmdUI* pCmdUI) m_ctlHotkeyValue.GetHotKey (wVirtualKeyCode, wModifiers); - DWORD test = m_ctlHotkeyValue.GetHotKey (); - BYTE fVirt = 0; if (wModifiers & HOTKEYF_ALT) @@ -71,5 +69,5 @@ void CKeyNameDlg::OnUpdateKeyName(CCmdUI* pCmdUI) pCmdUI->SetText (KeyCodeToString (fVirt, wVirtualKeyCode)); - } // end of CTriggerDlg::OnUpdateInvocationCount + } // end of CKeyNameDlg::OnUpdateKeyName diff --git a/dialogs/TipDlg.cpp b/dialogs/TipDlg.cpp index c01e978d..d2fdec62 100644 --- a/dialogs/TipDlg.cpp +++ b/dialogs/TipDlg.cpp @@ -53,7 +53,6 @@ char * p; // We need to find out what the startup and file position parameters are // If startup does not exist, we assume that the Tips on startup is checked TRUE. - CWinApp* pApp = AfxGetApp(); m_bStartup = !App.db_get_int("control", szIntStartup, 0); UINT iFilePos = App.db_get_int("control", szIntFilePos, 0); @@ -101,7 +100,6 @@ CTipDlg::~CTipDlg() // But make sure the tips file existed in the first place.... if (m_pStream != NULL) { - CWinApp* pApp = AfxGetApp(); App.db_write_int("control", szIntFilePos, ftell(m_pStream)); fclose(m_pStream); } @@ -178,7 +176,6 @@ void CTipDlg::OnOK() CDialog::OnOK(); // Update the startup information stored in the INI file - CWinApp* pApp = AfxGetApp(); App.db_write_int ("control", szIntStartup, !m_bStartup); } diff --git a/dialogs/global_prefs/GlobalPrefs.cpp b/dialogs/global_prefs/GlobalPrefs.cpp index 28f07ad8..31dc05b0 100644 --- a/dialogs/global_prefs/GlobalPrefs.cpp +++ b/dialogs/global_prefs/GlobalPrefs.cpp @@ -1503,8 +1503,6 @@ void CGlobalPrefsP11::OnChooseIconFile() CheckRadioButton (IDC_MUSHCLIENT_ICON, IDC_CUSTOM_ICON, IDC_CUSTOM_ICON); - DWORD i = GetLastError (); - } ///////////////////////////////////////////////////////////////////////////// // CGlobalPrefsP12 property page diff --git a/dialogs/plugins/PluginsDlg.cpp b/dialogs/plugins/PluginsDlg.cpp index 90bc2aa1..0e045d14 100644 --- a/dialogs/plugins/PluginsDlg.cpp +++ b/dialogs/plugins/PluginsDlg.cpp @@ -328,10 +328,7 @@ void CPluginsDlg::OnAddPlugin() if (nResult != IDOK) - { - DWORD reason = CommDlgExtendedError(); return; // cancelled dialog - } bool bChanged = false; diff --git a/dialogs/world_prefs/TreePropertySheet.cpp b/dialogs/world_prefs/TreePropertySheet.cpp index 62f84945..d4a44cf2 100644 --- a/dialogs/world_prefs/TreePropertySheet.cpp +++ b/dialogs/world_prefs/TreePropertySheet.cpp @@ -604,7 +604,7 @@ PURPOSE: Hides the default property sheet buttons --------------------------------------------------------------------*/ bool CTreePropertySheet::HidePpgButtons() { - int nControls=m_acControlPos.GetSize(); + m_acControlPos.GetSize(); CRect rcTemp,rcWindow; GetDlgItem(IDOK)->GetWindowRect(&rcTemp); @@ -956,7 +956,6 @@ void CTreePropertySheet::AssignFillerSpace( { int i,nSize=m_acControlPos.GetSize(); int nFillers=CountFillers(nVertArrange,nRow); - int nCount=0; if(nFillers==0) return; @@ -1047,7 +1046,6 @@ CTreePropertySheet::cControlPos* CTreePropertySheet::GetControl( int nCol) { int i,nSize=m_acControlPos.GetSize(); - int nCount=0; for(i=0;iSetModifiedFlag (TRUE); // re-setup list with amended details - int nNewItem = add_item (pItem, pstrObjectName, nItem, FALSE); + add_item (pItem, pstrObjectName, nItem, FALSE); } @@ -3153,7 +3153,7 @@ for (int nItem = -1; m_doc->SetModifiedFlag (TRUE); // re-setup list with amended details - int nNewItem = add_item (pItem, pstrObjectName, nItem, FALSE); + add_item (pItem, pstrObjectName, nItem, FALSE); } @@ -4108,7 +4108,7 @@ for (int nItem = -1; m_doc->SetModifiedFlag (TRUE); // re-setup list with amended details - int nNewItem = add_item (pItem, pstrObjectName, nItem, FALSE); + add_item (pItem, pstrObjectName, nItem, FALSE); } @@ -4192,7 +4192,7 @@ for (int nItem = -1; m_doc->SetModifiedFlag (TRUE); // re-setup list with amended details - int nNewItem = add_item (pItem, pstrObjectName, nItem, FALSE); + add_item (pItem, pstrObjectName, nItem, FALSE); } @@ -6263,7 +6263,7 @@ CTimer * timer1 = (CTimer *) item1, ASSERT_VALID (timer2); ASSERT( timer2->IsKindOf( RUNTIME_CLASS( CTimer ) ) ); -int iResult; +int iResult = 0; CmcDateTimeSpan ts1, ts2; @@ -8693,7 +8693,7 @@ void CPrefsP15::CalculateMemoryUsage () // count styles and work out how much memory they take too for (POSITION pos2 = pLine->styleList.GetHeadPosition(); pos2; iStyles++) { - CStyle * pStyle = pLine->styleList.GetNext (pos2); + pLine->styleList.GetNext (pos2); nMemory += sizeof CStyle; // length of style class nMemory += sizeof (void *) * 3; // and the list item } diff --git a/doc.cpp b/doc.cpp index d9481be9..838b905f 100644 --- a/doc.cpp +++ b/doc.cpp @@ -1395,7 +1395,7 @@ int count = m_pSocket->Receive (buff, sizeof (buff) - 1); m_iConnectPhase == eConnectAwaitingProxyResponse2 || m_iConnectPhase == eConnectAwaitingProxyResponse3) { - int iBytesToMove; + int iBytesToMove = 0; switch (m_iConnectPhase) { @@ -1481,6 +1481,11 @@ int count = m_pSocket->Receive (buff, sizeof (buff) - 1); if (App.m_iCounterFrequency) QueryPerformanceCounter (&start); + else + { + start.QuadPart = 0; + finish.QuadPart = 0; + } // decompress it int iCompressResult = inflate (&m_zCompress, Z_SYNC_FLUSH); @@ -1574,9 +1579,9 @@ int saved_count; // if (flags == 0) // m_strCurrentLine += lpszText; - for (p = lpszText; c = *p; p++) + for (p = lpszText; *p; p++) { - + c = *p; int iLineLength = m_pCurrentLine->len; // for Unicode the width of the line is characters, not stored bytes @@ -2698,8 +2703,6 @@ void CMUSHclientDoc::ExecuteHotspotScript (DISPID & dispid, // dispatch ID, wil return; } // end of Lua -long i = 1; - // prepare for the arguments: // 1. Flags // 2. Hotspot ID @@ -2754,7 +2757,7 @@ void CMUSHclientDoc::OnFileLogsession() BOOL bAppendToLogFile = false; int iLines = 0; -BOOL bWriteWorldName; +BOOL bWriteWorldName = m_bWriteWorldNameToLog; CString strPreamble; if (!m_bLogRaw) @@ -4471,12 +4474,6 @@ CString strTimerName; CmcDateTime tNow = CmcDateTime::GetTimeNow(); CmcDateTimeSpan tsOneDay (1, 0, 0, 0); -// TRACE1 ("Time now = %10.8f\n", tNow.m_dt); - -double t = (tNow.m_dt - ((int) tNow.m_dt) ) * 86400.0; - -// TRACE1 ("Seconds = %10.3f\n", t); - // check for deleted chat sessions for (POSITION chatpos = m_ChatList.GetHeadPosition (); chatpos; ) @@ -4575,7 +4572,6 @@ double t = (tNow.m_dt - ((int) tNow.m_dt) ) * 86400.0; // send timer message, if this timer list is "active" CString strExtraOutput; - bool bNoLog = false; timer_item->bExecutingScript = true; // cannot be deleted now m_iCurrentActionSource = eTimerFired; @@ -4619,7 +4615,7 @@ double t = (tNow.m_dt - ((int) tNow.m_dt) ) * 86400.0; list sparams; sparams.push_back (pLabel); timer_item->bExecutingScript = true; // cannot be deleted now - bool bResult = GetScriptEngine ()->ExecuteLua (timer_item->dispid, + GetScriptEngine ()->ExecuteLua (timer_item->dispid, timer_item->strProcedure, eTimerFired, strType, @@ -4628,10 +4624,6 @@ double t = (tNow.m_dt - ((int) tNow.m_dt) ) * 86400.0; sparams, timer_item->nInvocationCount); timer_item->bExecutingScript = false; // can be deleted now - /* version 4.28 -- removed this - one-shot timers weren't being deleted - if (bResult) - return; // error in script, bail out - */ } // end of Lua else { @@ -4651,7 +4643,7 @@ double t = (tNow.m_dt - ((int) tNow.m_dt) ) * 86400.0; // args [eTimerName] = strTimerName; args [eTimerName] = pLabel; timer_item->bExecutingScript = true; // cannot be deleted now - bool bResult = ExecuteScript (timer_item->dispid, + ExecuteScript (timer_item->dispid, timer_item->strProcedure, eTimerFired, strType, @@ -4660,10 +4652,6 @@ double t = (tNow.m_dt - ((int) tNow.m_dt) ) * 86400.0; timer_item->nInvocationCount); timer_item->bExecutingScript = false; // can be deleted now - /* version 4.28 -- removed this - one-shot timers weren't being deleted - if (bResult) - return; // error in script, bail out - */ } // not Lua } // end of having a dispatch ID @@ -5262,7 +5250,7 @@ CString CMUSHclientDoc::RecallText (const CString strSearchString, // what to const CString strRecallLinePreamble) { CString strMessage; -t_regexp * regexp; // compiled regular expression +t_regexp * regexp = NULL; // compiled regular expression int iCurrentLine; // compile regular expression if needed @@ -5330,7 +5318,7 @@ CString strStatus = TFormat ("Recalling: %s", (LPCTSTR) strSearchString); { int iMilestone = 0; CString strLine; - int iFlags; + int iFlags = 0; do { @@ -6520,7 +6508,6 @@ POSITION pos; void CMUSHclientDoc::SortTimers (void) { -int iCount = GetTimerMap ().GetCount (); int i; CString strTimerName; CTimer * pTimer; diff --git a/evaluate.cpp b/evaluate.cpp index 374bec14..949a1c2c 100644 --- a/evaluate.cpp +++ b/evaluate.cpp @@ -8,8 +8,6 @@ static char BASED_CODE THIS_FILE[] = __FILE__; #endif -//#pragma warning (disable:4800) - BOOL CMUSHclientDoc::EvaluateCommand (const CString & full_input, const bool bCountThem, @@ -261,7 +259,7 @@ CTrigger * CMUSHclientDoc::EvaluateTrigger (const CString & input, // timer t ("EvaluateTrigger"); bool matched = false; -CTrigger * trigger_item; +CTrigger * trigger_item = NULL; int iCount = GetTriggerArray ().GetSize (); // how many there are output.Empty (); diff --git a/lsqlite/lsqlite3.c b/lsqlite/lsqlite3.c index abf160e2..0f0d551a 100644 --- a/lsqlite/lsqlite3.c +++ b/lsqlite/lsqlite3.c @@ -1,6 +1,7 @@ // These first few lines added by NJG // version 0.7-devel -# pragma warning(disable: 4244) +# pragma warning(disable : 4244) // conversion from 'int ' to 'char ', possible loss of data +# pragma warning(disable : 4701) // local variable 'xxx' may be used without having been initialized // Warning - in db_last_insert_rowid change %ll to %I64d /************************************************************************ * lsqlite3 * diff --git a/luacom/LuaCompat.h b/luacom/LuaCompat.h index dd4effd0..7c85a69e 100644 --- a/luacom/LuaCompat.h +++ b/luacom/LuaCompat.h @@ -1,3 +1,13 @@ +// pragmas added by Nick Gammon +#pragma warning( disable : 4100) // unreferenced formal parameter +#pragma warning( disable : 4189) // warning C4189: 'iVersion' : local variable is initialized but not referenced +#pragma warning( disable : 4244) // conversion from 'int' to 'unsigned short', possible loss of data +#pragma warning( disable : 4310) // cast truncates constant value +#pragma warning( disable : 4245) // conversion from 'long' to 'unsigned long', signed/unsigned mismatch +#pragma warning( disable : 4127) // conditional expression is constant +#pragma warning( disable : 4701) // local variable 'xxx' may be used without having been initialized + + /* * LuaCompat.h * diff --git a/luacom/tCOMUtil.cpp b/luacom/tCOMUtil.cpp index c4d753eb..6c2473ee 100644 --- a/luacom/tCOMUtil.cpp +++ b/luacom/tCOMUtil.cpp @@ -1,3 +1,6 @@ +#pragma warning( disable : 4189) // warning C4189: 'iVersion' : local variable is initialized but not referenced +#pragma warning( disable : 4244) // conversion from 'int' to 'unsigned short', possible loss of data + // tCOMUtil.cpp: implementation of the tCOMUtil class. // ////////////////////////////////////////////////////////////////////// diff --git a/luacom/tUtil.cpp b/luacom/tUtil.cpp index 2d0bbe83..8cedc9c5 100644 --- a/luacom/tUtil.cpp +++ b/luacom/tUtil.cpp @@ -1,3 +1,5 @@ +#pragma warning( disable : 4100) // unreferenced formal parameter + // tUtil.cpp: implementation of the tUtil class. // ////////////////////////////////////////////////////////////////////// diff --git a/mcdatetime.cpp b/mcdatetime.cpp index a4caa81c..87288b49 100644 --- a/mcdatetime.cpp +++ b/mcdatetime.cpp @@ -254,7 +254,7 @@ static LONGLONG iCounterFrequency = 0; } } - double secs; + double secs = 0; LARGE_INTEGER time_now; if (iCounterFrequency) @@ -265,6 +265,12 @@ static LONGLONG iCounterFrequency = 0; secs = (double) offset / (double) iCounterFrequency; // TRACE ("Secs = %10.4f\n", secs); } + else + { + time_now.QuadPart = 0; + time_now.QuadPart = 0; + } + // if no high-performance counter, just query the time each time if (iCounterFrequency == 0 || diff --git a/miniwindow.cpp b/miniwindow.cpp index 60afe418..968e9b4c 100644 --- a/miniwindow.cpp +++ b/miniwindow.cpp @@ -2978,8 +2978,6 @@ static void Noise (unsigned char * inbuf, long iWidth, long iHeight, long iPerLi static void MonoNoise (unsigned char * inbuf, long iWidth, long iHeight, long iPerLine, double Options) { - unsigned char * pi = inbuf; - long count = iPerLine * iHeight / 3; long i, j, c, row; double threshold = Options / 100.0; @@ -3197,8 +3195,6 @@ static void ColourGamma (unsigned char * inbuf, long iWidth, long iHeight, static void MakeGreyscale (unsigned char * inbuf, long iWidth, long iHeight, long iPerLine, double Options, const bool bLinear) { - unsigned char * pi = inbuf; - long count = iPerLine * iHeight / 3; long i, row; double c; @@ -3990,7 +3986,6 @@ long CMiniWindow::DrawImageAlpha(LPCTSTR ImageId, long count = bmi.bmiHeader.biSizeImage; - long perline = BytesPerLine (iWidth, 24); long i; @@ -4122,7 +4117,6 @@ long CMiniWindow::GetImageAlpha(LPCTSTR ImageId, long count = bmi.bmiHeader.biSizeImage; - long perline = BytesPerLine (iWidth, 24); long i; diff --git a/mushview.cpp b/mushview.cpp index 113c05ba..49dfc678 100644 --- a/mushview.cpp +++ b/mushview.cpp @@ -469,7 +469,7 @@ POSITION foundpos; } -int iUnicodeCharacters; +int iUnicodeCharacters = 0; // unicode conversion from UTF-8 @@ -1653,7 +1653,6 @@ CPoint point (pt); int lastline; long lastx = 0; bool bOutside = true; -int oldstyle = 0; long pixel; dc.SelectObject(pDoc->m_font [0]); @@ -1975,8 +1974,6 @@ int line, // eg. !!753ba7e011f3c8943a885f18:mysub(1234) // will be passed the nominted sub in the nominated plugin - CPlugin * pPlugin = NULL; - // rather elaborate test ... // a. Must start with !! @@ -2316,8 +2313,6 @@ int line, // end of tooltips stuff -CLine * pLine = pDoc->m_LineList.GetAt (pDoc->GetLinePosition (line)); - // only if the user is currently drawing a new stroke by dragging // the captured mouse. @@ -2469,7 +2464,6 @@ long start_textsize, end_textsize; long right; -int oldstyle = 0; GetTextRect (&r); right = r.right; @@ -3689,7 +3683,7 @@ t_print_control_block pcb; (line == m_selend_line)) endcol = m_selend_col; - CStyle * pStyle; + CStyle * pStyle = NULL; int i = 0; POSITION stylepos; @@ -3709,6 +3703,8 @@ t_print_control_block pcb; for (thiscol = startcol; thiscol < endcol; ) { + if (!pStyle) + break; // don't overshoot thislen = MIN (cols_to_go, thislen); @@ -4671,7 +4667,7 @@ CMUSHclientDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); POSITION startpos, pos; -CLine * pLine, +CLine * pLine = NULL, * pInitialLine; int nNewLine = m_selstart_line, nInitialLine; @@ -5554,7 +5550,8 @@ ASSERT_VALID(pDoc); sa.CreateOneDim (VT_VARIANT, MAX_WILDCARDS, NULL, 1); for (long i = 1; i <= MAX_WILDCARDS; i++) { - COleVariant v (CString ("")); // no wildcards are relevant + CString s (""); + COleVariant v (s); // no wildcards are relevant sa.PutElement (&i, &v); } args [eWildcards] = sa; @@ -5572,7 +5569,6 @@ ASSERT_VALID(pDoc); // send the message - bool bOmitFromLog = false; CString strExtraOutput; pDoc->m_iCurrentActionSource = eUserMenuAction; diff --git a/mxp/mxpClose.cpp b/mxp/mxpClose.cpp index ca6a0a39..076f5270 100644 --- a/mxp/mxpClose.cpp +++ b/mxp/mxpClose.cpp @@ -21,12 +21,12 @@ static char BASED_CODE THIS_FILE[] = __FILE__; void CMUSHclientDoc::MXP_CloseTag (CString strTag, const bool bOpen) { - POSITION linepos, + POSITION linepos = 0, stylepos, - oldstylepos, - oldlinepos; - CStyle * pStyle; - CLine * pLine; + oldstylepos = 0, + oldlinepos = 0; + CStyle * pStyle = NULL; + CLine * pLine = NULL; bool bFoundit = false; CString strFoundVariable; diff --git a/mxp/mxpCloseAtomic.cpp b/mxp/mxpCloseAtomic.cpp index a4d449c2..1a341605 100644 --- a/mxp/mxpCloseAtomic.cpp +++ b/mxp/mxpCloseAtomic.cpp @@ -142,7 +142,6 @@ void CMUSHclientDoc::MXP_CloseAtomicTag (const int iAction, case MXP_ACTION_VAR: { - int i = 0; } break; } // end of switch on action type diff --git a/mxp/mxpDefs.cpp b/mxp/mxpDefs.cpp index 4a2d2b3b..d95fc8f6 100644 --- a/mxp/mxpDefs.cpp +++ b/mxp/mxpDefs.cpp @@ -439,7 +439,8 @@ void CMUSHclientDoc::MXP_Entity (CString strName, CString strTag) return; } - strFixedValue += MXP_GetEntity (CString (pStart, p - pStart)); // add to list + CString s (pStart, p - pStart); + strFixedValue += MXP_GetEntity (s); // add to list } // end of having an ampersand else diff --git a/pcre/readme.txt b/pcre/readme.txt index 3c832f4a..813e2344 100644 --- a/pcre/readme.txt +++ b/pcre/readme.txt @@ -39,8 +39,29 @@ ucp.h 4. Rename pcre_chartables.c.dist as pcre_chartables.c Rename pcre.h.generic as pcre.h + 5. Edit: pcre_compile.c and add: -#pragma warning(disable: 4018) +#pragma warning( disable : 4018) // '<' : signed/unsigned mismatch +#pragma warning( disable : 4244) // conversion from 'int' to 'unsigned short', possible loss of data +#pragma warning( disable : 4701) // local variable 'othercase' may be used without having been initialized + +to the start of the file. + + +6. Edit all of: + + pcre_dfa_exec.c + pcre_exec.c + pcre_maketables.c + pcre_ord2utf8.c + pcre_refcount.c + pcre_study.c + +and add: + +#pragma warning( disable : 4244) // conversion from 'int' to 'unsigned short', possible loss of data + +to the start of each file. + -to the start of the file. \ No newline at end of file diff --git a/png/readme.txt b/png/readme.txt index 4294bb25..66b93ed1 100644 --- a/png/readme.txt +++ b/png/readme.txt @@ -39,3 +39,8 @@ to #include "../zlib/zlib.h" + +Also add to the very start of png.h: + +// pragmas added by Nick Gammon +#pragma warning( disable : 4115) // named type definition in parentheses diff --git a/regexp.cpp b/regexp.cpp index 4d33e0b9..6000d705 100644 --- a/regexp.cpp +++ b/regexp.cpp @@ -70,6 +70,11 @@ int count; if (App.m_iCounterFrequency) QueryPerformanceCounter (&start); + else + { + start.QuadPart = 0; + finish.QuadPart = 0; + } pcre_callout = NULL; count = pcre_exec(prog->m_program, prog->m_extra, string, strlen (string), diff --git a/resource.h b/resource.h index b9aa618e..2724819a 100644 --- a/resource.h +++ b/resource.h @@ -1529,7 +1529,7 @@ #define ID_ALT_Y 33023 #define ID_ALT_B 33024 #define ID_GAME_CONFIGURE_CHAT 33025 -#define ID_MACRO_F1 -32510 +#define ID_MACRO_F1 33026 #define ID_MACRO_CTRL_F1 33027 #define ID_MACRO_SHIFT_F1 33028 #define ID_HELP_DOCUMENTATIONWEBPAGE 33029 @@ -1562,7 +1562,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 360 +#define _APS_NEXT_RESOURCE_VALUE 361 #define _APS_NEXT_COMMAND_VALUE 33054 #define _APS_NEXT_CONTROL_VALUE 2897 #define _APS_NEXT_SYMED_VALUE 312 diff --git a/scripting/bits.c b/scripting/bits.c index 4cd455f6..2ae316c7 100644 --- a/scripting/bits.c +++ b/scripting/bits.c @@ -10,7 +10,9 @@ /* Reuben Thomas nov00-09jan04 */ -#pragma warning( disable: 4244) +#pragma warning( disable: 4057) // 'const unsigned char *' differs in indirection to slightly different base types from 'const char *' +#pragma warning( disable: 4244) // conversion from '__int64 ' to 'double ', possible loss of data +#pragma warning( disable: 4706) // assignment within conditional expression typedef __int64 Integer; typedef unsigned __int64 UInteger; diff --git a/scripting/functionlist.cpp b/scripting/functionlist.cpp index df5a5601..a19d163a 100644 --- a/scripting/functionlist.cpp +++ b/scripting/functionlist.cpp @@ -560,7 +560,8 @@ CFunctionListDlg dlg; void CMainFrame::OnGameFunctionslist() { - ShowFunctionslist (CString (), true); + CString s; + ShowFunctionslist (s, true); } void ShowHelp (const CString strPrefix, const CString strTopic) diff --git a/scripting/lpeg.c b/scripting/lpeg.c index 19f71a80..edbe864f 100644 --- a/scripting/lpeg.c +++ b/scripting/lpeg.c @@ -1,4 +1,5 @@ -#pragma warning( disable: 4244) +#pragma warning( disable : 4244) // conversion from 'int ' to 'short ', possible loss of data +#pragma warning( disable : 4505) // unreferenced local function has been removed /* ** $Id: lpeg.c,v 1.2 2009-02-23 03:13:05 nick Exp $ diff --git a/scripting/lrexlib.c b/scripting/lrexlib.c index 58feff7e..f5eec566 100644 --- a/scripting/lrexlib.c +++ b/scripting/lrexlib.c @@ -11,6 +11,7 @@ #include "..\lauxlib.h" #define LREXLIB_PCRE // NJG +#pragma warning( disable: 4057) // 'const unsigned char *' differs in indirection to slightly different base types from 'const char *' /* Sanity check */ #if !defined(LREXLIB_POSIX) && !defined(LREXLIB_PCRE) diff --git a/scripting/lua_compress.c b/scripting/lua_compress.c index 2333233f..d162b42f 100644 --- a/scripting/lua_compress.c +++ b/scripting/lua_compress.c @@ -11,6 +11,8 @@ #include #include +#pragma warning( disable : 4057) // 'unsigned char *' differs in indirection to slightly different base types from 'char *' + typedef unsigned char UC; // compression for use in MUSHclient Lua diff --git a/scripting/lua_methods.cpp b/scripting/lua_methods.cpp index 1617f9d4..7c6ce2bb 100644 --- a/scripting/lua_methods.cpp +++ b/scripting/lua_methods.cpp @@ -532,7 +532,7 @@ static int L_AdjustColour (lua_State *L) //---------------------------------------- static int L_ANSI (lua_State *L) { - CMUSHclientDoc * pDoc = doc (L); // must do this first + doc (L); // must do this first int n = lua_gettop(L); /* number of arguments */ int i; @@ -2965,7 +2965,7 @@ static int L_GetWorldWindowPosition (lua_State *L) //---------------------------------------- static int L_MakeRegularExpression (lua_State *L) { - CMUSHclientDoc *pDoc = doc (L); + doc (L); // uses helper routine to avoid using BSTR lua_pushstring (L, ConvertToRegularExpression(my_checkstring (L, 1))); return 1; // number of result fields @@ -3427,7 +3427,7 @@ static bool DoStyle (lua_State *L, if (iStyleNumber <= 0 || iStyleNumber > pLine->styleList.GetCount ()) return true; // error, style doesn't exist - CStyle * pStyle; + CStyle * pStyle = NULL; POSITION pos; int iCol = 0; int iCount = 1; @@ -3448,13 +3448,14 @@ static bool DoStyle (lua_State *L, } // end of looping looking for it int iAction = 0; - switch (pStyle->iFlags & ACTIONTYPE) - { - case ACTION_NONE: iAction = 0; break; - case ACTION_SEND: iAction = 1; break; - case ACTION_HYPERLINK: iAction = 2; break; - case ACTION_PROMPT: iAction = 3; break; - } // end of switch + if (pStyle) + switch (pStyle->iFlags & ACTIONTYPE) + { + case ACTION_NONE: iAction = 0; break; + case ACTION_SEND: iAction = 1; break; + case ACTION_HYPERLINK: iAction = 2; break; + case ACTION_PROMPT: iAction = 3; break; + } // end of switch COLORREF colour1, @@ -4512,7 +4513,7 @@ static int L_NoteStyle (lua_State *L) //---------------------------------------- static int L_Open (lua_State *L) { - CMUSHclientDoc *pDoc = doc (L); + doc (L); CDocument * pnewDoc = App.OpenDocumentFile (my_checkstring (L, 1)); @@ -4806,9 +4807,9 @@ static int L_ResetTimers (lua_State *L) //---------------------------------------- static int L_ReverseSpeedwalk (lua_State *L) { - CMUSHclientDoc *pDoc = doc (L); + doc (L); // this is a helper function that returns a CString, not a BSTR - lua_pushstring (L, pDoc->DoReverseSpeedwalk (my_checkstring (L, 1))); + lua_pushstring (L, CMUSHclientDoc::DoReverseSpeedwalk (my_checkstring (L, 1))); return 1; // number of result fields } // end of L_ReverseSpeedwalk diff --git a/scripting/lua_progressdlg.cpp b/scripting/lua_progressdlg.cpp index a432c805..4a23dcf9 100644 --- a/scripting/lua_progressdlg.cpp +++ b/scripting/lua_progressdlg.cpp @@ -82,7 +82,6 @@ static int Lprogress_gc (lua_State *L) { // tostring helper static int Lprogress_tostring (lua_State *L) { - CProgressDlg *pProgressDlg = Lprogress_getdialog (L); lua_pushstring(L, "progress_dialog"); return 1; } // end of Lprogress_tostring diff --git a/scripting/lua_scripting.cpp b/scripting/lua_scripting.cpp index ce3dd324..7541d8b3 100644 --- a/scripting/lua_scripting.cpp +++ b/scripting/lua_scripting.cpp @@ -52,7 +52,7 @@ static void BuildOneLuaFunction (lua_State * L, const char * sTableName) string sFullName; // global table will not have _G prefix - if (sTableName != "_G") + if (strcmp (sTableName, "_G") != 0) { sFullName= sTableName; sFullName += "."; @@ -274,6 +274,11 @@ bool CScriptEngine::ParseLua (const CString & strCode, const CString & strWhat) if (App.m_iCounterFrequency) QueryPerformanceCounter (&start); + else + { + start.QuadPart = 0; + finish.QuadPart = 0; + } // note - an error here is a *compile* error @@ -444,6 +449,11 @@ bool CScriptEngine::ExecuteLua (DISPID & dispid, // dispatch ID, will be set to if (App.m_iCounterFrequency) QueryPerformanceCounter (&start); + else + { + start.QuadPart = 0; + finish.QuadPart = 0; + } unsigned short iOldStyle = m_pDoc->m_iNoteStyle; m_pDoc->m_iNoteStyle = NORMAL; // back to default style @@ -504,7 +514,6 @@ bool CScriptEngine::ExecuteLua (DISPID & dispid, // dispatch ID, will be set to for (i = 0; i < namecount; i++, tabptr += name_entry_size) { int n = (tabptr[0] << 8) | tabptr[1]; - int j = n * 2; const unsigned char * name = tabptr + 2; // if duplicates were possible then ... if ((regexp->m_program->options & (PCRE_DUPNAMES | PCRE_JCHANGED)) != 0) @@ -609,8 +618,6 @@ bool CScriptEngine::ExecuteLua (DISPID & dispid, // dispatch ID, will be set to { *result = true; - int i = lua_toboolean (L, paramCount + 1); - // if a boolean result wanted, return it if (lua_gettop (L) > 0) @@ -656,6 +663,11 @@ bool CScriptEngine::ExecuteLua (DISPID & dispid, // dispatch ID, will b if (App.m_iCounterFrequency) QueryPerformanceCounter (&start); + else + { + start.QuadPart = 0; + finish.QuadPart = 0; + } unsigned short iOldStyle = m_pDoc->m_iNoteStyle; m_pDoc->m_iNoteStyle = NORMAL; // back to default style diff --git a/scripting/lua_utils.cpp b/scripting/lua_utils.cpp index 4592003d..6afb940d 100644 --- a/scripting/lua_utils.cpp +++ b/scripting/lua_utils.cpp @@ -74,7 +74,6 @@ size_t xmlLength; const char * xml = luaL_checklstring (L, 1, &xmlLength); CXMLparser parser; -CXMLelement * pMuClientElement = NULL; try { diff --git a/scripting/methods.cpp b/scripting/methods.cpp index 01156903..f0d58da8 100644 --- a/scripting/methods.cpp +++ b/scripting/methods.cpp @@ -2403,12 +2403,10 @@ CTrigger * trigger_item; case 37: if (trigger_item->regexp && App.m_iCounterFrequency) { - LONGLONG iTimeTaken = 0; double elapsed_time; - elapsed_time = ((double) trigger_item->regexp->iTimeTaken) / - ((double) App.m_iCounterFrequency); + ((double) App.m_iCounterFrequency); SetUpVariantDouble (vaResult, elapsed_time); } @@ -3174,7 +3172,6 @@ void CMUSHclientDoc::ShowQueuedCommands (void) } CString strQueued = "Queued: "; - int i = 0; const int MAX_SHOWN = 50; CString str; @@ -3582,7 +3579,7 @@ CLine * pLine = m_LineList.GetAt (GetLinePosition (LineNumber - 1)); if (StyleNumber <= 0 || StyleNumber > pLine->styleList.GetCount ()) return vaResult; -CStyle * pStyle; +CStyle * pStyle = NULL; POSITION pos; int iCol = 0; int iCount = 1; @@ -3603,7 +3600,7 @@ int iCount = 1; } // end of looping looking for it CString strAction, strHint, strVariable; -CAction * pAction = pStyle->pAction; +CAction * pAction = pStyle ? pStyle->pAction : NULL; COLORREF colour1, colour2; @@ -4003,7 +4000,8 @@ long iCount; CString strLine = m_QueuedCommandsList.GetNext (pos); // the array must be a bloody array of variants, or VBscript kicks up - COleVariant v (strLine.Mid (1)); // drop echo flag + CString s = strLine.Mid (1); + COleVariant v (s); // drop echo flag sa.PutElement (&iCount, &v); iCount++; } // end of looping through each command @@ -4339,6 +4337,11 @@ static void GetWindowWidth (CWnd * pWnd, VARIANT & vaResult, const bool client = static void GetWindowHeight (CWnd * pWnd, VARIANT & vaResult, const bool client = false ) { RECT rect; + rect.left = 0; + rect.top = 0; + rect.right = 0; + rect.bottom = 0; + if (pWnd->m_hWnd) { if (client) @@ -9013,7 +9016,7 @@ long iCount = 0; // do it Load_World_XML (ar, // don't load plugins or general world config here (note, this sets XML_OVERWRITE) - ~(XML_PLUGINS | XML_NO_PLUGINS | XML_GENERAL), + (unsigned long) ~(XML_PLUGINS | XML_NO_PLUGINS | XML_GENERAL), 0, // load flags &iTriggers, &iAliases, @@ -10598,9 +10601,10 @@ VARIANT CMUSHclientDoc::AcceleratorList() if (m_CommandToSendToMap [it->second] == eSendToExecute) strSendTo = ""; // the array must be a bloody array of variants, or VBscript kicks up - COleVariant v (CFormat ("%s = %s%s", (LPCTSTR) key, - command.c_str (), - (LPCTSTR) strSendTo)); + CString s = CFormat ("%s = %s%s", (LPCTSTR) key, + command.c_str (), + (LPCTSTR) strSendTo); + COleVariant v (s); sa.PutElement (&iCount, &v); } // end of looping through each accelerator } // end of having at least one @@ -10638,9 +10642,10 @@ VARIANT CMUSHclientDoc::MapColourList() it != m_ColourTranslationMap.end (); it++, iCount++) { // the array must be a bloody array of variants, or VBscript kicks up - COleVariant v (CFormat ("%s = %s", - (LPCTSTR) ColourToName (it->first), - (LPCTSTR) ColourToName (it->second))); + CString s = CFormat ("%s = %s", + (LPCTSTR) ColourToName (it->first), + (LPCTSTR) ColourToName (it->second)); + COleVariant v (s); sa.PutElement (&iCount, &v); } // end of looping through each colour } // end of having at least one @@ -12598,7 +12603,7 @@ CMyToolBar * pToolBar = NULL; } else { - UINT nDockBarID; + UINT nDockBarID = AFX_IDW_DOCKBAR_TOP; CRect rect (Left, Top, Left + rectBar.right - rectBar.left, Top + rectBar.bottom - rectBar.top); Frame.ClientToScreen (rect); switch (Side) diff --git a/scripting/number.c b/scripting/number.c index 30406203..92549f25 100644 --- a/scripting/number.c +++ b/scripting/number.c @@ -1,3 +1,8 @@ +// pragmas added by Nick Gammon +#pragma warning( disable : 4131) // uses old-style declarator +#pragma warning( disable : 4244) // conversion from 'int' to 'unsigned short', possible loss of data +#pragma warning( disable : 4100) // unreferenced formal parameter + /* number.c: Implements arbitrary precision numbers. */ /* Copyright (C) 1991, 1992, 1993, 1994, 1997, 2000 Free Software Foundation, Inc. diff --git a/scripting/scriptengine.cpp b/scripting/scriptengine.cpp index 0beac3be..0690c295 100644 --- a/scripting/scriptengine.cpp +++ b/scripting/scriptengine.cpp @@ -99,6 +99,11 @@ bool CScriptEngine::Execute (DISPID & dispid, // dispatch ID, will be set to DI if (App.m_iCounterFrequency) QueryPerformanceCounter (&start); + else + { + start.QuadPart = 0; + finish.QuadPart = 0; + } if (iReason != eDontChangeAction) m_pDoc->m_iCurrentActionSource = iReason; @@ -439,6 +444,11 @@ SCRIPTSTATE ss; if (App.m_iCounterFrequency) QueryPerformanceCounter (&start); + else + { + start.QuadPart = 0; + finish.QuadPart = 0; + } hr = m_IActiveScriptParse->ParseScriptText (bstrCode, 0, 0, 0, 0, 0, diff --git a/sendvw.cpp b/sendvw.cpp index d70a5d9d..34a5f2d3 100644 --- a/sendvw.cpp +++ b/sendvw.cpp @@ -267,7 +267,6 @@ CSendView::CSendView() CSendView::~CSendView() { -CMUSHclientDoc* pDoc = GetDocument(); delete m_backbr; } @@ -2725,16 +2724,10 @@ void CSendView::OnEditSelecttomatchingbrace() void CSendView::OnInitMenu(CMenu* pMenu) { - - int i = 1; - } void CSendView::OnInitMenuPopup(CMenu* pMenu, UINT nIndex, BOOL bSysMenu) { - - int i = 1; - } void CSendView::OnDisplayHighlightphrase() diff --git a/sqlite3/readme.txt b/sqlite3/readme.txt index 8c8916fe..a15ec682 100644 --- a/sqlite3/readme.txt +++ b/sqlite3/readme.txt @@ -15,13 +15,16 @@ sqlite3ext.h // These first few lines added by NJG // version 3.7.2 -# pragma warning(disable: 4244) -# pragma warning(disable: 4018) -# pragma warning(disable: 4049) -# pragma warning(disable: 4761) -# pragma warning(disable: 4047) -# pragma warning(disable: 4022) -# pragma warning(disable: 4305) +# pragma warning(disable : 4022) // pointer mismatch for actual parameter x +# pragma warning(disable : 4047) // 'void ** ' differs in levels of indirection from 'long *' +# pragma warning(disable : 4049) // terminating line number emission +# pragma warning(disable : 4100) // unreferenced formal parameter +# pragma warning(disable : 4115) // named type definition in parentheses +# pragma warning(disable : 4127) // conditional expression is constant +# pragma warning(disable : 4132) // const object should be initialized +# pragma warning(disable : 4244) // conversion from 'int ' to 'char ', possible loss of data +# pragma warning(disable : 4305) // truncation from 'int ' to 'short ' +# pragma warning(disable : 4761) // integral size mismatch in argument; conversion supplied #define SQLITE_SOUNDEX 1 #define SQLITE_ENABLE_FTS3 1 diff --git a/stdafx.h b/stdafx.h index 72f466f2..94916f0d 100644 --- a/stdafx.h +++ b/stdafx.h @@ -3,14 +3,30 @@ // are changed infrequently // -#ifdef WIN32 -// disable warnings about long STL-generated names - #pragma warning( disable : 4503 4786 4800) -#endif +// disable some warnings (especially at warning level 4) + +#pragma warning (disable : 4018) // '<' : signed/unsigned mismatch +#pragma warning (disable : 4100) // unreferenced formal parameter +#pragma warning (disable : 4127) // conditional expression is constant +#pragma warning (disable : 4201) // nonstandard extension used : nameless struct/union +#pragma warning (disable : 4244) // conversion from 'int ' to 'char ', possible loss of data +#pragma warning (disable : 4244) // conversion from 'int' to 'unsigned short', possible loss of data +#pragma warning (disable : 4503) // decorated name length exceeded, name was truncated +#pragma warning (disable : 4505) // unreferenced local function has been removed +#pragma warning (disable : 4511) // copy constructor could not be generated +#pragma warning (disable : 4512) // assignment operator could not be generated +#pragma warning (disable : 4514) // unreferenced inline function has been removed +#pragma warning (disable : 4611) // interaction between '_setjmp' and C++ object destruction is non-portable +#pragma warning (disable : 4663) // C++ language change: to explicitly specialize class template yadda yadda +#pragma warning (disable : 4706) // assignment within conditional expression +#pragma warning (disable : 4786) // identifier was truncated to 'number' characters in the debug information +#pragma warning (disable : 4800) // forcing value to bool 'true' or 'false' (performance warning) + #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #define HAVE_CONFIG_H // for PCRE +#pragma warning( push, 3) #include #ifdef _DEBUG @@ -51,6 +67,7 @@ #include #include #include + #include "format.h" #include "exceptions.h" @@ -66,6 +83,7 @@ #include #include #include +#pragma warning (pop) extern "C" { diff --git a/world_debug.cpp b/world_debug.cpp index 7d733815..884d6215 100644 --- a/world_debug.cpp +++ b/world_debug.cpp @@ -151,9 +151,7 @@ static void ShowAnsiColour (CMUSHclientDoc * pDoc, CString strTextColour = "black"; // if colour is dark, use white, otherwise use black - if (((GetRValue (iColour) & 0xFF) + - (GetGValue (iColour) & 0xFF) + - (GetBValue (iColour) & 0xFF) ) < (128 * 3)) + if (((iRed & 0xFF) + (iGreen & 0xFF) + (iBlue & 0xFF) ) < (128 * 3)) strTextColour = "white"; pDoc->ColourTell (strTextColour, ColourToName (iColour), strName); @@ -791,7 +789,6 @@ VARIANT CMUSHclientDoc::Debug(LPCTSTR Command) it != GetArrayMap ().end (); it++, iCount++) { - tStringToStringMap * m = it->second; Note (CFormat ("Array: \"%s\"", it->first.c_str ())); // now show key/value pairs diff --git a/xml/xml_load_world.cpp b/xml/xml_load_world.cpp index 6e18ff7c..39d778c7 100644 --- a/xml/xml_load_world.cpp +++ b/xml/xml_load_world.cpp @@ -825,6 +825,8 @@ bool bPlugin; } // end of CMUSHclientDoc::Load_One_Include_XML +#pragma warning(push) +#pragma warning(disable : 4189) // warning C4189: 'iVersion' : local variable is initialized but not referenced void CMUSHclientDoc::Load_General_XML (CXMLelement & parent, const unsigned long iFlags) { @@ -867,6 +869,7 @@ void CMUSHclientDoc::Load_General_XML (CXMLelement & parent, END_LOAD_LOOP; } // end of CMUSHclientDoc::Load_General_XML +#pragma warning(pop) void CMUSHclientDoc::Load_World_Numeric_Options_XML (CXMLelement & parent, bool bUseDefault, @@ -1740,7 +1743,7 @@ CString strName, if (i >= NUMITEMS (strMacroDescriptions)) ThrowErrorException ("Macro named \"%s\" not recognised", (LPCTSTR) strName); - unsigned short iType; + unsigned short iType = REPLACE_COMMAND; if (strType == "replace") iType = REPLACE_COMMAND; @@ -2176,6 +2179,8 @@ long iSequence; } // end of CMUSHclientDoc::Load_One_Print_Colour_XML +#pragma warning(push) +#pragma warning(disable : 4189) // warning C4189: 'iVersion' : local variable is initialized but not referenced void CMUSHclientDoc::Load_Comments_XML (CXMLelement & parent) { CString strComment; @@ -2208,7 +2213,7 @@ int iFlags = 0; // for use by GET_VERSION_AND_DEFAULTS macro ActivateNotepad (strTitle); } // end of CMUSHclientDoc::Load_Comments_XML - +#pragma warning(pop) void CMUSHclientDoc::Load_Plugin_XML (CXMLelement & parent) { diff --git a/xml/xml_serialize.cpp b/xml/xml_serialize.cpp index c6fec961..80074189 100644 --- a/xml/xml_serialize.cpp +++ b/xml/xml_serialize.cpp @@ -26,7 +26,7 @@ void CMUSHclientDoc::Serialize_World_XML (CArchive& ar) if (m_strWorldID.IsEmpty ()) m_strWorldID = GetUniqueID (); - Save_World_XML (ar, ~0); // save all options + Save_World_XML (ar, (unsigned long) ~0); // save all options // ensure all plugins save their state right now :) for (POSITION pos = m_PluginList.GetHeadPosition (); pos; ) @@ -44,7 +44,7 @@ void CMUSHclientDoc::Serialize_World_XML (CArchive& ar) } else { // loaidng - Load_World_XML (ar, ~(XML_PLUGINS | XML_NO_PLUGINS)); // load all options, except plugins + Load_World_XML (ar, (unsigned long) ~(XML_PLUGINS | XML_NO_PLUGINS)); // load all options, except plugins m_bLoaded = true; // this world has been loaded from disk } diff --git a/xml/xmlparse.cpp b/xml/xmlparse.cpp index 49fe7033..6a0e5a92 100644 --- a/xml/xmlparse.cpp +++ b/xml/xmlparse.cpp @@ -955,7 +955,8 @@ long length; ThrowErrorException ("No closing \";\" in XML entity argument \"&%s\"", (LPCTSTR) CString (pEntity, p - pEntity)); - strFixedValue += Get_XML_Entity (CString (pEntity, p - pEntity)); // add to list + CString s (pEntity, p - pEntity); + strFixedValue += Get_XML_Entity (s); // add to list pStart = p + 1; // move on past the entity diff --git a/zlib/readme.txt b/zlib/readme.txt index ece56319..7b086b4b 100644 --- a/zlib/readme.txt +++ b/zlib/readme.txt @@ -42,3 +42,11 @@ zutil.h add: #undef ZLIB_DLL // NJG + + +4. Edit: zlib.h and at the start add the lines: + +// pragmas added by Nick Gammon +#pragma warning( disable : 4131) // uses old-style declarator +#pragma warning( disable : 4127) // conditional expression is constant +#pragma warning( disable : 4244) // conversion from 'int' to 'unsigned short', possible loss of data