python-zstandard: apply big-endian fix (issue6188) stable 5.1.1
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 25 Aug 2019 09:00:26 -0700
branchstable
changeset 42812 a4e32fd539ab
parent 42811 3332bde53714
child 42820 10841b9a80c3
child 42843 662a4ae78a6d
python-zstandard: apply big-endian fix (issue6188) This is a port of commit d4baf1f95b811f40773f5df0d8780fb2111ba6f5 from the upstream project to fix python-zstandard on 64-bit big-endian.
contrib/python-zstandard/c-ext/decompressor.c
--- a/contrib/python-zstandard/c-ext/decompressor.c	Sat Aug 17 01:49:28 2019 +0530
+++ b/contrib/python-zstandard/c-ext/decompressor.c	Sun Aug 25 09:00:26 2019 -0700
@@ -68,13 +68,13 @@
 	};
 
 	ZstdCompressionDict* dict = NULL;
-	size_t maxWindowSize = 0;
+	Py_ssize_t maxWindowSize = 0;
 	ZSTD_format_e format = ZSTD_f_zstd1;
 
 	self->dctx = NULL;
 	self->dict = NULL;
 
-	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O!II:ZstdDecompressor", kwlist,
+	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O!nI:ZstdDecompressor", kwlist,
 		&ZstdCompressionDictType, &dict, &maxWindowSize, &format)) {
 		return -1;
 	}