osutil: move declaration to top of the scope
authorYuya Nishihara <yuya@tcha.org>
Sun, 22 Mar 2020 18:40:04 +0900
changeset 44586 0424a9134bcf
parent 44585 2d63a8910db6
child 44587 090a1a78be4a
osutil: move declaration to top of the scope Otherwise the build would fail with -Werror=declaration-after-statement.
mercurial/cext/osutil.c
--- 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);