Fix some cases of variables being used uninitialized. Also some unused

variables, writeable strings and dangerously shadowed variables.

index(), gamma(), exp() and y0() are POSIX functions and using those
names can cause namespace confusion.

A number of C files were missing the final newline required by ANSI C
and some versions of GCC are pedantic enough to complain about this.

These changes simply the scons build, allowing us to get rid of
filterWarnings which is simply more trouble than it's worth.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5574 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2010-06-02 20:35:12 +00:00
parent 03d1438be8
commit 30e437f9e3
85 changed files with 212 additions and 284 deletions

View File

@ -17,5 +17,4 @@ if env['HAVE_WX']:
env_inputpc = env.Clone()
env_inputpc.Append(CXXFLAGS = [ '-fPIC' ])
env_inputpc.StaticLibrary(env['local_libs'] + "inputplugincommon", files)

View File

@ -46,4 +46,4 @@ void CConfig::Save()
ac_Config.Set(file);
file.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "DSP.ini").c_str());
}
}

View File

@ -79,11 +79,11 @@ void CMailHandler::DoState(PointerWrap &p)
if (p.GetMode() == PointerWrap::MODE_READ)
{
Clear();
int sz;
int sz = 0;
p.Do(sz);
for (int i = 0; i < sz; i++)
{
u32 mail;
u32 mail = 0;
p.Do(mail);
m_Mails.push(mail);
}

View File

@ -31,7 +31,6 @@ if dspenv['HAVE_WX']:
]
dspenv.Append(
CXXFLAGS = [ '-fPIC' ],
LIBS = [ 'common', 'audiocommon' ],
)
if sys.platform == 'darwin':

View File

@ -26,12 +26,10 @@ if env['HAVE_WX']:
lleenv = env.Clone()
if env['HAVE_WX']:
lleenv.Append(
CXXFLAGS = [ '-fPIC' ],
LIBS = [ 'dspcore', 'audiocommon', 'common', 'debugger_ui_util' ],
)
else:
lleenv.Append(
CXXFLAGS = [ '-fPIC' ],
LIBS = [ 'dspcore', 'audiocommon', 'common' ],
)
if sys.platform == 'darwin':

View File

@ -178,4 +178,4 @@ void DoState(unsigned char **ptr, int mode)
} // Recording
#endif // RERECORDING
#endif // RERECORDING

View File

@ -151,4 +151,4 @@ void SetInterlacingMode(const BPCmd &bp)
// TODO
}
};
};

View File

@ -140,4 +140,4 @@ int GetNumAdapters();
} // namespace
#endif
#endif

View File

@ -31,4 +31,4 @@ namespace D3D
// Utility functions
LPDIRECT3DVERTEXSHADER9 CompileAndCreateVertexShader(const char *code, int len);
LPDIRECT3DPIXELSHADER9 CompileAndCreatePixelShader(const char *code, int len);
}
}

View File

@ -465,4 +465,4 @@ void DListCache::Cleanup()
SETSTAT(stats.numDListsAlive,(int)dlists.size());
}
#endif
#endif

View File

@ -69,4 +69,4 @@ public:
static void Call(u32 _addr, u32 _size);
};
#endif
#endif

View File

@ -17,4 +17,4 @@
#pragma once
void DlgSettings_Show(HINSTANCE hInstance, HWND parent);
void DlgSettings_Show(HINSTANCE hInstance, HWND parent);

View File

@ -519,4 +519,4 @@ const XFBSource** FramebufferManager::getVirtualXFBSource(u32 xfbAddr, u32 fbWid
}
return &m_overlappingXFBArray[0];
}
}

View File

@ -28,4 +28,4 @@
// A global plugin specification
extern PLUGIN_GLOBALS* globals;
#endif // _GLOBALS_H_
#endif // _GLOBALS_H_

View File

@ -170,4 +170,4 @@ void D3DVertexFormat::SetupVertexPointers() const
D3D::SetVertexDeclaration(d3d_decl);
else
ERROR_LOG(VIDEO, "invalid d3d decl");
}
}

View File

@ -81,4 +81,4 @@ struct RGBAFloat
}
};
#endif
#endif

View File

@ -86,4 +86,4 @@ public:
static void CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool bIsIntensityFmt, u32 copyfmt, int bScaleByHalf, const EFBRectangle &source_rect);
};
#endif
#endif

View File

@ -145,4 +145,4 @@ namespace W32Util
{
Write(&i,sizeof(char));
}
}
}

View File

@ -58,4 +58,4 @@ namespace W32Util
}
#endif //__LAMEFILE_H__
#endif //__LAMEFILE_H__

View File

@ -99,4 +99,4 @@ namespace W32Util
CloseClipboard();
return TRUE;
}
}
}

View File

@ -6,4 +6,4 @@ namespace W32Util
HBITMAP CreateBitmapFromARGB(HWND someHwnd, DWORD *image, int w, int h);
void NiceSizeFormat(size_t size, char * out);
BOOL CopyTextToClipboard(HWND hwnd, char * text);
}
}

View File

@ -224,4 +224,4 @@ namespace W32Util
}
return 0;
}
}
}

View File

@ -84,4 +84,4 @@ namespace W32Util
}
}

View File

