ObjFW  Check-in [cd3d4b44c4]

Overview
Comment:Make GCC happy again
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cd3d4b44c47058dee03455517e964e2b45c31437c2432bd5cbdea3e2fe3d6aef
User & Date: js on 2023-08-09 17:02:58
Other Links: manifest | tags
Context
2023-08-09
22:39
OFValue: Improve -[description] check-in: 772e8b8f78 user: js tags: trunk
17:02
Make GCC happy again check-in: cd3d4b44c4 user: js tags: trunk
16:24
OFConcrete{Number,Value}: Copy the type encoding check-in: 723c19a44b user: js tags: trunk
Changes

Modified src/OFConcreteValue.m from [e87397b05a] to [27a3d1dc6b].

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#import "OFConcreteValue.h"
#import "OFMethodSignature.h"
#import "OFString.h"

#import "OFOutOfRangeException.h"

@implementation OFConcreteValue
@synthesize objCType = _objCType;

- (instancetype)initWithBytes: (const void *)bytes
		     objCType: (const char *)objCType
{
	self = [super initWithBytes: bytes objCType: objCType];

	@try {
		_size = OFSizeOfTypeEncoding(objCType);







<
<







16
17
18
19
20
21
22


23
24
25
26
27
28
29
#import "OFConcreteValue.h"
#import "OFMethodSignature.h"
#import "OFString.h"

#import "OFOutOfRangeException.h"

@implementation OFConcreteValue


- (instancetype)initWithBytes: (const void *)bytes
		     objCType: (const char *)objCType
{
	self = [super initWithBytes: bytes objCType: objCType];

	@try {
		_size = OFSizeOfTypeEncoding(objCType);
43
44
45
46
47
48
49





50
51
52
53
54
55
56
57
58
- (void)dealloc
{
	OFFreeMemory(_bytes);
	OFFreeMemory(_objCType);

	[super dealloc];
}






- (void)getValue: (void *)value size: (size_t)size
{
	if (size != _size)
		@throw [OFOutOfRangeException exception];

	memcpy(value, _bytes, _size);
}
@end







>
>
>
>
>









41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
- (void)dealloc
{
	OFFreeMemory(_bytes);
	OFFreeMemory(_objCType);

	[super dealloc];
}

- (const char *)objCType
{
	return _objCType;
}

- (void)getValue: (void *)value size: (size_t)size
{
	if (size != _size)
		@throw [OFOutOfRangeException exception];

	memcpy(value, _bytes, _size);
}
@end