Differences From Artifact [cd6beb50c0]:
- File
src/OFIntrospection.m
— part of check-in
[ef6d69931e]
at
2019-02-07 00:46:41
on branch trunk
— Make style consistent between ObjFW and ObjFW_RT
ObjFW_RT used to be a separate project that followed the BSD style, as
it was written in pure C, while ObjFW's style is based on the BSD style
with changes to make it a better fit for Objective-C. This commit
changes ObjFW_RT to use the same style as ObjFW. (user: js, size: 13284) [annotate] [blame] [check-ins using]
To Artifact [79c1692f33]:
- File src/OFIntrospection.m — part of check-in [bceb7ed4c9] at 2019-03-08 00:35:48 on branch trunk — Use dot syntax (user: js, size: 13260) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
77 78 79 80 81 82 83 | [super dealloc]; } - (OFString *)description { return [OFString stringWithFormat: @"<%@: %@ [%s]>", | | | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | [super dealloc]; } - (OFString *)description { return [OFString stringWithFormat: @"<%@: %@ [%s]>", self.class, _name, _typeEncoding]; } - (bool)isEqual: (id)object { OFMethod *method; if (object == self) |
︙ | ︙ | |||
115 116 117 118 119 120 121 | - (uint32_t)hash { uint32_t hash; OF_HASH_INIT(hash); | | | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | - (uint32_t)hash { uint32_t hash; OF_HASH_INIT(hash); OF_HASH_ADD_HASH(hash, _name.hash); if (_typeEncoding != NULL) { size_t length = strlen(_typeEncoding); for (size_t i = 0; i < length; i++) OF_HASH_ADD(hash, _typeEncoding[i]); } |
︙ | ︙ | |||
175 176 177 178 179 180 181 | const char *attributes; _name = [[OFString alloc] initWithUTF8String: property_getName(property)]; if ((attributes = property_getAttributes(property)) == NULL) @throw [OFInitializationFailedException | | | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | const char *attributes; _name = [[OFString alloc] initWithUTF8String: property_getName(property)]; if ((attributes = property_getAttributes(property)) == NULL) @throw [OFInitializationFailedException exceptionWithClass: self.class]; while (*attributes != '\0') { const char *start; switch (*attributes) { case 'T': while (*attributes != ',' && |
︙ | ︙ | |||
207 208 209 210 211 212 213 | attributes++; break; case 'G': start = ++attributes; if (_getter != nil) @throw [OFInitializationFailedException | | | | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | attributes++; break; case 'G': start = ++attributes; if (_getter != nil) @throw [OFInitializationFailedException exceptionWithClass: self.class]; while (*attributes != ',' && *attributes != '\0') attributes++; _getter = [[OFString alloc] initWithUTF8String: start length: attributes - start]; break; case 'S': start = ++attributes; if (_setter != nil) @throw [OFInitializationFailedException exceptionWithClass: self.class]; while (*attributes != ',' && *attributes != '\0') attributes++; _setter = [[OFString alloc] initWithUTF8String: start |
︙ | ︙ | |||
250 251 252 253 254 255 256 | attributes++; break; case 'V': start = ++attributes; if (_iVar != nil) @throw [OFInitializationFailedException | | | | | 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | attributes++; break; case 'V': start = ++attributes; if (_iVar != nil) @throw [OFInitializationFailedException exceptionWithClass: self.class]; while (*attributes != ',' && *attributes != '\0') attributes++; _iVar = [[OFString alloc] initWithUTF8String: start length: attributes - start]; break; default: @throw [OFInitializationFailedException exceptionWithClass: self.class]; } if (*attributes != ',' && *attributes != '\0') @throw [OFInitializationFailedException exceptionWithClass: self.class]; if (*attributes != '\0') attributes++; } if (!(_attributes & OF_PROPERTY_READONLY)) _attributes |= OF_PROPERTY_READWRITE; |
︙ | ︙ | |||
330 331 332 333 334 335 336 | return [OFString stringWithFormat: @"<%@: %@\n" @"\tAttributes = 0x%03X\n" @"\tGetter = %@\n" @"\tSetter = %@\n" @"\tiVar = %@\n" @">", | | | | 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | return [OFString stringWithFormat: @"<%@: %@\n" @"\tAttributes = 0x%03X\n" @"\tGetter = %@\n" @"\tSetter = %@\n" @"\tiVar = %@\n" @">", self.class, _name, _attributes, _getter, _setter, _iVar]; } - (bool)isEqual: (id)object { OFProperty *otherProperty; if (object == self) |
︙ | ︙ | |||
364 365 366 367 368 369 370 | - (uint32_t)hash { uint32_t hash; OF_HASH_INIT(hash); | | | | | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | - (uint32_t)hash { uint32_t hash; OF_HASH_INIT(hash); OF_HASH_ADD_HASH(hash, _name.hash); OF_HASH_ADD(hash, (_attributes & 0xFF00) >> 8); OF_HASH_ADD(hash, _attributes & 0xFF); OF_HASH_ADD_HASH(hash, _getter.hash); OF_HASH_ADD_HASH(hash, _setter.hash); OF_HASH_FINALIZE(hash); return hash; } @end |
︙ | ︙ |