Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Got rid of compiler warnings, bumped warning level to 4

  • Loading branch information...
commit a0d2cd3994a2d297ec6e48bd991b1d9383a4c692 1 parent 5a7c795
@nickgammon authored
Showing with 269 additions and 181 deletions.
  1. +1 −1  Finding.cpp
  2. +0 −1  MUSHclient.cpp
  3. +22 −15 MUSHclient.dsp
  4. +17 −13 ProcessPreviousLine.cpp
  5. +1 −2  TextView.cpp
  6. +4 −3 Utilities.cpp
  7. +1 −1  chatsock.h
  8. +0 −1  dialogs/ColourPickerDlg.cpp
  9. +1 −3 dialogs/KeyNameDlg.cpp
  10. +0 −3  dialogs/TipDlg.cpp
  11. +0 −2  dialogs/global_prefs/GlobalPrefs.cpp
  12. +0 −3  dialogs/plugins/PluginsDlg.cpp
  13. +1 −3 dialogs/world_prefs/TreePropertySheet.cpp
  14. +7 −7 dialogs/world_prefs/prefspropertypages.cpp
  15. +13 −26 doc.cpp
  16. +1 −3 evaluate.cpp
  17. +2 −1  lsqlite/lsqlite3.c
  18. +10 −0 luacom/LuaCompat.h
  19. +3 −0  luacom/tCOMUtil.cpp
  20. +2 −0  luacom/tUtil.cpp
  21. +7 −1 mcdatetime.cpp
  22. +0 −6 miniwindow.cpp
  23. +7 −11 mushview.cpp
  24. +5 −5 mxp/mxpClose.cpp
  25. +0 −1  mxp/mxpCloseAtomic.cpp
  26. +2 −1  mxp/mxpDefs.cpp
  27. +23 −2 pcre/readme.txt
  28. +5 −0 png/readme.txt
  29. +5 −0 regexp.cpp
  30. +2 −2 resource.h
  31. +3 −1 scripting/bits.c
  32. +2 −1  scripting/functionlist.cpp
  33. +2 −1  scripting/lpeg.c
  34. +1 −0  scripting/lrexlib.c
  35. +2 −0  scripting/lua_compress.c
  36. +14 −13 scripting/lua_methods.cpp
  37. +0 −1  scripting/lua_progressdlg.cpp
  38. +16 −4 scripting/lua_scripting.cpp
  39. +0 −1  scripting/lua_utils.cpp
  40. +20 −15 scripting/methods.cpp
  41. +5 −0 scripting/number.c
  42. +10 −0 scripting/scriptengine.cpp
  43. +0 −7 sendvw.cpp
  44. +10 −7 sqlite3/readme.txt
  45. +22 −4 stdafx.h
  46. +1 −4 world_debug.cpp
  47. +7 −2 xml/xml_load_world.cpp
  48. +2 −2 xml/xml_serialize.cpp
  49. +2 −1  xml/xmlparse.cpp
  50. +8 −0 zlib/readme.txt
View
2  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)
View
1  MUSHclient.cpp
@@ -263,7 +263,6 @@ BOOL CMUSHclientApp::InitInstance()
// open SQLite database for preferences
- char *zErrMsg = 0;
int rc;
CFileStatus status;
View
37 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
View
30 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
View
3  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);
View
7 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;
View
2  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
View
1  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);
View
4 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
View
3  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);
}
View
2  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
View
3  dialogs/plugins/PluginsDlg.cpp
@@ -328,10 +328,7 @@ void CPluginsDlg::OnAddPlugin()
if (nResult != IDOK)
- {
- DWORD reason = CommDlgExtendedError();
return; // cancelled dialog
- }
bool bChanged = false;
View
4 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;i<nSize;i++) {
cControlPos& cur=m_acControlPos[i];
View
14 dialogs/world_prefs/prefspropertypages.cpp
@@ -36,7 +36,7 @@
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
-#pragma warning( disable: 4800)
+#pragma warning (disable : 4800) // forcing value to bool 'true' or 'false' (performance warning)
bool NotFound (CFindInfo & FindInfo);
#define NL "\r\n"
@@ -3069,7 +3069,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);
}
@@ -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
}
View
39 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<string> 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;
View
4 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 ();
View
3  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 *
View
10 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
*
View
3  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.
//
//////////////////////////////////////////////////////////////////////
View
2  luacom/tUtil.cpp
@@ -1,3 +1,5 @@
+#pragma warning( disable : 4100) // unreferenced formal parameter
+
// tUtil.cpp: implementation of the tUtil class.
//
//////////////////////////////////////////////////////////////////////
View
8 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 ||
View
6 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;
View
18 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;
View
10 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;
View
1  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
View
3  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
View
25 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.
View
5 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
View
5 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),
View
4 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
View
4 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;
View
3  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)
View
3  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 $
View
1  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)
View
2  scripting/lua_compress.c
@@ -11,6 +11,8 @@
#include <ctype.h>
#include <string.h>
+#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
View
27 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
View
1  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
View
20 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
View
1  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
{
View
35 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)
View
5 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.
View
10 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,
View
7 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()
View
17 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
View
26 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 <afx.h>
#ifdef _DEBUG
@@ -51,6 +67,7 @@
#include <activscp.h>
#include <afxmt.h>
#include <afxpriv.h>
+
#include "format.h"
#include "exceptions.h"
@@ -66,6 +83,7 @@
#include <iostream>
#include <iterator>
#include <sstream>
+#pragma warning (pop)
extern "C"
{
View
5 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
View
9 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)
{
View
4 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
}
View
3  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
View
8 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
Please sign in to comment.
Something went wrong with that request. Please try again.