D8304: cext: move variable declaration to the top of the block for C89 support

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Fri Mar 20 14:06:29 UTC 2020


mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Not sure if we still care about C89 in general, but MSVC requires this style
  too.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D8304

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -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;
 			};



To: mharbison72, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list