mpatch: silence warning about maybe-uninitialized variable
authorYuya Nishihara <yuya@tcha.org>
Sun, 07 Aug 2016 09:47:07 +0900
changeset 29742 b410e26692a4
parent 29741 9a1685c70db4
child 29743 9f3c49ee4486
mpatch: silence warning about maybe-uninitialized variable It's false positive, but it wouldn't be possible for gcc to know PyBytes_FromStringAndSize() sets PyErr_Occurred(). mercurial/mpatch_module.c:105:47: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized] PyErr_SetString(mpatch_Error, mpatch_errors[-r]);
mercurial/mpatch_module.c
--- a/mercurial/mpatch_module.c	Sun Aug 07 09:40:30 2016 +0900
+++ b/mercurial/mpatch_module.c	Sun Aug 07 09:47:07 2016 +0900
@@ -59,7 +59,7 @@
 	PyObject *text, *bins, *result;
 	struct mpatch_flist *patch;
 	const char *in;
-	int r;
+	int r = 0;
 	char *out;
 	Py_ssize_t len, outlen, inlen;