@@ -22,27 +22,26 @@ @implementation OFDNSResponse @synthesize domainName = _domainName, answerRecords = _answerRecords; @synthesize authorityRecords = _authorityRecords; @synthesize additionalRecords = _additionalRecords; -+ (instancetype) - responseWithDomainName: (OFString *)domainName - answerRecords: (of_dns_response_records_t)answerRecords - authorityRecords: (of_dns_response_records_t)authorityRecords - additionalRecords: (of_dns_response_records_t)additionalRecords ++ (instancetype)responseWithDomainName: (OFString *)domainName + answerRecords: (OFDNSResponseRecords)answerRecords + authorityRecords: (OFDNSResponseRecords)authorityRecords + additionalRecords: (OFDNSResponseRecords)additionalRecords { return [[[self alloc] initWithDomainName: domainName answerRecords: answerRecords authorityRecords: authorityRecords additionalRecords: additionalRecords] autorelease]; } - (instancetype)initWithDomainName: (OFString *)domainName - answerRecords: (of_dns_response_records_t)answerRecords - authorityRecords: (of_dns_response_records_t)authorityRecords - additionalRecords: (of_dns_response_records_t)additionalRecords + answerRecords: (OFDNSResponseRecords)answerRecords + authorityRecords: (OFDNSResponseRecords)authorityRecords + additionalRecords: (OFDNSResponseRecords)additionalRecords { self = [super init]; @try { _domainName = [domainName copy]; @@ -100,18 +99,18 @@ return true; } - (unsigned long)hash { - uint32_t hash; - - OF_HASH_INIT(hash); - OF_HASH_ADD_HASH(hash, _domainName.hash); - OF_HASH_ADD_HASH(hash, [_answerRecords hash]); - OF_HASH_ADD_HASH(hash, [_authorityRecords hash]); - OF_HASH_ADD_HASH(hash, [_additionalRecords hash]); - OF_HASH_FINALIZE(hash); + unsigned long hash; + + OFHashInit(&hash); + OFHashAddHash(&hash, _domainName.hash); + OFHashAddHash(&hash, [_answerRecords hash]); + OFHashAddHash(&hash, [_authorityRecords hash]); + OFHashAddHash(&hash, [_additionalRecords hash]); + OFHashFinalize(&hash); return hash; } - (OFString *)description