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

login
register
mail settings
Submitter phabricator
Date March 20, 2020, 2:37 p.m.
Message ID <ca0efc753a03c093fecd14153387c1c3@localhost.localdomain>
Download mbox | patch
Permalink /patch/45839/
State Not Applicable
Headers show

Comments

phabricator - March 20, 2020, 2:37 p.m.
Closed by commit rHG3122058df7a5: cext: move variable declaration to the top of the block for C89 support (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8304?vs=20841&id=20842

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8304/new/

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

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS




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

Patch

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;
 			};