# HG changeset patch # User Matt Harbison # Date 2020-03-20 14:04:13 # Node ID 3122058df7a5a1f7f36588e89d5d6ad529041a56 # Parent bc9a9016467d90a613816950175e05671af277e6 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 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 @@ static const char *index_deref(indexObje { 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; };