changeset 44082:c3f741bb2f33

sha1dc: declare all variables at begininng of block This is required to appease ancient C language standards, which msvc 2008 still requires for Python 2.7 on Windows. Differential Revision: https://phab.mercurial-scm.org/D7877
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 14 Jan 2020 17:39:12 -0800
parents ef36156eac9f
children 29a110e2776e
files mercurial/thirdparty/sha1dc/cext.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/thirdparty/sha1dc/cext.c	Tue Jan 14 17:37:04 2020 -0800
+++ b/mercurial/thirdparty/sha1dc/cext.c	Tue Jan 14 17:39:12 2020 -0800
@@ -84,13 +84,14 @@
 
 static PyObject *pysha1ctx_hexdigest(pysha1ctx *self)
 {
+	static const char hexdigit[] = "0123456789abcdef";
 	unsigned char hash[20];
+	char hexhash[40];
+	int i;
 	if (!finalize(self->ctx, hash)) {
 		return NULL;
 	}
-	char hexhash[40];
-	static const char hexdigit[] = "0123456789abcdef";
-	for (int i = 0; i < 20; ++i) {
+	for (i = 0; i < 20; ++i) {
 		hexhash[i * 2] = hexdigit[hash[i] >> 4];
 		hexhash[i * 2 + 1] = hexdigit[hash[i] & 15];
 	}