ObjFW  Diff

Differences From Artifact [bbca96f8b9]:

To Artifact [d98652159e]:


744
745
746
747
748
749
750

751
752
753

754
755
756
757
758
759
760
761
			type = OF_NUMBER_UINTMAX;
			value.uintmax = [[element stringValue] decimalValue];
		} else if ([typeString isEqual: @"signed"]) {
			type = OF_NUMBER_INTMAX;
			value.intmax = [[element stringValue] decimalValue];
		} else if ([typeString isEqual: @"float"]) {
			type = OF_NUMBER_FLOAT;

			value.float_ = [[element stringValue] floatValue];
		} else if ([typeString isEqual: @"double"]) {
			type = OF_NUMBER_DOUBLE;

			value.double_ = [[element stringValue] doubleValue];
		} else
			@throw [OFInvalidArgumentException newWithClass: isa
							       selector: _cmd];

		[pool release];
	} @catch (id e) {
		[self release];







>
|


>
|







744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
			type = OF_NUMBER_UINTMAX;
			value.uintmax = [[element stringValue] decimalValue];
		} else if ([typeString isEqual: @"signed"]) {
			type = OF_NUMBER_INTMAX;
			value.intmax = [[element stringValue] decimalValue];
		} else if ([typeString isEqual: @"float"]) {
			type = OF_NUMBER_FLOAT;
			*(uint32_t*)&value.float_ =
			    (uint32_t)[[element stringValue] hexadecimalValue];
		} else if ([typeString isEqual: @"double"]) {
			type = OF_NUMBER_DOUBLE;
			*(uint64_t*)&value.double_ =
			    (uint64_t)[[element stringValue] hexadecimalValue];
		} else
			@throw [OFInvalidArgumentException newWithClass: isa
							       selector: _cmd];

		[pool release];
	} @catch (id e) {
		[self release];
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214



1215
1216
1217
1218



1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
	case OF_NUMBER_INT8:
	case OF_NUMBER_INT16:
	case OF_NUMBER_INT32:
	case OF_NUMBER_INT64:
	case OF_NUMBER_SSIZE:
	case OF_NUMBER_INTMAX:
	case OF_NUMBER_PTRDIFF:
	case OF_NUMBER_INTPTR:
		[element addAttributeWithName: @"type"
				  stringValue: @"signed"];
		break;
	case OF_NUMBER_FLOAT:
		[element addAttributeWithName: @"type"
				  stringValue: @"float"];



		break;
	case OF_NUMBER_DOUBLE:
		[element addAttributeWithName: @"type"
				  stringValue: @"double"];



		break;
	default:
		@throw [OFInvalidFormatException newWithClass: isa];
	}

	[pool release];

	return element;
}
@end







|






>
>
>




>
>
>










1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
	case OF_NUMBER_INT8:
	case OF_NUMBER_INT16:
	case OF_NUMBER_INT32:
	case OF_NUMBER_INT64:
	case OF_NUMBER_SSIZE:
	case OF_NUMBER_INTMAX:
	case OF_NUMBER_PTRDIFF:
	case OF_NUMBER_INTPTR:;
		[element addAttributeWithName: @"type"
				  stringValue: @"signed"];
		break;
	case OF_NUMBER_FLOAT:
		[element addAttributeWithName: @"type"
				  stringValue: @"float"];
		[element setStringValue:
		    [OFString stringWithFormat: @"%" PRIX32,
						*(uint32_t*)&value.float_]];
		break;
	case OF_NUMBER_DOUBLE:
		[element addAttributeWithName: @"type"
				  stringValue: @"double"];
		[element setStringValue:
		    [OFString stringWithFormat: @"%" PRIX64,
						*(uint64_t*)&value.double_]];
		break;
	default:
		@throw [OFInvalidFormatException newWithClass: isa];
	}

	[pool release];

	return element;
}
@end