apple: Fix some warnings

This commit is contained in:
Lioncash 2014-10-14 08:42:15 -04:00
parent 056bc62d23
commit 44b26b5ef2
3 changed files with 26 additions and 35 deletions

View File

@ -32,13 +32,10 @@ static void* const associated_core_key = (void*)&associated_core_key;
- (void)sendEvent:(NSEvent *)event
{
int i;
NSEventType event_type;
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
[super sendEvent:event];
event_type = event.type;
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
NSEventType event_type = event.type;
switch ((NSInteger)event_type)
{
@ -53,7 +50,7 @@ static void* const associated_core_key = (void*)&associated_core_key;
{
apple_input_keyboard_event(event_type == NSKeyDown, event.keyCode, [ch characterAtIndex:0], event.modifierFlags);
for (i = 1; i < ch.length; i ++)
for (NSUInteger i = 1; i < ch.length; i ++)
apple_input_keyboard_event(event_type == NSKeyDown, 0, [ch characterAtIndex:i], event.modifierFlags);
}
}
@ -133,14 +130,9 @@ static char** waiting_argv;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
NSComboBox* cb;
const core_info_list_t* core_list;
int i;
const char *paths;
apple_platform = self;
paths = [[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject] UTF8String];
const char* paths = [[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject] UTF8String];
fill_pathname_join(g_defaults.core_dir, NSBundle.mainBundle.bundlePath.UTF8String, "Contents/Resources/modules", sizeof(g_defaults.core_dir));
fill_pathname_join(g_defaults.menu_config_dir, paths, "RetroArch", sizeof(g_defaults.menu_config_dir));
@ -162,12 +154,12 @@ static char** waiting_argv;
// Warn if there are no cores present
core_info_set_core_path();
core_list = (const core_info_list_t*)core_info_list_get();
const core_info_list_t* core_list = (const core_info_list_t*)core_info_list_get();
// Create core select list
cb = (NSComboBox*)[[self.coreSelectSheet contentView] viewWithTag:1];
NSComboBox* cb = (NSComboBox*)[[self.coreSelectSheet contentView] viewWithTag:1];
for (i = 0; core_list && i < core_list->count; i ++)
for (size_t i = 0; core_list && i < core_list->count; i ++)
{
NSString* desc = (NSString*)BOXSTRING(core_list->list[i].display_name);
#if defined(MAC_OS_X_VERSION_10_6)

View File

@ -60,14 +60,14 @@ static void* const associated_name_tag = (void*)&associated_name_tag;
- (void)checkBind:(NSTimer*)send
{
int32_t value = 0;
int32_t index = _setting->index ? _setting->index - 1 : 0;
int32_t index = self.setting->index ? self.setting->index - 1 : 0;
if ((value = apple_input_find_any_key()))
BINDFOR(*_setting).key = input_translate_keysym_to_rk(value);
BINDFOR(*[self setting]).key = input_translate_keysym_to_rk(value);
else if ((value = apple_input_find_any_button(index)) >= 0)
BINDFOR(*_setting).joykey = value;
BINDFOR(*[self setting]).joykey = value;
else if ((value = apple_input_find_any_axis(index)))
BINDFOR(*_setting).joyaxis = (value > 0) ? AXIS_POS(value - 1) : AXIS_NEG(abs(value) - 1);
BINDFOR(*[self setting]).joyaxis = (value > 0) ? AXIS_POS(value - 1) : AXIS_NEG(abs(value) - 1);
else
return;

View File

@ -64,11 +64,10 @@ void apple_display_alert(const char *message, const char *title)
- (BOOL)isPartialStringValid:(NSString*)partialString newEditingString:(NSString**)newString errorDescription:(NSString**)error
{
NSUInteger i;
bool hasDot = false;
if (partialString.length)
for (i = 0; i < partialString.length; i ++)
for (NSUInteger i = 0; i < partialString.length; i ++)
{
unichar ch = [partialString characterAtIndex:i];