Raised the warning level on MSVC8 to 4, and fixed several warnings caused by that.

Originally committed to SVN as r2045.
This commit is contained in:
Rodrigo Braz Monteiro 2008-03-13 19:12:55 +00:00
parent c248ca39f2
commit cee958b2d3
12 changed files with 28 additions and 10 deletions

View file

@ -35,6 +35,10 @@
#include <string.h> #include <string.h>
#include <setjmp.h> #include <setjmp.h>
#ifdef _MSC_VER
#pragma warning(disable: 4701)
#endif
#ifdef _WIN32 #ifdef _WIN32
// MS names some functions differently // MS names some functions differently
#define alloca _alloca #define alloca _alloca

View file

@ -32,6 +32,10 @@
#ifndef MATROSKA_PARSER_H #ifndef MATROSKA_PARSER_H
#define MATROSKA_PARSER_H #define MATROSKA_PARSER_H
#ifdef _MSC_VER
#pragma warning(disable: 4201)
#endif
/* Random notes: /* Random notes:
* *
* The parser does not process frame data in any way and does not read it into * The parser does not process frame data in any way and does not read it into
@ -395,4 +399,8 @@ X const char *cs_GetLastError(CompressedStream *cs);
#undef X #undef X
#ifdef _MSC_VER
#pragma warning(default: 4201)
#endif
#endif #endif

View file

@ -653,7 +653,7 @@ void AudioKaraoke::EndSplit(bool commit) {
wxLogDebug(_T("AudioKaraoke::EndSplit(commit=%d)"), commit?1:0); wxLogDebug(_T("AudioKaraoke::EndSplit(commit=%d)"), commit?1:0);
splitting = false; splitting = false;
bool hasSplit = false; bool hasSplit = false;
size_t first_sel = ~0; size_t first_sel = ~0U;
for (size_t i = 0; i < syllables.size(); i ++) { for (size_t i = 0; i < syllables.size(); i ++) {
if (syllables[i].pending_splits.size() > 0) { if (syllables[i].pending_splits.size() > 0) {
if (commit) { if (commit) {

View file

@ -664,6 +664,7 @@ namespace Automation4 {
if (has_config && config_dialog) { if (has_config && config_dialog) {
int results_produced = config_dialog->LuaReadBack(L); int results_produced = config_dialog->LuaReadBack(L);
assert(results_produced == 1); assert(results_produced == 1);
(void) results_produced; // avoid warning on release builds
// TODO, write back stored options here // TODO, write back stored options here
} else { } else {
// no config so put an empty table instead // no config so put an empty table instead

View file

@ -43,6 +43,10 @@
#include "options.h" #include "options.h"
#include "ass_style.h" #include "ass_style.h"
#ifdef __VISUALC__
#pragma warning(disable: 4800)
#pragma warning(disable: 4706)
#endif
#define COLLECT_PV(buf, s, e) \ #define COLLECT_PV(buf, s, e) \
buf = wxString(SvPV_nolen(ST(s)), pl2wx);\ buf = wxString(SvPV_nolen(ST(s)), pl2wx);\

View file

@ -46,6 +46,7 @@
#ifdef __VISUALC__ #ifdef __VISUALC__
#pragma warning(disable: 4800) #pragma warning(disable: 4800)
#pragma warning(disable: 4706)
#endif #endif

View file

@ -101,7 +101,6 @@ wxString CharSetDetect::GetEncoding(wxString filename) {
results.sort(); results.sort();
// Get choice from user // Get choice from user
int n = results.size();
wxArrayString choices; wxArrayString choices;
wxArrayString picked; wxArrayString picked;
int i = 0; int i = 0;

View file

@ -238,9 +238,9 @@ void DialogDummyVideo::OnLengthChange(wxCommandEvent &evt)
void DialogDummyVideo::UpdateLengthDisplay() void DialogDummyVideo::UpdateLengthDisplay()
{ {
double fpsval; double fpsval;
int lengthval = 0; int lengthval = length->GetValue();
if (!length_display) return; if (!length_display) return;
if ((fps->GetValue().ToDouble(&fpsval)) && (lengthval = length->GetValue()) && fpsval > 0 && lengthval > 0) { if ((fps->GetValue().ToDouble(&fpsval)) && fpsval > 0 && lengthval > 0) {
int tt = int(lengthval / fpsval * 1000); // frames / (frames/seconds) * 1000 = milliseconds int tt = int(lengthval / fpsval * 1000); // frames / (frames/seconds) * 1000 = milliseconds
// 32 bit signed int can hold almost 600 positive hours when counting milliseconds, ASS allows at most just below 10 hours, so we're safe // 32 bit signed int can hold almost 600 positive hours when counting milliseconds, ASS allows at most just below 10 hours, so we're safe
int ms, s, m, h; int ms, s, m, h;

View file

@ -117,7 +117,7 @@ void SetThreadName(DWORD dwThreadID, LPCSTR szThreadName) {
// Gets called when application starts, creates MainFrame // Gets called when application starts, creates MainFrame
bool AegisubApp::OnInit() { bool AegisubApp::OnInit() {
#ifdef __VISUALC__ #ifdef __VISUALC__
SetThreadName(-1,"AegiMain"); SetThreadName((DWORD) -1,"AegiMain");
#endif #endif
StartupLog(_T("Inside OnInit")); StartupLog(_T("Inside OnInit"));

View file

@ -78,7 +78,7 @@ wxArrayInt VFWWrapper::GetKeyFrames(wxString filename) {
// Loop through stream // Loop through stream
for (size_t i=0;i<frame_c;i++) { for (size_t i=0;i<frame_c;i++) {
if (AVIStreamIsKeyFrame(ppavi,i)) { if (AVIStreamIsKeyFrame(ppavi,(int)i)) {
frames.Add(i); frames.Add(i);
} }
} }

View file

@ -40,6 +40,7 @@
#ifdef WITH_DIRECTSHOW #ifdef WITH_DIRECTSHOW
#pragma warning(disable: 4995) #pragma warning(disable: 4995)
#pragma warning(disable: 4238)
#include <wx/wxprec.h> #include <wx/wxprec.h>
#ifdef __WINDOWS__ #ifdef __WINDOWS__
#include <wx/image.h> #include <wx/image.h>

View file

@ -52,11 +52,11 @@
OpenMP="true" OpenMP="true"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdwx.h" PrecompiledHeaderThrough="stdwx.h"
WarningLevel="3" WarningLevel="4"
WarnAsError="true" WarnAsError="true"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
DebugInformationFormat="4" DebugInformationFormat="4"
DisableSpecificWarnings="4267" DisableSpecificWarnings="4267,4100,4428"
ForcedIncludeFiles="stdwx.h;config.h" ForcedIncludeFiles="stdwx.h;config.h"
/> />
<Tool <Tool
@ -223,11 +223,11 @@
OpenMP="true" OpenMP="true"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdwx.h" PrecompiledHeaderThrough="stdwx.h"
WarningLevel="3" WarningLevel="4"
WarnAsError="true" WarnAsError="true"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
DisableSpecificWarnings="4267" DisableSpecificWarnings="4267,4100,4428"
ForcedIncludeFiles="stdwx.h;config.h" ForcedIncludeFiles="stdwx.h;config.h"
/> />
<Tool <Tool