changeset 44580:3122058df7a5 stable

cext: move variable declaration to the top of the block for C89 support Not sure if we still care about C89 in general, but MSVC requires this style too. Differential Revision: https://phab.mercurial-scm.org/D8304
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 20 Mar 2020 10:04:13 -0400
parents bc9a9016467d
children 090a1a78be4a c23877cb25a5
files mercurial/cext/revlog.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cext/revlog.c	Wed Mar 18 21:27:45 2020 +0100
+++ b/mercurial/cext/revlog.c	Fri Mar 20 10:04:13 2020 -0400
@@ -153,11 +153,12 @@
 {
 	if (self->inlined && pos > 0) {
 		if (self->offsets == NULL) {
+			Py_ssize_t ret;
 			self->offsets = PyMem_Malloc(self->raw_length *
 			                             sizeof(*self->offsets));
 			if (self->offsets == NULL)
 				return (const char *)PyErr_NoMemory();
-			Py_ssize_t ret = inline_scan(self, self->offsets);
+			ret = inline_scan(self, self->offsets);
 			if (ret == -1) {
 				return NULL;
 			};