(Apple) Style nits
This commit is contained in:
parent
2fc75bb4c5
commit
91faa161af
|
@ -34,20 +34,20 @@ static void* const associated_core_key = (void*)&associated_core_key;
|
||||||
{
|
{
|
||||||
[super sendEvent:event];
|
[super sendEvent:event];
|
||||||
|
|
||||||
NSEventType event_type = [event type];
|
NSEventType event_type = event.type;
|
||||||
|
|
||||||
if (event_type == NSKeyDown || event_type == NSKeyUp)
|
if (event_type == NSKeyDown || event_type == NSKeyUp)
|
||||||
{
|
{
|
||||||
NSString* ch = [event characters];
|
NSString* ch = (NSString*)event.characters;
|
||||||
|
|
||||||
if (!ch || [ch length] == 0)
|
if (!ch || ch.length == 0)
|
||||||
apple_input_keyboard_event(event_type == NSKeyDown, [event keyCode], 0, 0);
|
apple_input_keyboard_event(event_type == NSKeyDown, event.keyCode, 0, 0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
apple_input_keyboard_event(event_type == NSKeyDown, [event keyCode], [ch characterAtIndex:0], [event modifierFlags]);
|
apple_input_keyboard_event(event_type == NSKeyDown, event.keyCode, [ch characterAtIndex:0], event.modifierFlags);
|
||||||
|
|
||||||
for (unsigned i = 1; i != [ch length]; i ++)
|
for (unsigned i = 1; i != ch.length; i ++)
|
||||||
apple_input_keyboard_event(event_type == NSKeyDown, 0, [ch characterAtIndex:i], [event modifierFlags]);
|
apple_input_keyboard_event(event_type == NSKeyDown, 0, [ch characterAtIndex:i], event.modifierFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event_type == NSFlagsChanged)
|
else if (event_type == NSFlagsChanged)
|
||||||
|
@ -57,14 +57,14 @@ static void* const associated_core_key = (void*)&associated_core_key;
|
||||||
bool down = (new_flags & old_flags) == old_flags;
|
bool down = (new_flags & old_flags) == old_flags;
|
||||||
old_flags = new_flags;
|
old_flags = new_flags;
|
||||||
|
|
||||||
apple_input_keyboard_event(down, [event keyCode], 0, [event modifierFlags]);
|
apple_input_keyboard_event(down, event.keyCode, 0, event.modifierFlags);
|
||||||
}
|
}
|
||||||
else if (event_type == NSMouseMoved || event_type == NSLeftMouseDragged ||
|
else if (event_type == NSMouseMoved || event_type == NSLeftMouseDragged ||
|
||||||
event_type == NSRightMouseDragged || event_type == NSOtherMouseDragged)
|
event_type == NSRightMouseDragged || event_type == NSOtherMouseDragged)
|
||||||
{
|
{
|
||||||
// Relative
|
// Relative
|
||||||
g_current_input_data.mouse_delta[0] += [event deltaX];
|
g_current_input_data.mouse_delta[0] += event.deltaX;
|
||||||
g_current_input_data.mouse_delta[1] += [event deltaY];
|
g_current_input_data.mouse_delta[1] += event.deltaY;
|
||||||
|
|
||||||
// Absolute
|
// Absolute
|
||||||
NSPoint pos = [[RAGameView get] convertPoint:[event locationInWindow] fromView:nil];
|
NSPoint pos = [[RAGameView get] convertPoint:[event locationInWindow] fromView:nil];
|
||||||
|
@ -73,12 +73,12 @@ static void* const associated_core_key = (void*)&associated_core_key;
|
||||||
}
|
}
|
||||||
else if (event_type == NSLeftMouseDown || event_type == NSRightMouseDown || event_type == NSOtherMouseDown)
|
else if (event_type == NSLeftMouseDown || event_type == NSRightMouseDown || event_type == NSOtherMouseDown)
|
||||||
{
|
{
|
||||||
g_current_input_data.mouse_buttons |= 1 << [event buttonNumber];
|
g_current_input_data.mouse_buttons |= 1 << event.buttonNumber;
|
||||||
g_current_input_data.touch_count = 1;
|
g_current_input_data.touch_count = 1;
|
||||||
}
|
}
|
||||||
else if (event_type == NSLeftMouseUp || event_type == NSRightMouseUp || event_type == NSOtherMouseUp)
|
else if (event_type == NSLeftMouseUp || event_type == NSRightMouseUp || event_type == NSOtherMouseUp)
|
||||||
{
|
{
|
||||||
g_current_input_data.mouse_buttons &= ~(1 << [event buttonNumber]);
|
g_current_input_data.mouse_buttons &= ~(1 << event.buttonNumber);
|
||||||
g_current_input_data.touch_count = 0;
|
g_current_input_data.touch_count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,8 +129,8 @@ static char** waiting_argv;
|
||||||
apple_platform = self;
|
apple_platform = self;
|
||||||
_loaded = true;
|
_loaded = true;
|
||||||
|
|
||||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
|
NSArray* paths = (NSArray*)NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
|
||||||
self.configDirectory = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"RetroArch"];
|
self.configDirectory = [[paths objectAtIndex:0] stringByAppendingPathComponent:BOXSTRING("RetroArch")];
|
||||||
self.globalConfigFile = [NSString stringWithFormat:@"%@/retroarch.cfg", self.configDirectory];
|
self.globalConfigFile = [NSString stringWithFormat:@"%@/retroarch.cfg", self.configDirectory];
|
||||||
self.coreDirectory = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Contents/Resources/modules"];
|
self.coreDirectory = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Contents/Resources/modules"];
|
||||||
|
|
||||||
|
@ -152,12 +152,13 @@ static char** waiting_argv;
|
||||||
// Create core select list
|
// Create core select list
|
||||||
NSComboBox* cb = (NSComboBox*)[[self.coreSelectSheet contentView] viewWithTag:1];
|
NSComboBox* cb = (NSComboBox*)[[self.coreSelectSheet contentView] viewWithTag:1];
|
||||||
|
|
||||||
apple_core_info_set_core_path([self.coreDirectory UTF8String]);
|
apple_core_info_set_core_path(self.coreDirectory.UTF8String);
|
||||||
apple_core_info_set_config_path([self.configDirectory UTF8String]);
|
apple_core_info_set_config_path(self.configDirectory.UTF8String);
|
||||||
const core_info_list_t* cores = apple_core_info_list_get();
|
const core_info_list_t* cores = (const core_info_list_t*)apple_core_info_list_get();
|
||||||
|
|
||||||
for (int i = 0; cores && i != cores->count; i ++)
|
for (int i = 0; cores && i != cores->count; i ++)
|
||||||
{
|
{
|
||||||
NSString* desc = BOXSTRING(cores->list[i].display_name);
|
NSString* desc = (NSString*)BOXSTRING(cores->list[i].display_name);
|
||||||
#if defined(MAC_OS_X_VERSION_10_6)
|
#if defined(MAC_OS_X_VERSION_10_6)
|
||||||
/* FIXME - Rewrite this so that this is no longer an associated object - requires ObjC 2.0 runtime */
|
/* FIXME - Rewrite this so that this is no longer an associated object - requires ObjC 2.0 runtime */
|
||||||
objc_setAssociatedObject(desc, associated_core_key, apple_get_core_id(&cores->list[i]), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
objc_setAssociatedObject(desc, associated_core_key, apple_get_core_id(&cores->list[i]), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||||
|
@ -165,7 +166,7 @@ static char** waiting_argv;
|
||||||
[cb addItemWithObjectValue:desc];
|
[cb addItemWithObjectValue:desc];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([cb numberOfItems])
|
if (cb.numberOfItems)
|
||||||
[cb selectItemAtIndex:0];
|
[cb selectItemAtIndex:0];
|
||||||
else
|
else
|
||||||
apple_display_alert(BOXSTRING("No libretro cores were found.\nSelect \"Go->Cores Directory\" from the menu and place libretro dylib files there."), BOXSTRING("RetroArch"));
|
apple_display_alert(BOXSTRING("No libretro cores were found.\nSelect \"Go->Cores Directory\" from the menu and place libretro dylib files there."), BOXSTRING("RetroArch"));
|
||||||
|
@ -233,9 +234,10 @@ static char** waiting_argv;
|
||||||
{
|
{
|
||||||
[[NSApplication sharedApplication] stopModal];
|
[[NSApplication sharedApplication] stopModal];
|
||||||
|
|
||||||
if (result == NSOKButton && [panel URL])
|
if (result == NSOKButton && panel.URL)
|
||||||
{
|
{
|
||||||
self.file = [[panel URL] path];
|
NSURL *url = (NSURL*)panel.URL;
|
||||||
|
self.file = url.path;
|
||||||
[self performSelector:@selector(chooseCore) withObject:nil afterDelay:.5f];
|
[self performSelector:@selector(chooseCore) withObject:nil afterDelay:.5f];
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
@ -251,7 +253,7 @@ static char** waiting_argv;
|
||||||
_wantReload = apple_is_running;
|
_wantReload = apple_is_running;
|
||||||
|
|
||||||
if (!apple_is_running)
|
if (!apple_is_running)
|
||||||
apple_run_core(self.core, [self.file UTF8String]);
|
apple_run_core(self.core, self.file.UTF8String);
|
||||||
else
|
else
|
||||||
apple_event_basic_command(QUIT);
|
apple_event_basic_command(QUIT);
|
||||||
}
|
}
|
||||||
|
@ -293,7 +295,7 @@ static char** waiting_argv;
|
||||||
[[NSApplication sharedApplication] terminate:nil];
|
[[NSApplication sharedApplication] terminate:nil];
|
||||||
|
|
||||||
if (_wantReload)
|
if (_wantReload)
|
||||||
apple_run_core(self.core, [self.file UTF8String]);
|
apple_run_core(self.core, self.file.UTF8String);
|
||||||
else if(apple_use_tv_mode)
|
else if(apple_use_tv_mode)
|
||||||
apple_run_core(nil, 0);
|
apple_run_core(nil, 0);
|
||||||
else
|
else
|
||||||
|
|
|
@ -144,7 +144,7 @@ NSWindowDelegate>
|
||||||
|
|
||||||
setting_data_load_current();
|
setting_data_load_current();
|
||||||
|
|
||||||
const rarch_setting_t* setting_data = setting_data_get_list();
|
const rarch_setting_t *setting_data = (const rarch_setting_t *)setting_data_get_list();
|
||||||
|
|
||||||
for (int i = 0; setting_data[i].type; i ++)
|
for (int i = 0; setting_data[i].type; i ++)
|
||||||
{
|
{
|
||||||
|
@ -264,11 +264,11 @@ NSWindowDelegate>
|
||||||
{
|
{
|
||||||
#ifdef MAC_OS_X_VERSION_10_6
|
#ifdef MAC_OS_X_VERSION_10_6
|
||||||
/* FIXME - Rewrite this so that this is no longer an associated object - requires ObjC 2.0 runtime */
|
/* FIXME - Rewrite this so that this is no longer an associated object - requires ObjC 2.0 runtime */
|
||||||
if ([[tableColumn identifier] isEqualToString:@"left"])
|
if ([[tableColumn identifier] isEqualToString:BOXSTRING("left")])
|
||||||
return objc_getAssociatedObject(item, associated_name_tag);
|
return objc_getAssociatedObject(item, associated_name_tag);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
return @"";
|
return BOXSTRING("");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -276,7 +276,7 @@ NSWindowDelegate>
|
||||||
const rarch_setting_t* setting = &setting_data[[item intValue]];
|
const rarch_setting_t* setting = &setting_data[[item intValue]];
|
||||||
char buffer[PATH_MAX];
|
char buffer[PATH_MAX];
|
||||||
|
|
||||||
if ([[tableColumn identifier] isEqualToString:@"left"])
|
if ([[tableColumn identifier] isEqualToString:BOXSTRING("left")])
|
||||||
return BOXSTRING(setting->short_description);
|
return BOXSTRING(setting->short_description);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -297,17 +297,20 @@ NSWindowDelegate>
|
||||||
if ([item isKindOfClass:[NSArray class]])
|
if ([item isKindOfClass:[NSArray class]])
|
||||||
return [tableColumn dataCell];
|
return [tableColumn dataCell];
|
||||||
|
|
||||||
if ([[tableColumn identifier] isEqualToString:@"left"])
|
if ([[tableColumn identifier] isEqualToString:BOXSTRING("left")])
|
||||||
return [tableColumn dataCell];
|
return [tableColumn dataCell];
|
||||||
|
|
||||||
const rarch_setting_t* setting_data = setting_data_get_list();
|
const rarch_setting_t* setting_data = (const rarch_setting_t *)setting_data_get_list();
|
||||||
const rarch_setting_t* setting = &setting_data[[item intValue]];
|
const rarch_setting_t* setting = (const rarch_setting_t *)&setting_data[[item intValue]];
|
||||||
|
|
||||||
switch (setting->type)
|
switch (setting->type)
|
||||||
{
|
{
|
||||||
case ST_BOOL: return self.booleanCell;
|
case ST_BOOL:
|
||||||
case ST_BIND: return self.binderCell;
|
return self.booleanCell;
|
||||||
default: return [tableColumn dataCell];
|
case ST_BIND:
|
||||||
|
return self.binderCell;
|
||||||
|
default:
|
||||||
|
return tableColumn.dataCell;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,14 +322,19 @@ NSWindowDelegate>
|
||||||
|
|
||||||
if ([item isKindOfClass:[NSNumber class]])
|
if ([item isKindOfClass:[NSNumber class]])
|
||||||
{
|
{
|
||||||
const rarch_setting_t* setting_data = setting_data_get_list();
|
const rarch_setting_t* setting_data = (const rarch_setting_t*)setting_data_get_list();
|
||||||
const rarch_setting_t* setting = &setting_data[[item intValue]];
|
const rarch_setting_t* setting = (const rarch_setting_t*)&setting_data[[item intValue]];
|
||||||
|
|
||||||
switch (setting->type)
|
switch (setting->type)
|
||||||
{
|
{
|
||||||
case ST_BOOL: *setting->value.boolean = !*setting->value.boolean; return;
|
case ST_BOOL:
|
||||||
case ST_BIND: [self.binderWindow runForSetting:setting onWindow:[self.outline window]]; return;
|
*setting->value.boolean = !*setting->value.boolean;
|
||||||
default: return;
|
break;
|
||||||
|
case ST_BIND:
|
||||||
|
[self.binderWindow runForSetting:setting onWindow:[self.outline window]];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -336,16 +344,17 @@ NSWindowDelegate>
|
||||||
{
|
{
|
||||||
if ([notification object] == self.outline)
|
if ([notification object] == self.outline)
|
||||||
{
|
{
|
||||||
NSText* editor = [[notification userInfo] objectForKey:@"NSFieldEditor"];
|
NSText* editor = [[notification userInfo] objectForKey:BOXSTRING("NSFieldEditor")];
|
||||||
|
|
||||||
id item = [self.outline itemAtRow:[self.outline selectedRow]];
|
id item = [self.outline itemAtRow:[self.outline selectedRow]];
|
||||||
|
|
||||||
if ([item isKindOfClass:[NSNumber class]])
|
if ([item isKindOfClass:[NSNumber class]])
|
||||||
{
|
{
|
||||||
const rarch_setting_t* setting_data = setting_data_get_list();
|
const rarch_setting_t* setting_data = (const rarch_setting_t *)setting_data_get_list();
|
||||||
const rarch_setting_t* setting = &setting_data[[item intValue]];
|
const rarch_setting_t* setting = (const rarch_setting_t*)&setting_data[[item intValue]];
|
||||||
|
NSString *editor_string = (NSString*)editor.string;
|
||||||
|
|
||||||
setting_data_set_with_string_representation(setting, [editor.string UTF8String]);
|
setting_data_set_with_string_representation(setting, editor_string.UTF8String);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,15 +35,15 @@ void apple_core_info_set_config_path(const char* config_path)
|
||||||
*core_config_path = '\0';
|
*core_config_path = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
core_info_list_t* apple_core_info_list_get(void)
|
core_info_list_t *apple_core_info_list_get(void)
|
||||||
{
|
{
|
||||||
if (!global_core_list)
|
if (!global_core_list)
|
||||||
RARCH_WARN("apple_core_info_list_get() called before apple_core_info_set_core_path()");
|
RARCH_WARN("core_info_list_get() called before core_info_set_core_path()");
|
||||||
|
|
||||||
return global_core_list;
|
return global_core_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
const core_info_t* apple_core_info_list_get_by_id(const char* core_id)
|
const core_info_t *apple_core_info_list_get_by_id(const char* core_id)
|
||||||
{
|
{
|
||||||
if (core_id)
|
if (core_id)
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ const core_info_t* apple_core_info_list_get_by_id(const char* core_id)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* apple_core_info_get_id(const core_info_t* info, char* buffer, size_t buffer_length)
|
const char *apple_core_info_get_id(const core_info_t* info, char* buffer, size_t buffer_length)
|
||||||
{
|
{
|
||||||
if (!buffer || !buffer_length)
|
if (!buffer || !buffer_length)
|
||||||
return "";
|
return "";
|
||||||
|
@ -69,7 +69,7 @@ const char* apple_core_info_get_id(const core_info_t* info, char* buffer, size_t
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* apple_core_info_get_custom_config(const char* core_id, char* buffer, size_t buffer_length)
|
const char *apple_core_info_get_custom_config(const char* core_id, char* buffer, size_t buffer_length)
|
||||||
{
|
{
|
||||||
if (!core_id || !buffer || !buffer_length)
|
if (!core_id || !buffer || !buffer_length)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -81,10 +81,10 @@ const char* apple_core_info_get_custom_config(const char* core_id, char* buffer,
|
||||||
|
|
||||||
bool apple_core_info_has_custom_config(const char* core_id)
|
bool apple_core_info_has_custom_config(const char* core_id)
|
||||||
{
|
{
|
||||||
|
char path[PATH_MAX];
|
||||||
if (!core_id)
|
if (!core_id)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char path[PATH_MAX];
|
|
||||||
apple_core_info_get_custom_config(core_id, path, sizeof(path));
|
apple_core_info_get_custom_config(core_id, path, sizeof(path));
|
||||||
return path_file_exists(path);
|
return path_file_exists(path);
|
||||||
}
|
}
|
||||||
|
@ -94,19 +94,28 @@ const char* apple_rom_history_get_path(rom_history_t* history, uint32_t index)
|
||||||
{
|
{
|
||||||
const char *path, *core_path, *core_name;
|
const char *path, *core_path, *core_name;
|
||||||
rom_history_get_index(history, index, &path, &core_path, &core_name);
|
rom_history_get_index(history, index, &path, &core_path, &core_name);
|
||||||
return path ? path : "";
|
|
||||||
|
if (path)
|
||||||
|
return path;
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* apple_rom_history_get_core_path(rom_history_t* history, uint32_t index)
|
const char *apple_rom_history_get_core_path(rom_history_t* history, uint32_t index)
|
||||||
{
|
{
|
||||||
const char *path, *core_path, *core_name;
|
const char *path, *core_path, *core_name;
|
||||||
rom_history_get_index(history, index, &path, &core_path, &core_name);
|
rom_history_get_index(history, index, &path, &core_path, &core_name);
|
||||||
return core_path ? core_path : "";
|
|
||||||
|
if (core_path)
|
||||||
|
return core_path;
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* apple_rom_history_get_core_name(rom_history_t* history, uint32_t index)
|
const char *apple_rom_history_get_core_name(rom_history_t* history, uint32_t index)
|
||||||
{
|
{
|
||||||
const char *path, *core_path, *core_name;
|
const char *path, *core_path, *core_name;
|
||||||
rom_history_get_index(history, index, &path, &core_path, &core_name);
|
rom_history_get_index(history, index, &path, &core_path, &core_name);
|
||||||
return core_name ? core_name : "";
|
|
||||||
|
if (core_name)
|
||||||
|
return core_name;
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,16 +24,16 @@
|
||||||
void apple_display_alert(NSString* message, NSString* title)
|
void apple_display_alert(NSString* message, NSString* title)
|
||||||
{
|
{
|
||||||
#ifdef IOS
|
#ifdef IOS
|
||||||
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:title ? title : @"RetroArch"
|
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:title ? title : BOXSTRING("RetroArch")
|
||||||
message:message
|
message:message
|
||||||
delegate:nil
|
delegate:nil
|
||||||
cancelButtonTitle:@"OK"
|
cancelButtonTitle:BOXSTRING("OK")
|
||||||
otherButtonTitles:nil];
|
otherButtonTitles:nil];
|
||||||
[alert show];
|
[alert show];
|
||||||
#else
|
#else
|
||||||
NSAlert* alert = [[NSAlert new] autorelease];
|
NSAlert* alert = [[NSAlert new] autorelease];
|
||||||
|
|
||||||
[alert setMessageText:title ? title : @"RetroArch"];
|
[alert setMessageText:title ? title : BOXSTRING("RetroArch")];
|
||||||
[alert setInformativeText:message];
|
[alert setInformativeText:message];
|
||||||
[alert setAlertStyle:NSInformationalAlertStyle];
|
[alert setAlertStyle:NSInformationalAlertStyle];
|
||||||
[alert beginSheetModalForWindow:[RetroArch_OSX get].window
|
[alert beginSheetModalForWindow:[RetroArch_OSX get].window
|
||||||
|
@ -91,14 +91,14 @@ NSString *apple_get_core_display_name(NSString *core_id)
|
||||||
{
|
{
|
||||||
bool hasDot = false;
|
bool hasDot = false;
|
||||||
|
|
||||||
if ([partialString length])
|
if (partialString.length)
|
||||||
for (int i = 0; i != [partialString length]; i ++)
|
for (int i = 0; i < partialString.length; i ++)
|
||||||
{
|
{
|
||||||
unichar ch = [partialString characterAtIndex:i];
|
unichar ch = [partialString characterAtIndex:i];
|
||||||
|
|
||||||
if (i == 0 && (![self minimum] || [[self minimum] intValue] < 0) && ch == '-')
|
if (i == 0 && (!self.minimum || [[self minimum] intValue] < 0) && ch == '-')
|
||||||
continue;
|
continue;
|
||||||
else if ([self allowsFloats] && !hasDot && ch == '.')
|
else if (self.allowsFloats && !hasDot && ch == '.')
|
||||||
hasDot = true;
|
hasDot = true;
|
||||||
else if (!isdigit(ch))
|
else if (!isdigit(ch))
|
||||||
return NO;
|
return NO;
|
||||||
|
|
Loading…
Reference in New Issue