ObjFW  Check-in [2071d164bb]

Overview
Comment:Fix warnings with 32 bit Clang
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2071d164bb73c436c9b7f3340ae92a5985930fc2b679d13b94bc760ee72ce5db
User & Date: js on 2017-08-11 18:14:14
Other Links: manifest | tags
Context
2017-08-11
20:15
scrypt: Minor code formatting fix check-in: 86ad296bec user: js tags: trunk
18:14
Fix warnings with 32 bit Clang check-in: 2071d164bb user: js tags: trunk
15:47
of_asprintf: Don't require set up OFLocalization check-in: 17098e76eb user: js tags: trunk
Changes

Modified src/OFTarArchive.m from [944c9a1051] to [6d92ac1a5f].

292
293
294
295
296
297
298
299

300
301
302
303
304
305
306
292
293
294
295
296
297
298

299
300
301
302
303
304
305
306







-
+








	if (_stream == nil)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (_atEndOfStream)
		return 0;

	if (length > UINT64_MAX)
	if (sizeof(length) >= sizeof(uint64_t) && length > UINT64_MAX)
		@throw [OFOutOfRangeException exception];

	if ((uint64_t)length > _toRead)
		length = (size_t)_toRead;

	ret = [_stream readIntoBuffer: buffer
			       length: length];

Modified src/OFZIPArchive.m from [eca8fcf711] to [7073d8b5b3].

749
750
751
752
753
754
755
756

757
758
759
760
761
762
763
749
750
751
752
753
754
755

756
757
758
759
760
761
762
763







-
+








	if (_stream == nil)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (_atEndOfStream)
		return 0;

	if (length > UINT64_MAX)
	if (sizeof(length) >= sizeof(uint64_t) && length > UINT64_MAX)
		@throw [OFOutOfRangeException exception];

	if ((uint64_t)length > _toRead)
		length = (size_t)_toRead;

	ret = [_decompressedStream readIntoBuffer: buffer
					   length: length];
806
807
808
809
810
811
812

813

814
815
816
817
818
819
820
806
807
808
809
810
811
812
813

814
815
816
817
818
819
820
821







+
-
+








	[super dealloc];
}

- (void)lowlevelWriteBuffer: (const void *)buffer
		     length: (size_t)length
{
	if ((sizeof(length) >= sizeof(int64_t) && length > INT64_MAX) ||
	if (length > INT64_MAX || INT64_MAX - _bytesWritten < (int64_t)length)
	    INT64_MAX - _bytesWritten < (int64_t)length)
		@throw [OFOutOfRangeException exception];

	[_stream writeBuffer: buffer
		      length: length];

	_bytesWritten += (int64_t)length;
	_CRC32 = of_crc32(_CRC32, buffer, length);