ObjFW  Check-in [b226150570]

Overview
Comment:runtime: Fix sizeof(sizeof(...))

Luckily, there was no overflow, as sizeof(size_t) == sizeof(void *) on
pretty much every platform.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b2261505702483603a497d001d4071c4c8e7d39c8c6c017642c51898d0e38512
User & Date: js on 2019-06-16 13:42:52
Other Links: manifest | tags
Context
2019-06-16
14:53
Use -ffreestanding for Amiga library check-in: 79fe9646af user: js tags: trunk
13:42
runtime: Fix sizeof(sizeof(...)) check-in: b226150570 user: js tags: trunk
04:51
OFApplication: Nullability fix check-in: ae0955585b user: js tags: trunk
Changes

Modified src/runtime/hashtable.m from [5d75b08ec8] to [3b13e94c04].

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
		newSize = table->size / 2;
	else
		return;

	if (count < table->count && newSize < 16)
		return;

	if ((newData = calloc(newSize, sizeof(sizeof(*newData)))) == NULL)
		OBJC_ERROR("Not enough memory to resize hash table!");

	for (uint32_t i = 0; i < table->size; i++) {
		if (table->data[i] != NULL &&
		    table->data[i] != &objc_deleted_bucket) {
			uint32_t j, last;








|







96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
		newSize = table->size / 2;
	else
		return;

	if (count < table->count && newSize < 16)
		return;

	if ((newData = calloc(newSize, sizeof(*newData))) == NULL)
		OBJC_ERROR("Not enough memory to resize hash table!");

	for (uint32_t i = 0; i < table->size; i++) {
		if (table->data[i] != NULL &&
		    table->data[i] != &objc_deleted_bucket) {
			uint32_t j, last;