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

@ -25,22 +25,6 @@ if env['HAVE_BLUEZ']:
if sys.platform == 'darwin':
files += [ "io_osx.m", ]
if sys.platform == 'darwin':
env_wiiuse = env.Clone(
CCFLAGS = env.filterWarnings(env['CCFLAGS']) + ' -fvisibility=default -x objective-c++',
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']) + ' -x objective-c++',
)
else:
env_wiiuse = env.Clone(
CCFLAGS = env.filterWarnings(env['CCFLAGS']) + ' -fvisibility=default',
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']),
parse_flags = ['-fPIC']
)
libs = [
'm',
]
env_wiiuse.StaticLibrary(env['local_libs'] + "wiiuse", files, LIBS=libs)
env.StaticLibrary(env['local_libs'] + "wiiuse", files, LIBS='m')
env['HAVE_WIIUSE'] = 1

View File

@ -57,8 +57,6 @@ static void guitar_hero_3_pressed_buttons(struct guitar_hero_3_t* gh3, short now
* @return Returns 1 if handshake was successful, 0 if not.
*/
int guitar_hero_3_handshake(struct wiimote_t* wm, struct guitar_hero_3_t* gh3, byte* data, unsigned short len) {
int offset = 0;
/*
* The good fellows that made the Guitar Hero 3 controller
* failed to factory calibrate the devices. There is no

View File

@ -267,7 +267,6 @@ int wiiuse_io_read(struct wiimote_t* wm) {
struct timeval tv;
fd_set fds;
int r;
int i;
if (!wm)
return 0;

View File

@ -682,7 +682,7 @@ static float ir_distance(struct ir_dot_t* dot) {
* precision for a big increase in usability.
*/
static int ir_correct_for_bounds(int* x, int* y, enum aspect_t aspect, int offset_x, int offset_y) {
int x0, y0;
int xzero, yzero;
int xs, ys;
if (aspect == WIIUSE_ASPECT_16_9) {
@ -693,13 +693,13 @@ static int ir_correct_for_bounds(int* x, int* y, enum aspect_t aspect, int offse
ys = WM_ASPECT_4_3_Y;
}
x0 = ((1024 - xs) / 2) + offset_x;
y0 = ((768 - ys) / 2) + offset_y;
xzero = ((1024 - xs) / 2) + offset_x;
yzero = ((768 - ys) / 2) + offset_y;
if ((*x >= x0)
&& (*x <= (x0 + xs))
&& (*y >= y0)
&& (*y <= (y0 + ys)))
if ((*x >= xzero)
&& (*x <= (xzero + xs))
&& (*y >= yzero)
&& (*y <= (yzero + ys)))
{
*x -= offset_x;
*y -= offset_y;