From 0b251e28075eba2685efd30a18f8d1df915f5647 Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Wed, 26 Aug 2020 12:16:11 -0400 Subject: [PATCH] fix(ios): modify BOOL to bool for return types to fix JS representation --- iphone/Classes/AnalyticsModule.h | 2 +- iphone/Classes/AnalyticsModule.m | 9 +++---- iphone/Classes/FilesystemModule.h | 2 +- iphone/Classes/FilesystemModule.m | 2 +- iphone/Classes/GeolocationModule.h | 18 +++++++------- iphone/Classes/GeolocationModule.m | 24 +++++++++---------- iphone/Classes/GestureModule.h | 4 ++-- iphone/Classes/GestureModule.m | 8 +++---- iphone/Classes/PlatformModule.h | 10 ++++---- iphone/Classes/PlatformModule.m | 18 +++++++------- iphone/Classes/TiCalendarAttendee.h | 2 +- iphone/Classes/TiCalendarAttendee.m | 4 ++-- iphone/Classes/TiCalendarCalendar.h | 2 +- iphone/Classes/TiCalendarCalendar.m | 4 ++-- iphone/Classes/TiCalendarEvent.h | 12 +++++----- iphone/Classes/TiCalendarEvent.m | 20 ++++++++-------- iphone/Classes/TiDatabaseResultSetProxy.h | 6 ++--- iphone/Classes/TiDatabaseResultSetProxy.m | 8 +++---- iphone/Classes/TiNetworkBonjourServiceProxy.h | 2 +- iphone/Classes/TiNetworkBonjourServiceProxy.m | 6 ++--- 20 files changed, 82 insertions(+), 81 deletions(-) diff --git a/iphone/Classes/AnalyticsModule.h b/iphone/Classes/AnalyticsModule.h index d184599cc20..af052b9f290 100644 --- a/iphone/Classes/AnalyticsModule.h +++ b/iphone/Classes/AnalyticsModule.h @@ -12,7 +12,7 @@ // Properties (and accessors) READONLY_PROPERTY(NSString *, lastEvent, LastEvent); -PROPERTY(BOOL, optedOut, OptedOut); +PROPERTY(bool, optedOut, OptedOut); // Methods JSExportAs(featureEvent, diff --git a/iphone/Classes/AnalyticsModule.m b/iphone/Classes/AnalyticsModule.m index f88996fa9be..f5cbceb5473 100644 --- a/iphone/Classes/AnalyticsModule.m +++ b/iphone/Classes/AnalyticsModule.m @@ -9,6 +9,7 @@ @import TitaniumKit.APSAnalytics; @import TitaniumKit.TiBase; @import TitaniumKit.TiUtils; +#import extern BOOL const TI_APPLICATION_ANALYTICS; static NSMutableArray *_filteredEvents; @@ -111,17 +112,17 @@ - (void)filterEvents:(NSArray *)events } } -- (void)setOptedOut:(BOOL)optedOut +- (void)setOptedOut:(bool)optedOut { [[APSAnalytics sharedInstance] setOptedOut:optedOut]; } -- (BOOL)optedOut +- (bool)optedOut { - return [[APSAnalytics sharedInstance] isOptedOut]; + return [APSAnalytics.sharedInstance isOptedOut]; } -READWRITE_IMPL(BOOL, optedOut, OptedOut); +READWRITE_IMPL(bool, optedOut, OptedOut); + (BOOL)isEventFiltered:(NSString *)eventName { diff --git a/iphone/Classes/FilesystemModule.h b/iphone/Classes/FilesystemModule.h index a988900857e..2b610278c10 100644 --- a/iphone/Classes/FilesystemModule.h +++ b/iphone/Classes/FilesystemModule.h @@ -43,7 +43,7 @@ READONLY_PROPERTY(NSString *, tempDirectory, TempDirectory); // TODO: Change JSValue* to TiFile* once TiFile is migrated // Note that this accepts varargs, which we handle special in impl - (JSValue *)getFile; -- (BOOL)isExternalStoragePresent; +- (bool)isExternalStoragePresent; // TODO: Change JSValue* to TiFile* once TiFile is migrated // Note that this accepts varargs, which we handle special in impl - (JSValue *)openStream:(TiStreamMode)mode; diff --git a/iphone/Classes/FilesystemModule.m b/iphone/Classes/FilesystemModule.m index bda7dcb8a8b..996e9053f11 100644 --- a/iphone/Classes/FilesystemModule.m +++ b/iphone/Classes/FilesystemModule.m @@ -109,7 +109,7 @@ - (TiStreamMode)MODE_WRITE return TI_WRITE; } -- (BOOL)isExternalStoragePresent +- (bool)isExternalStoragePresent { //IOS treats the camera connection kit as just that, and does not allow //R/W access to it, which is just as well as it'd mess up cameras. diff --git a/iphone/Classes/GeolocationModule.h b/iphone/Classes/GeolocationModule.h index a7c7b892832..49ce55c2f0b 100644 --- a/iphone/Classes/GeolocationModule.h +++ b/iphone/Classes/GeolocationModule.h @@ -55,17 +55,17 @@ CONSTANT(NSNumber *, ERROR_REGION_MONITORING_FAILURE); // Properties PROPERTY(CLLocationAccuracy, accuracy, Accuracy); PROPERTY(CLActivityType, activityType, ActivityType); -PROPERTY(BOOL, allowsBackgroundLocationUpdates, AllowsBackgroundLocationUpdates); +PROPERTY(bool, allowsBackgroundLocationUpdates, AllowsBackgroundLocationUpdates); PROPERTY(CLLocationDistance, distanceFilter, DistanceFilter); -READONLY_PROPERTY(BOOL, hasCompass, HasCompass); +READONLY_PROPERTY(bool, hasCompass, HasCompass); PROPERTY(CLLocationDegrees, headingFilter, HeadingFilter); READONLY_PROPERTY(NSString *, lastGeolocation, LastGeolocation); READONLY_PROPERTY(CLAuthorizationStatus, locationServicesAuthorization, LocationServicesAuthorization); -READONLY_PROPERTY(BOOL, locationServicesEnabled, LocationServicesEnabled); -PROPERTY(BOOL, pauseLocationUpdateAutomatically, PauseLocationUpdateAutomatically); -PROPERTY(BOOL, showBackgroundLocationIndicator, ShowBackgroundLocationIndicator); -PROPERTY(BOOL, showCalibration, ShowCalibration); -PROPERTY(BOOL, trackSignificantLocationChange, TrackSignificantLocationChange); +READONLY_PROPERTY(bool, locationServicesEnabled, LocationServicesEnabled); +PROPERTY(bool, pauseLocationUpdateAutomatically, PauseLocationUpdateAutomatically); +PROPERTY(bool, showBackgroundLocationIndicator, ShowBackgroundLocationIndicator); +PROPERTY(bool, showCalibration, ShowCalibration); +PROPERTY(bool, trackSignificantLocationChange, TrackSignificantLocationChange); // methods JSExportAs(forwardGeocoder, @@ -74,7 +74,7 @@ JSExportAs(forwardGeocoder, : (JSValue *)callback); - (void)getCurrentHeading:(JSValue *)callback; - (void)getCurrentPosition:(JSValue *)callback; -- (BOOL)hasLocationPermissions:(CLAuthorizationStatus)authorizationType; +- (bool)hasLocationPermissions:(CLAuthorizationStatus)authorizationType; JSExportAs(requestLocationPermissions, -(void)requestLocationPermissions : (CLAuthorizationStatus)authorizationType withCallback @@ -101,7 +101,7 @@ JSExportAs(reverseGeocoder, BOOL trackingHeading; BOOL trackingLocation; BOOL trackSignificantLocationChange; - BOOL allowsBackgroundLocationUpdates; + bool allowsBackgroundLocationUpdates; BOOL showBackgroundLocationIndicator; JSManagedValue *authorizationCallback; CLAuthorizationStatus requestedAuthorizationStatus; diff --git a/iphone/Classes/GeolocationModule.m b/iphone/Classes/GeolocationModule.m index 19d1d43a6cc..016edbde7bd 100644 --- a/iphone/Classes/GeolocationModule.m +++ b/iphone/Classes/GeolocationModule.m @@ -625,14 +625,14 @@ - (void)setShowBackgroundLocationIndicator:(BOOL)value DebugLog(@"[ERROR] The showBackgroundLocationIndicator property is only available on iOS 11.0+. Ignoring call ..."); } -READWRITE_IMPL(BOOL, showBackgroundLocationIndicator, ShowBackgroundLocationIndicator); +READWRITE_IMPL(bool, showBackgroundLocationIndicator, ShowBackgroundLocationIndicator); -- (BOOL)locationServicesEnabled +- (bool)locationServicesEnabled { return [CLLocationManager locationServicesEnabled]; } -GETTER_IMPL(BOOL, locationServicesEnabled, LocationServicesEnabled); +GETTER_IMPL(bool, locationServicesEnabled, LocationServicesEnabled); - (CLAuthorizationStatus)locationServicesAuthorization { @@ -641,12 +641,12 @@ - (CLAuthorizationStatus)locationServicesAuthorization GETTER_IMPL(CLAuthorizationStatus, locationServicesAuthorization, LocationServicesAuthorization); -- (BOOL)trackSignificantLocationChange +- (bool)trackSignificantLocationChange { return trackSignificantLocationChange; } -- (void)setTrackSignificantLocationChange:(BOOL)newval +- (void)setTrackSignificantLocationChange:(bool)newval { if ([CLLocationManager significantLocationChangeMonitoringAvailable]) { if (newval != trackSignificantLocationChange) { @@ -672,7 +672,7 @@ - (void)setTrackSignificantLocationChange:(BOOL)newval } } -READWRITE_IMPL(BOOL, trackSignificantLocationChange, TrackSignificantLocationChange); +READWRITE_IMPL(bool, trackSignificantLocationChange, TrackSignificantLocationChange); // Activity Type for CLlocationManager. - (CLActivityType)activityType @@ -694,12 +694,12 @@ - (void)setActivityType:(CLActivityType)value // Flag to decide whether or not the app should continue to send location updates while the app is in background. -- (BOOL)pauseLocationUpdateAutomatically +- (bool)pauseLocationUpdateAutomatically { return pauseLocationUpdateAutomatically; } -- (void)setPauseLocationUpdateAutomatically:(BOOL)value +- (void)setPauseLocationUpdateAutomatically:(bool)value { pauseLocationUpdateAutomatically = value; TiThreadPerformOnMainThread( @@ -709,7 +709,7 @@ - (void)setPauseLocationUpdateAutomatically:(BOOL)value NO); } -READWRITE_IMPL(BOOL, pauseLocationUpdateAutomatically, PauseLocationUpdateAutomatically); +READWRITE_IMPL(bool, pauseLocationUpdateAutomatically, PauseLocationUpdateAutomatically); - (void)restart:(id)arg { @@ -766,7 +766,7 @@ - (CLLocationManager *)locationPermissionManager return locationPermissionManager; } -- (BOOL)hasLocationPermissions:(CLAuthorizationStatus)authorizationType +- (bool)hasLocationPermissions:(CLAuthorizationStatus)authorizationType { BOOL locationServicesEnabled = [CLLocationManager locationServicesEnabled]; CLAuthorizationStatus currentPermissionLevel = [CLLocationManager authorizationStatus]; @@ -847,9 +847,9 @@ - (void)requestLocationPermissions:(CLAuthorizationStatus)authorizationType with } } -READWRITE_IMPL(BOOL, allowsBackgroundLocationUpdates, AllowsBackgroundLocationUpdates); +READWRITE_IMPL(bool, allowsBackgroundLocationUpdates, AllowsBackgroundLocationUpdates); GETTER_IMPL(NSString *, lastGeolocation, LastGeolocation); -READWRITE_IMPL(BOOL, showCalibration, ShowCalibration); +READWRITE_IMPL(bool, showCalibration, ShowCalibration); #pragma mark Internal diff --git a/iphone/Classes/GestureModule.h b/iphone/Classes/GestureModule.h index 74dec658797..91e920748d2 100644 --- a/iphone/Classes/GestureModule.h +++ b/iphone/Classes/GestureModule.h @@ -11,9 +11,9 @@ @protocol GestureExports // Properties (and accessors) -READONLY_PROPERTY(BOOL, landscape, Landscape); +READONLY_PROPERTY(bool, landscape, Landscape); READONLY_PROPERTY(NSNumber *, orientation, Orientation); -READONLY_PROPERTY(BOOL, portrait, Portrait); +READONLY_PROPERTY(bool, portrait, Portrait); @end diff --git a/iphone/Classes/GestureModule.m b/iphone/Classes/GestureModule.m index c66472066e3..19f98997244 100644 --- a/iphone/Classes/GestureModule.m +++ b/iphone/Classes/GestureModule.m @@ -100,17 +100,17 @@ - (void)_listenerRemoved:(NSString *)type count:(int)count } } -- (BOOL)landscape +- (bool)landscape { return [TiUtils isOrientationLandscape]; } -GETTER_IMPL(BOOL, landscape, Landscape); +GETTER_IMPL(bool, landscape, Landscape); -- (BOOL)portrait +- (bool)portrait { return [TiUtils isOrientationPortait]; } -GETTER_IMPL(BOOL, portrait, Portrait); +GETTER_IMPL(bool, portrait, Portrait); - (NSNumber *)orientation { diff --git a/iphone/Classes/PlatformModule.h b/iphone/Classes/PlatformModule.h index 1a15ee06d63..9c5ec5da0f2 100644 --- a/iphone/Classes/PlatformModule.h +++ b/iphone/Classes/PlatformModule.h @@ -24,14 +24,14 @@ READONLY_PROPERTY(NSString *, address, Address); READONLY_PROPERTY(NSString *, architecture, Architecture); READONLY_PROPERTY(NSNumber *, availableMemory, AvailableMemory); READONLY_PROPERTY(NSNumber *, batteryLevel, BatteryLevel); -PROPERTY(BOOL, batteryMonitoring, BatteryMonitoring); +PROPERTY(bool, batteryMonitoring, BatteryMonitoring); READONLY_PROPERTY(NSNumber *, batteryState, BatteryState); READONLY_PROPERTY(TiPlatformDisplayCaps *, displayCaps, DisplayCaps); @property (readonly) TiPlatformDisplayCaps *DisplayCaps; READONLY_PROPERTY(NSString *, id, Id); READONLY_PROPERTY(NSString *, identifierForAdvertising, IdentifierForAdvertising); READONLY_PROPERTY(NSString *, identifierForVendor, IdentifierForVendor); -READONLY_PROPERTY(BOOL, isAdvertisingTrackingEnabled, IsAdvertisingTrackingEnabled); +READONLY_PROPERTY(bool, isAdvertisingTrackingEnabled, IsAdvertisingTrackingEnabled); READONLY_PROPERTY(NSString *, locale, Locale); READONLY_PROPERTY(NSString *, macaddress, Macaddress); READONLY_PROPERTY(NSString *, manufacturer, Manufacturer); @@ -51,12 +51,12 @@ READONLY_PROPERTY(NSNumber *, versionMinor, VersionMinor); READONLY_PROPERTY(NSNumber *, versionPatch, VersionPatch); // Methods -- (BOOL)canOpenURL:(NSString *)url; +- (bool)canOpenURL:(NSString *)url; - (NSString *)createUUID; -- (BOOL)is24HourTimeFormat; +- (bool)is24HourTimeFormat; JSExportAs(openURL, - -(BOOL)openURL + -(bool)openURL : (NSString *)url withOptions : (JSValue *)options andCallback : (JSValue *)callback); diff --git a/iphone/Classes/PlatformModule.m b/iphone/Classes/PlatformModule.m index 45080bd6590..93c1fd218af 100644 --- a/iphone/Classes/PlatformModule.m +++ b/iphone/Classes/PlatformModule.m @@ -237,7 +237,7 @@ - (NSString *)identifierForVendor GETTER_IMPL(NSString *, identifierForVendor, IdentifierForVendor); #if defined(USE_TI_PLATFORMIDENTIFIERFORADVERTISING) || defined(USE_TI_PLATFORMGETIDENTIFIERFORADVERTISING) -- (BOOL)isAdvertisingTrackingEnabled +- (bool)isAdvertisingTrackingEnabled { return [[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]; } @@ -247,7 +247,7 @@ - (NSString *)identifierForAdvertising return [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; } #else -- (BOOL)isAdvertisingTrackingEnabled +- (bool)isAdvertisingTrackingEnabled { return NO; } @@ -258,7 +258,7 @@ - (NSString *)identifierForAdvertising } #endif -GETTER_IMPL(BOOL, isAdvertisingTrackingEnabled, IsAdvertisingTrackingEnabled); +GETTER_IMPL(bool, isAdvertisingTrackingEnabled, IsAdvertisingTrackingEnabled); GETTER_IMPL(NSString *, identifierForAdvertising, IdentifierForAdvertising); - (NSString *)id @@ -315,7 +315,7 @@ - (NSNumber *)totalMemory } GETTER_IMPL(NSNumber *, availableMemory, AvailableMemory); -- (BOOL)openURL:(NSString *)url withOptions:(JSValue *)options andCallback:(JSValue *)callback +- (bool)openURL:(NSString *)url withOptions:(JSValue *)options andCallback:(JSValue *)callback { NSURL *newUrl = [TiUtils toURL:url proxy:self]; BOOL result = NO; @@ -343,10 +343,10 @@ - (BOOL)openURL:(NSString *)url withOptions:(JSValue *)options andCallback:(JSVa }]; } - return [NSNumber numberWithBool:result]; + return result; } -- (BOOL)canOpenURL:(NSString *)arg +- (bool)canOpenURL:(NSString *)arg { NSURL *url = [TiUtils toURL:arg proxy:self]; return [[UIApplication sharedApplication] canOpenURL:url]; @@ -362,7 +362,7 @@ - (TiPlatformDisplayCaps *)DisplayCaps return [self displayCaps]; } -- (void)setBatteryMonitoring:(BOOL)yn +- (void)setBatteryMonitoring:(bool)yn { if (![NSThread isMainThread]) { TiThreadPerformOnMainThread( @@ -374,7 +374,7 @@ - (void)setBatteryMonitoring:(BOOL)yn [[UIDevice currentDevice] setBatteryMonitoringEnabled:yn]; } -- (BOOL)batteryMonitoring +- (bool)batteryMonitoring { if (![NSThread isMainThread]) { __block BOOL result = NO; @@ -387,7 +387,7 @@ - (BOOL)batteryMonitoring } return [UIDevice currentDevice].batteryMonitoringEnabled; } -READWRITE_IMPL(BOOL, batteryMonitoring, BatteryMonitoring); +READWRITE_IMPL(bool, batteryMonitoring, BatteryMonitoring); - (NSNumber *)batteryState { diff --git a/iphone/Classes/TiCalendarAttendee.h b/iphone/Classes/TiCalendarAttendee.h index 4bee6fdb7c6..75ab88cfd9a 100644 --- a/iphone/Classes/TiCalendarAttendee.h +++ b/iphone/Classes/TiCalendarAttendee.h @@ -15,7 +15,7 @@ @protocol TiCalendarAttendeeExports READONLY_PROPERTY(NSString *, email, Email); -READONLY_PROPERTY(BOOL, isOrganizer, IsOrganizer); +READONLY_PROPERTY(bool, isOrganizer, IsOrganizer); READONLY_PROPERTY(NSString *, name, Name); READONLY_PROPERTY(EKParticipantRole, role, Role); READONLY_PROPERTY(EKParticipantStatus, status, Status); diff --git a/iphone/Classes/TiCalendarAttendee.m b/iphone/Classes/TiCalendarAttendee.m index 5b9c8c6c01f..4487a975fb3 100644 --- a/iphone/Classes/TiCalendarAttendee.m +++ b/iphone/Classes/TiCalendarAttendee.m @@ -78,11 +78,11 @@ - (EKParticipantStatus)status } GETTER_IMPL(EKParticipantStatus, status, Status); -- (BOOL)isOrganizer +- (bool)isOrganizer { return [[self participant] isCurrentUser]; } -GETTER_IMPL(BOOL, isOrganizer, IsOrganizer); +GETTER_IMPL(bool, isOrganizer, IsOrganizer); @end diff --git a/iphone/Classes/TiCalendarCalendar.h b/iphone/Classes/TiCalendarCalendar.h index d67fc2f0d16..311df14d4b1 100644 --- a/iphone/Classes/TiCalendarCalendar.h +++ b/iphone/Classes/TiCalendarCalendar.h @@ -14,7 +14,7 @@ @protocol TiCalendarCalendarExports // properties (and accessors) -READONLY_PROPERTY(BOOL, hidden, Hidden); +READONLY_PROPERTY(bool, hidden, Hidden); READONLY_PROPERTY(NSString *, id, Id); READONLY_PROPERTY(NSString *, name, Name); //READONLY_PROPERTY(BOOL, selected, Selected); // not implemented on iOS diff --git a/iphone/Classes/TiCalendarCalendar.m b/iphone/Classes/TiCalendarCalendar.m index 92cb964b23e..0e05858b45e 100644 --- a/iphone/Classes/TiCalendarCalendar.m +++ b/iphone/Classes/TiCalendarCalendar.m @@ -179,7 +179,7 @@ - (NSString *)id } GETTER_IMPL(NSString *, id, Id); -- (BOOL)hidden +- (bool)hidden { if (![NSThread isMainThread]) { __block BOOL result; @@ -193,7 +193,7 @@ - (BOOL)hidden return [[self calendar] isImmutable]; } -GETTER_IMPL(BOOL, hidden, Hidden); +GETTER_IMPL(bool, hidden, Hidden); - (NSString *)name { diff --git a/iphone/Classes/TiCalendarEvent.h b/iphone/Classes/TiCalendarEvent.h index c948222d058..4c49fbf417d 100644 --- a/iphone/Classes/TiCalendarEvent.h +++ b/iphone/Classes/TiCalendarEvent.h @@ -18,14 +18,14 @@ @protocol TiCalendarEventExports // properties (and accessors) PROPERTY(NSArray *, alerts, Alerts); -PROPERTY(BOOL, allDay, AllDay); +PROPERTY(bool, allDay, AllDay); READONLY_PROPERTY(NSArray *, attendees, Attendees); PROPERTY(EKEventAvailability, availability, Availability); PROPERTY(NSDate *, begin, Begin); PROPERTY(NSDate *, end, End); -READONLY_PROPERTY(BOOL, hasAlarm, HasAlarm); +READONLY_PROPERTY(bool, hasAlarm, HasAlarm); READONLY_PROPERTY(NSString *, id, Id); -READONLY_PROPERTY(BOOL, isDetached, IsDetached); +READONLY_PROPERTY(bool, isDetached, IsDetached); PROPERTY(NSString *, location, Location); PROPERTY(NSString *, notes, Notes); PROPERTY(NSArray *, recurrenceRules, RecurrenceRules); @@ -36,10 +36,10 @@ PROPERTY(NSString *, title, Title); - (void)addRecurrenceRule:(TiCalendarRecurrenceRule *)rule; - (TiCalendarAlert *)createAlert:(NSDictionary *)properties; - (TiCalendarRecurrenceRule *)createRecurrenceRule:(NSDictionary *)properties; -- (BOOL)refresh; -- (BOOL)remove:(EKSpan)span; +- (bool)refresh; +- (bool)remove:(EKSpan)span; - (void)removeRecurrenceRule:(TiCalendarRecurrenceRule *)rule; -- (BOOL)save:(EKSpan)span; +- (bool)save:(EKSpan)span; @end diff --git a/iphone/Classes/TiCalendarEvent.m b/iphone/Classes/TiCalendarEvent.m index 05eed4e018d..b117ad41c66 100644 --- a/iphone/Classes/TiCalendarEvent.m +++ b/iphone/Classes/TiCalendarEvent.m @@ -133,9 +133,9 @@ -(TYPE)NAME \ return currEvent.PROP_NAME; \ } -EVENT_GETTER_PRIMITIVE(BOOL, allDay, allDay, NO); -EVENT_SETTER(BOOL, AllDay, allDay); -READWRITE_IMPL(BOOL, allDay, AllDay); +EVENT_GETTER_PRIMITIVE(bool, allDay, allDay, NO); +EVENT_SETTER(bool, AllDay, allDay); +READWRITE_IMPL(bool, allDay, AllDay); EVENT_GETTER_PRIMITIVE(EKEventAvailability, availability, availability, EKEventAvailabilityUnavailable); EVENT_SETTER(EKEventAvailability, Availability, availability); @@ -149,14 +149,14 @@ -(TYPE)NAME \ EVENT_SETTER(NSDate *, End, endDate); READWRITE_IMPL(NSDate *, end, End); -EVENT_GETTER_PRIMITIVE(BOOL, hasAlarm, hasAlarms, NO); -GETTER_IMPL(BOOL, hasAlarm, HasAlarm); +EVENT_GETTER_PRIMITIVE(bool, hasAlarm, hasAlarms, NO); +GETTER_IMPL(bool, hasAlarm, HasAlarm); EVENT_GETTER(NSString *, id, eventIdentifier); GETTER_IMPL(NSString *, id, Id); -EVENT_GETTER_PRIMITIVE(BOOL, isDetached, isDetached, NO); -GETTER_IMPL(BOOL, isDetached, IsDetached); +EVENT_GETTER_PRIMITIVE(bool, isDetached, isDetached, NO); +GETTER_IMPL(bool, isDetached, IsDetached); EVENT_GETTER(NSString *, location, location); EVENT_SETTER(NSString *, Location, location); @@ -458,7 +458,7 @@ - (void)removeRecurrenceRule:(TiCalendarRecurrenceRule *)ruleProxy [currEvent removeRecurrenceRule:rule]; } -- (BOOL)save:(EKSpan)span +- (bool)save:(EKSpan)span { if ([[JSContext currentArguments] count] < 1) { span = EKSpanThisEvent; @@ -489,7 +489,7 @@ - (BOOL)save:(EKSpan)span return result; } -- (BOOL)remove:(EKSpan)span +- (bool)remove:(EKSpan)span { if ([[JSContext currentArguments] count] < 1) { span = EKSpanThisEvent; @@ -511,7 +511,7 @@ - (BOOL)remove:(EKSpan)span return result; } -- (BOOL)refresh +- (bool)refresh { __block BOOL result; TiThreadPerformOnMainThread( diff --git a/iphone/Classes/TiDatabaseResultSetProxy.h b/iphone/Classes/TiDatabaseResultSetProxy.h index aa4ddd30085..3e95ed589d6 100644 --- a/iphone/Classes/TiDatabaseResultSetProxy.h +++ b/iphone/Classes/TiDatabaseResultSetProxy.h @@ -16,7 +16,7 @@ // Properties (and accessors) READONLY_PROPERTY(NSInteger, fieldCount, FieldCount); READONLY_PROPERTY(NSInteger, rowCount, RowCount); -READONLY_PROPERTY(BOOL, validRow, ValidRow); +READONLY_PROPERTY(bool, validRow, ValidRow); // Methods - (void)close; @@ -30,8 +30,8 @@ JSExportAs(fieldByName, : (JSValue *)optionalType); - (NSString *)fieldName:(NSInteger)index; - (NSString *)getFieldName:(NSInteger)index; -- (BOOL)isValidRow; -- (BOOL)next; +- (bool)isValidRow; +- (bool)next; @end diff --git a/iphone/Classes/TiDatabaseResultSetProxy.m b/iphone/Classes/TiDatabaseResultSetProxy.m index 26cc6b63e87..02515ec0def 100644 --- a/iphone/Classes/TiDatabaseResultSetProxy.m +++ b/iphone/Classes/TiDatabaseResultSetProxy.m @@ -115,7 +115,7 @@ - (void)close validRow = NO; } -- (BOOL)next +- (bool)next { if (results != nil) { validRow = [results next]; @@ -213,13 +213,13 @@ - (NSInteger)rowCount return 0; } -- (BOOL)validRow +- (bool)validRow { return validRow; } -GETTER_IMPL(BOOL, validRow, ValidRow); +GETTER_IMPL(bool, validRow, ValidRow); -- (BOOL)isValidRow +- (bool)isValidRow { return [self validRow]; } diff --git a/iphone/Classes/TiNetworkBonjourServiceProxy.h b/iphone/Classes/TiNetworkBonjourServiceProxy.h index 5a0359f9802..0e6961301c4 100644 --- a/iphone/Classes/TiNetworkBonjourServiceProxy.h +++ b/iphone/Classes/TiNetworkBonjourServiceProxy.h @@ -18,7 +18,7 @@ @protocol TiNetworkBonjourServiceProxyExports // Properties (and accessors) PROPERTY(NSString *, domain, Domain); -PROPERTY(BOOL, isLocal, IsLocal); +PROPERTY(bool, isLocal, IsLocal); PROPERTY(NSString *, name, Name); PROPERTY(JSValue *, socket, Socket); PROPERTY(NSString *, type, Type); diff --git a/iphone/Classes/TiNetworkBonjourServiceProxy.m b/iphone/Classes/TiNetworkBonjourServiceProxy.m index c0295980ee1..403172096c1 100644 --- a/iphone/Classes/TiNetworkBonjourServiceProxy.m +++ b/iphone/Classes/TiNetworkBonjourServiceProxy.m @@ -183,16 +183,16 @@ - (JSValue *)socket } GETTER_IMPL(JSValue *, socket, Socket); -- (void)setIsLocal:(BOOL)isLocal +- (void)setIsLocal:(bool)isLocal { local = isLocal; } -- (BOOL)isLocal +- (bool)isLocal { return local; } -READWRITE_IMPL(BOOL, isLocal, IsLocal); +READWRITE_IMPL(bool, isLocal, IsLocal); - (NSNetService *)service {