ObjFW  Diff

Differences From Artifact [0b6aa35b67]:

To Artifact [44a7ffa4d7]:


133
134
135
136
137
138
139
140
141
142
143
144
145
146
147

	if (ret == 0)
		return 0xFFFF;

	return ret;
}

static inline OFString*
parseString(const char **pointer, const char *stop, size_t *line)
{
	char *buffer;
	size_t i = 0;
	char delimiter = **pointer;

	if (++(*pointer) + 1 >= stop)







|







133
134
135
136
137
138
139
140
141
142
143
144
145
146
147

	if (ret == 0)
		return 0xFFFF;

	return ret;
}

static inline OFString *
parseString(const char **pointer, const char *stop, size_t *line)
{
	char *buffer;
	size_t i = 0;
	char delimiter = **pointer;

	if (++(*pointer) + 1 >= stop)
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
		}
	}

	free(buffer);
	return nil;
}

static inline OFString*
parseIdentifier(const char **pointer, const char *stop)
{
	char *buffer;
	size_t i = 0;

	if ((buffer = malloc(stop - *pointer)) == NULL)
		return nil;







|







284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
		}
	}

	free(buffer);
	return nil;
}

static inline OFString *
parseIdentifier(const char **pointer, const char *stop)
{
	char *buffer;
	size_t i = 0;

	if ((buffer = malloc(stop - *pointer)) == NULL)
		return nil;
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
	/*
	 * It is never possible to end with an identifier, thus we should never
	 * reach stop.
	 */
	return nil;
}

static inline OFMutableArray*
parseArray(const char **pointer, const char *stop, size_t *line,
    size_t depth, size_t depthLimit)
{
	OFMutableArray *array = [OFMutableArray array];

	if (++(*pointer) >= stop)
		return nil;







|







384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
	/*
	 * It is never possible to end with an identifier, thus we should never
	 * reach stop.
	 */
	return nil;
}

static inline OFMutableArray *
parseArray(const char **pointer, const char *stop, size_t *line,
    size_t depth, size_t depthLimit)
{
	OFMutableArray *array = [OFMutableArray array];

	if (++(*pointer) >= stop)
		return nil;
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
	}

	(*pointer)++;

	return array;
}

static inline OFMutableDictionary*
parseDictionary(const char **pointer, const char *stop, size_t *line,
    size_t depth, size_t depthLimit)
{
	OFMutableDictionary *dictionary = [OFMutableDictionary dictionary];

	if (++(*pointer) >= stop)
		return nil;







|







441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
	}

	(*pointer)++;

	return array;
}

static inline OFMutableDictionary *
parseDictionary(const char **pointer, const char *stop, size_t *line,
    size_t depth, size_t depthLimit)
{
	OFMutableDictionary *dictionary = [OFMutableDictionary dictionary];

	if (++(*pointer) >= stop)
		return nil;
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
	}

	(*pointer)++;

	return dictionary;
}

static inline OFNumber*
parseNumber(const char **pointer, const char *stop, size_t *line)
{
	bool isHex = (*pointer + 1 < stop && (*pointer)[1] == 'x');
	bool hasDecimal = false;
	size_t i;
	OFString *string;
	OFNumber *number;







|







520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
	}

	(*pointer)++;

	return dictionary;
}

static inline OFNumber *
parseNumber(const char **pointer, const char *stop, size_t *line)
{
	bool isHex = (*pointer + 1 < stop && (*pointer)[1] == 'x');
	bool hasDecimal = false;
	size_t i;
	OFString *string;
	OFNumber *number;