@ -12,4 +12,4 @@ namespace W32Util
std::string& _strFileName);
std::vector<std::string> BrowseForFileNameMultiSelect(bool _bLoad, HWND _hParent, const char *_pTitle,
const char *_pInitialFolder,const char *_pFilter,const char *_pExtension);
}
}

View File

@ -79,4 +79,4 @@ namespace W32Util
if (_handle != NULL)
SuspendThread(_handle);
}
}
}

View File

@ -27,4 +27,4 @@ void XFUpdatePJ();
void LoadXFReg(u32 transferSize, u32 address, u32 *pData);
void LoadIndexedXF(u32 val, int array);
#endif
#endif

View File

@ -24,4 +24,4 @@ int write_u_long_int ( unsigned long int u_long_int_val, FILE *fileout );
int write_u_short_int ( unsigned short int u_short_int_val, FILE *fileout );
#endif
#endif

View File

@ -15,4 +15,4 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "stdafx.h"
#include "stdafx.h"

View File

@ -25,8 +25,7 @@ files = [
'PostProcessing.cpp',
'FramebufferManager.cpp',
]
compileFlags = [
'-fPIC',
compileFlags = [
]
linkFlags = [
]

View File

@ -15,4 +15,4 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "stdafx.h"
#include "stdafx.h"

View File

@ -226,7 +226,7 @@ inline void CalculateLOD(s32 &lod, bool &linear, u32 texmap, u32 texcoord)
bias >>= 1;
lod += bias;
linear = (lod > 0 && (tm0.min_filter & 4) || lod <= 0 && tm0.mag_filter);
linear = ((lod > 0 && (tm0.min_filter & 4)) || (lod <= 0 && tm0.mag_filter));
// order of checks matters
// should be:

View File

@ -36,9 +36,6 @@ files = [
'VideoConfig.cpp',
'XFMemLoader.cpp',
]
compileFlags = [
'-fPIC',
]
linkFlags = [
]
libs = [
@ -56,7 +53,7 @@ conf = gfxenv.Configure(custom_tests = tests,
if sys.platform == 'darwin':
gfxenv['FRAMEWORKS'] = ['CoreFoundation', 'System', 'OpenGL', 'Cocoa', 'Cg']
compileFlags += ['-x','objective-c++',]
compileFlags = ['-x','objective-c++',]
files += [ 'cocoaGL.m', ]
conf.CheckPKG('OpenGL')
@ -94,7 +91,6 @@ if gfxenv['USE_WX'] and not gfxenv['HAVE_WX']:
print "Must have wx to use wxgl"
Return()
gfxenv.Append(
CXXFLAGS = compileFlags,
LINKFLAGS = linkFlags,
)

View File

@ -15,4 +15,4 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "stdafx.h"
#include "stdafx.h"

View File

@ -30,8 +30,7 @@ if wmenv['HAVE_WX']:
]
libs = [ 'common', 'inputcommon' ]
cxxflags = [ '-fPIC' ]
cxxflags = [ ]
if wmenv['HAVE_WIIUSE']:
libs += [ 'wiiuse' ]

View File

@ -41,4 +41,4 @@ private:
int err;
static int noinst;
};
#endif
#endif

View File

@ -63,7 +63,7 @@ wiimote_t** g_WiiMotesFromWiiUse = NULL;
Common::Thread* g_pReadThread = NULL;
int g_NumberOfWiiMotes;
CWiiMote* g_WiiMotes[MAX_WIIMOTES];
bool g_Shutdown = false;
volatile bool g_Shutdown = false;
Common::Event g_StartThread;
Common::Event g_StopThreadTemporary;
bool g_LocalThread = true;

View File

@ -193,4 +193,4 @@ void DoState(unsigned char **ptr, int mode)
} // Recording
#endif // RERECORDING
#endif // RERECORDING

View File

@ -1,31 +1,30 @@
# -*- python -*-
Import('env')
import sys
name = "Plugin_nJoy_SDL"
padenv = env.Clone()
if not env['HAVE_SDL']:
print name + " must have SDL to be build"
Return()
files = [
'Config.cpp',
'nJoy.cpp',
'Rumble.cpp',
]
if padenv['HAVE_WX']:
files += [
'GUI/AboutBox.cpp',
'GUI/ConfigAdvanced.cpp',
'GUI/ConfigJoypad.cpp',
'GUI/ConfigBox.cpp',
]
padenv.Append(
CXXFLAGS = [ '-fPIC' ],
LIBS = [ 'common', 'inputcommon' ],
)
padenv.SharedLibrary(env['plugin_dir']+name, files)
# -*- python -*-
Import('env')
import sys
name = "Plugin_nJoy_SDL"
padenv = env.Clone()
if not env['HAVE_SDL']:
print name + " must have SDL to be build"
Return()
files = [
'Config.cpp',
'nJoy.cpp',
'Rumble.cpp',
]
if padenv['HAVE_WX']:
files += [
'GUI/AboutBox.cpp',
'GUI/ConfigAdvanced.cpp',
'GUI/ConfigJoypad.cpp',
'GUI/ConfigBox.cpp',
]
padenv.Append(
LIBS = [ 'common', 'inputcommon' ],
)
padenv.SharedLibrary(env['plugin_dir']+name, files)