mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
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:
18
Externals/WiiUseSrc/Src/SConscript
vendored
18
Externals/WiiUseSrc/Src/SConscript
vendored
@ -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
|
||||
|
2
Externals/WiiUseSrc/Src/guitar_hero_3.c
vendored
2
Externals/WiiUseSrc/Src/guitar_hero_3.c
vendored
@ -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
|
||||
|
1
Externals/WiiUseSrc/Src/io_nix.c
vendored
1
Externals/WiiUseSrc/Src/io_nix.c
vendored
@ -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;
|
||||
|
||||
|
14
Externals/WiiUseSrc/Src/ir.c
vendored
14
Externals/WiiUseSrc/Src/ir.c
vendored
@ -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;
|
||||
|
Reference in New Issue
Block a user