Skip to content

Commit

Permalink
ref: remove some dead code (#2864)
Browse files Browse the repository at this point in the history
  • Loading branch information
armcknight authored Apr 7, 2023
1 parent e1eed6b commit e681215
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 87 deletions.
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
23 changes: 0 additions & 23 deletions Sources/SentryCrash/Reporting/Filters/Tools/SentryCrashVarArgs.h
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; \
} \
}); \
}

0 comments on commit e681215

Please sign in to comment.