changeset 44586:0424a9134bcf

osutil: move declaration to top of the scope Otherwise the build would fail with -Werror=declaration-after-statement.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 22 Mar 2020 18:40:04 +0900
parents 2d63a8910db6
children 090a1a78be4a
files mercurial/cext/osutil.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cext/osutil.c	Sat Mar 21 14:01:10 2020 +0900
+++ b/mercurial/cext/osutil.c	Sun Mar 22 18:40:04 2020 +0900
@@ -810,9 +810,10 @@
 			/* Check the memory we can use. Typically, argv[i] and
 			 * argv[i + 1] are continuous. */
 			for (i = 0; i < argc; ++i) {
+				size_t len;
 				if (argv[i] > argvend || argv[i] < argvstart)
 					break; /* not continuous */
-				size_t len = strlen(argv[i]);
+				len = strlen(argv[i]);
 				argvend = argv[i] + len + 1 /* '\0' */;
 			}
 			if (argvend > argvstart) /* sanity check */
@@ -1169,10 +1170,10 @@
 static PyObject *unblocksignal(PyObject *self, PyObject *args)
 {
 	int sig = 0;
+	sigset_t set;
 	int r;
 	if (!PyArg_ParseTuple(args, "i", &sig))
 		return NULL;
-	sigset_t set;
 	r = sigemptyset(&set);
 	if (r != 0)
 		return PyErr_SetFromErrno(PyExc_OSError);