ObjFW  Diff

Differences From Artifact [794a332a64]:

  • File src/OFArray_adjacent.m — part of check-in [4e59d2692f] at 2014-04-26 00:40:17 on branch trunk — Fix a few issues on LLP64 and Win64

    LLP64 was mostly fast enumeration using an unsigned long for the state,
    which can't store a pointer or a size_t on LLP64. This is now solved by
    either throwing an OFOutOfRangeException if the value of the size_t is
    bigger than ULONG_MAX or storing the pointer in the extra field (copied
    using memcpy, as it's an array of unsigned long, which again would be
    too small to store a pointer).

    Win64 was mostly Microsoft not being able to decide whether a length is
    a size_t, a DWORD, an int or an unsigned int (thus the different types
    in places that seem to be almost the same). But since that would not be
    confusing enough, a file descriptor is an int if it's for a file, but a
    long long if it is for a socket. But of course, for ReadFile and friends
    it's a DWORD instead of an int then. (user: js, size: 7161) [annotate] [blame] [check-ins using]

To Artifact [99931c4432]:


86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
	}

	return self;
}

- initWithArray: (OFArray*)array
{
	id *objects;
	size_t i, count;

	self = [super init];

	if (array == nil)
		return self;








|







86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
	}

	return self;
}

- initWithArray: (OFArray*)array
{
	id const *objects;
	size_t i, count;

	self = [super init];

	if (array == nil)
		return self;

202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
}

- (size_t)count
{
	return [_array count];
}

- (id*)objects
{
	return [_array items];
}

- (id)objectAtIndex: (size_t)index
{
	return *((id*)[_array itemAtIndex: index]);







|







202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
}

- (size_t)count
{
	return [_array count];
}

- (id const*)objects
{
	return [_array items];
}

- (id)objectAtIndex: (size_t)index
{
	return *((id*)[_array itemAtIndex: index]);
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
	return [OFArray_adjacentSubarray arrayWithArray: self
						  range: range];
}

- (bool)isEqual: (id)object
{
	OFArray *otherArray;
	id *objects, *otherObjects;
	size_t i, count;

	if ([object class] != [OFArray_adjacent class] &&
	    [object class] != [OFMutableArray_adjacent class] &&
	    [object class] != [OFArray_adjacentSubarray class])
		return [super isEqual: object];








|







286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
	return [OFArray_adjacentSubarray arrayWithArray: self
						  range: range];
}

- (bool)isEqual: (id)object
{
	OFArray *otherArray;
	id const *objects, *otherObjects;
	size_t i, count;

	if ([object class] != [OFArray_adjacent class] &&
	    [object class] != [OFMutableArray_adjacent class] &&
	    [object class] != [OFArray_adjacentSubarray class])
		return [super isEqual: object];