[PATCH] osutil: move declaration to top of the scope

Augie Fackler raf at durin42.com
Mon Mar 23 15:52:32 UTC 2020


Queued, thanks

> On Mar 22, 2020, at 08:39, Yuya Nishihara <yuya at tcha.org> wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1584870004 -32400
> #      Sun Mar 22 18:40:04 2020 +0900
> # Node ID bbb3fc76b442292b20e5dccccf97ea462997eb5e
> # Parent  a7f8c657a3f08d1e71ee112f797df011eea7a078
> osutil: move declaration to top of the scope
> 
> Otherwise the build would fail with -Werror=declaration-after-statement.
> 
> diff --git a/mercurial/cext/osutil.c b/mercurial/cext/osutil.c
> --- a/mercurial/cext/osutil.c
> +++ b/mercurial/cext/osutil.c
> @@ -810,9 +810,10 @@ static PyObject *setprocname(PyObject *s
> 			/* 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 *getfsmountpoint(PyObjec
> 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);
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel




More information about the Mercurial-devel mailing list