Fix warnings.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3512 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -66,8 +66,8 @@ static joystick *joysticks;
|
|||||||
|
|
||||||
#endif /* HAVE_JOYSTICK */
|
#endif /* HAVE_JOYSTICK */
|
||||||
|
|
||||||
static int joycount;
|
static unsigned int joycount;
|
||||||
static int num_sdl_keys = 0;
|
static unsigned int num_sdl_keys = 0;
|
||||||
static keybinding **bindings = NULL;
|
static keybinding **bindings = NULL;
|
||||||
|
|
||||||
static keypool *pool;
|
static keypool *pool;
|
||||||
@@ -112,7 +112,7 @@ create_joystick (int index)
|
|||||||
{
|
{
|
||||||
SDL_Joystick *stick;
|
SDL_Joystick *stick;
|
||||||
int axes, buttons, hats;
|
int axes, buttons, hats;
|
||||||
if (index >= joycount)
|
if ((unsigned int) index >= joycount)
|
||||||
{
|
{
|
||||||
log_add (log_Warning, "VControl warning: Tried to open a non-existent joystick!");
|
log_add (log_Warning, "VControl warning: Tried to open a non-existent joystick!");
|
||||||
return;
|
return;
|
||||||
@@ -183,7 +183,7 @@ destroy_joystick (int index)
|
|||||||
static void
|
static void
|
||||||
key_init (void)
|
key_init (void)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
pool = allocate_key_chunk ();
|
pool = allocate_key_chunk ();
|
||||||
(void)SDL_GetKeyState (&num_sdl_keys);
|
(void)SDL_GetKeyState (&num_sdl_keys);
|
||||||
bindings = (keybinding **) HMalloc (sizeof (keybinding *) * num_sdl_keys);
|
bindings = (keybinding **) HMalloc (sizeof (keybinding *) * num_sdl_keys);
|
||||||
@@ -219,7 +219,7 @@ key_init (void)
|
|||||||
static void
|
static void
|
||||||
key_uninit (void)
|
key_uninit (void)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
free_key_pool (pool);
|
free_key_pool (pool);
|
||||||
for (i = 0; i < num_sdl_keys; i++)
|
for (i = 0; i < num_sdl_keys; i++)
|
||||||
bindings[i] = NULL;
|
bindings[i] = NULL;
|
||||||
@@ -250,7 +250,7 @@ int
|
|||||||
VControl_SetJoyThreshold (int port, int threshold)
|
VControl_SetJoyThreshold (int port, int threshold)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_JOYSTICK
|
#ifdef HAVE_JOYSTICK
|
||||||
if (port >= 0 && port < joycount)
|
if (port >= 0 && (unsigned int) port < joycount)
|
||||||
{
|
{
|
||||||
joysticks[port].threshold = threshold;
|
joysticks[port].threshold = threshold;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -489,7 +489,7 @@ VControl_RemoveGestureBinding (VCONTROL_GESTURE *g, int *target)
|
|||||||
int
|
int
|
||||||
VControl_AddKeyBinding (SDLKey symbol, int *target)
|
VControl_AddKeyBinding (SDLKey symbol, int *target)
|
||||||
{
|
{
|
||||||
if ((symbol < 0) || (symbol >= num_sdl_keys)) {
|
if ((unsigned int) symbol >= num_sdl_keys) {
|
||||||
log_add (log_Warning, "VControl: Illegal key index %d", symbol);
|
log_add (log_Warning, "VControl: Illegal key index %d", symbol);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -500,7 +500,7 @@ VControl_AddKeyBinding (SDLKey symbol, int *target)
|
|||||||
void
|
void
|
||||||
VControl_RemoveKeyBinding (SDLKey symbol, int *target)
|
VControl_RemoveKeyBinding (SDLKey symbol, int *target)
|
||||||
{
|
{
|
||||||
if ((symbol < 0) || (symbol >= num_sdl_keys)) {
|
if ((unsigned int) symbol >= num_sdl_keys) {
|
||||||
log_add (log_Warning, "VControl: Illegal key index %d", symbol);
|
log_add (log_Warning, "VControl: Illegal key index %d", symbol);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -511,7 +511,7 @@ int
|
|||||||
VControl_AddJoyAxisBinding (int port, int axis, int polarity, int *target)
|
VControl_AddJoyAxisBinding (int port, int axis, int polarity, int *target)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_JOYSTICK
|
#ifdef HAVE_JOYSTICK
|
||||||
if (port >= 0 && port < joycount)
|
if (port >= 0 && (unsigned int) port < joycount)
|
||||||
{
|
{
|
||||||
joystick *j = &joysticks[port];
|
joystick *j = &joysticks[port];
|
||||||
if (!(j->stick))
|
if (!(j->stick))
|
||||||
@@ -556,7 +556,7 @@ void
|
|||||||
VControl_RemoveJoyAxisBinding (int port, int axis, int polarity, int *target)
|
VControl_RemoveJoyAxisBinding (int port, int axis, int polarity, int *target)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_JOYSTICK
|
#ifdef HAVE_JOYSTICK
|
||||||
if (port >= 0 && port < joycount)
|
if (port >= 0 && (unsigned int) port < joycount)
|
||||||
{
|
{
|
||||||
joystick *j = &joysticks[port];
|
joystick *j = &joysticks[port];
|
||||||
if (!(j->stick))
|
if (!(j->stick))
|
||||||
@@ -597,7 +597,7 @@ int
|
|||||||
VControl_AddJoyButtonBinding (int port, int button, int *target)
|
VControl_AddJoyButtonBinding (int port, int button, int *target)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_JOYSTICK
|
#ifdef HAVE_JOYSTICK
|
||||||
if (port >= 0 && port < joycount)
|
if (port >= 0 && (unsigned int) port < joycount)
|
||||||
{
|
{
|
||||||
joystick *j = &joysticks[port];
|
joystick *j = &joysticks[port];
|
||||||
if (!(j->stick))
|
if (!(j->stick))
|
||||||
@@ -629,7 +629,7 @@ void
|
|||||||
VControl_RemoveJoyButtonBinding (int port, int button, int *target)
|
VControl_RemoveJoyButtonBinding (int port, int button, int *target)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_JOYSTICK
|
#ifdef HAVE_JOYSTICK
|
||||||
if (port >= 0 && port < joycount)
|
if (port >= 0 && (unsigned int) port < joycount)
|
||||||
{
|
{
|
||||||
joystick *j = &joysticks[port];
|
joystick *j = &joysticks[port];
|
||||||
if (!(j->stick))
|
if (!(j->stick))
|
||||||
@@ -658,7 +658,7 @@ int
|
|||||||
VControl_AddJoyHatBinding (int port, int which, Uint8 dir, int *target)
|
VControl_AddJoyHatBinding (int port, int which, Uint8 dir, int *target)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_JOYSTICK
|
#ifdef HAVE_JOYSTICK
|
||||||
if (port >= 0 && port < joycount)
|
if (port >= 0 && (unsigned int) port < joycount)
|
||||||
{
|
{
|
||||||
joystick *j = &joysticks[port];
|
joystick *j = &joysticks[port];
|
||||||
if (!(j->stick))
|
if (!(j->stick))
|
||||||
@@ -711,7 +711,7 @@ void
|
|||||||
VControl_RemoveJoyHatBinding (int port, int which, Uint8 dir, int *target)
|
VControl_RemoveJoyHatBinding (int port, int which, Uint8 dir, int *target)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_JOYSTICK
|
#ifdef HAVE_JOYSTICK
|
||||||
if (port >= 0 && port < joycount)
|
if (port >= 0 && (unsigned int) port < joycount)
|
||||||
{
|
{
|
||||||
joystick *j = &joysticks[port];
|
joystick *j = &joysticks[port];
|
||||||
if (!(j->stick))
|
if (!(j->stick))
|
||||||
@@ -766,7 +766,7 @@ VControl_RemoveAllBindings (void)
|
|||||||
void
|
void
|
||||||
VControl_ProcessKeyDown (SDLKey symbol)
|
VControl_ProcessKeyDown (SDLKey symbol)
|
||||||
{
|
{
|
||||||
if ((symbol < 0) || (symbol >= num_sdl_keys)) {
|
if (symbol >= num_sdl_keys) {
|
||||||
log_add (log_Warning, "VControl: Got unknown key index %d", symbol);
|
log_add (log_Warning, "VControl: Got unknown key index %d", symbol);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -777,7 +777,7 @@ VControl_ProcessKeyDown (SDLKey symbol)
|
|||||||
void
|
void
|
||||||
VControl_ProcessKeyUp (SDLKey symbol)
|
VControl_ProcessKeyUp (SDLKey symbol)
|
||||||
{
|
{
|
||||||
if ((symbol < 0) || (symbol >= num_sdl_keys))
|
if (symbol >= num_sdl_keys)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
deactivate (bindings[symbol]);
|
deactivate (bindings[symbol]);
|
||||||
|
|||||||
Reference in New Issue
Block a user