Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: remove some dead code #2864

Merged
merged 2 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,6 @@

#import "SentryCrashInstallation.h"

/** Implement a property to be used as a "key". */
#define IMPLEMENT_REPORT_KEY_PROPERTY(NAME, NAMEUPPER) \
@synthesize NAME##Key = _##NAME##Key; \
-(void)set##NAMEUPPER##Key : (NSString *)value \
{ \
_##NAME##Key; \
_##NAME##Key = value; \
[self reportFieldForProperty:@ #NAME setKey:value]; \
}

/** Implement a property to be used as a "value". */
#define IMPLEMENT_REPORT_VALUE_PROPERTY(NAME, NAMEUPPER, TYPE) \
@synthesize NAME = _##NAME; \
-(void)set##NAMEUPPER : (TYPE)value \
{ \
_##NAME; \
_##NAME = value; \
[self reportFieldForProperty:@ #NAME setValue:value]; \
}

/** Implement a standard report property (with key and value properties) */
#define IMPLEMENT_REPORT_PROPERTY(NAME, NAMEUPPER, TYPE) \
IMPLEMENT_REPORT_VALUE_PROPERTY(NAME, NAMEUPPER, TYPE) \
IMPLEMENT_REPORT_KEY_PROPERTY(NAME, NAMEUPPER)

typedef struct {
const char *key;
const char *value;
Expand All @@ -72,20 +47,6 @@ SentryCrashInstallation ()
*/
- (id)initWithRequiredProperties:(NSArray *)requiredProperties;

/** Set the key to be used for the specified report property.
*
* @param propertyName The name of the property.
* @param key The key to use.
*/
- (void)reportFieldForProperty:(NSString *)propertyName setKey:(id)key;

/** Set the value of the specified report property.
*
* @param propertyName The name of the property.
* @param value The value to set.
*/
- (void)reportFieldForProperty:(NSString *)propertyName setValue:(id)value;

/** Create a new sink. Subclasses must implement this.
*/
- (id<SentryCrashReportFilter>)sink;
Expand Down
25 changes: 0 additions & 25 deletions Sources/SentryCrash/Installations/SentryCrashInstallation.m
Original file line number Diff line number Diff line change
Expand Up @@ -194,31 +194,6 @@ - (CrashHandlerData *)g_crashHandlerData
return g_crashHandlerData;
}

- (SentryCrashInstReportField *)reportFieldForProperty:(NSString *)propertyName
{
SentryCrashInstReportField *field = [self.fields objectForKey:propertyName];
if (field == nil) {
field = [SentryCrashInstReportField fieldWithIndex:self.nextFieldIndex];
self.nextFieldIndex++;
self.crashHandlerData->reportFieldsCount = self.nextFieldIndex;
self.crashHandlerData->reportFields[field.index] = field.field;
[self.fields setObject:field forKey:propertyName];
}
return field;
}

- (void)reportFieldForProperty:(NSString *)propertyName setKey:(id)key
{
SentryCrashInstReportField *field = [self reportFieldForProperty:propertyName];
field.key = key;
}

- (void)reportFieldForProperty:(NSString *)propertyName setValue:(id)value
{
SentryCrashInstReportField *field = [self reportFieldForProperty:propertyName];
field.value = value;
}

- (NSError *)validateProperties
{
NSMutableString *errors = [NSMutableString string];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,3 @@ typedef void (^SentryCrashVA_Block)(id entry);
#define sentrycrashva_list_to_nsarray(FIRST_ARG_NAME, ARRAY_NAME) \
NSMutableArray *ARRAY_NAME = [NSMutableArray array]; \
sentrycrashva_iterate_list(FIRST_ARG_NAME, ^(id entry) { [ARRAY_NAME addObject:entry]; })

/**
* Convert a variable argument list into a dictionary, interpreting the vararg
* list as object, key, object, key, ...
* An autoreleased NSMutableDictionary will be created in the current scope with
* the specified name.
*
* @param FIRST_ARG_NAME The name of the first argument in the vararg list.
* @param DICT_NAME The name of the dictionary to create in the current scope.
*/
#define sentrycrashva_list_to_nsdictionary(FIRST_ARG_NAME, DICT_NAME) \
NSMutableDictionary *DICT_NAME = [NSMutableDictionary dictionary]; \
{ \
__block id sentrycrashva_object = nil; \
sentrycrashva_iterate_list(FIRST_ARG_NAME, ^(id entry) { \
if (sentrycrashva_object == nil) { \
sentrycrashva_object = entry; \
} else { \
[DICT_NAME setObject:sentrycrashva_object forKey:entry]; \
sentrycrashva_object = nil; \
} \
}); \
}