From patchwork Fri Mar 20 14:06:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D8304: cext: move variable declaration to the top of the block for C89 support From: phabricator X-Patchwork-Id: 45838 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Fri, 20 Mar 2020 14:06:29 +0000 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 To: mharbison72, #hg-reviewers Cc: mercurial-devel 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; };