diff --git a/contrib/clang-format-blacklist b/contrib/clang-format-blacklist --- a/contrib/clang-format-blacklist +++ b/contrib/clang-format-blacklist @@ -3,7 +3,6 @@ mercurial/cext/bdiff.c mercurial/cext/dirs.c mercurial/cext/manifest.c -mercurial/cext/mpatch.c mercurial/cext/osutil.c mercurial/cext/revlog.c # Vendored code that we should never format: diff --git a/mercurial/cext/mpatch.c b/mercurial/cext/mpatch.c --- a/mercurial/cext/mpatch.c +++ b/mercurial/cext/mpatch.c @@ -55,10 +55,10 @@ ssize_t blen; int r; - PyObject *tmp = PyList_GetItem((PyObject*)bins, pos); + PyObject *tmp = PyList_GetItem((PyObject *)bins, pos); if (!tmp) return NULL; - if (PyObject_AsCharBuffer(tmp, &buffer, (Py_ssize_t*)&blen)) + if (PyObject_AsCharBuffer(tmp, &buffer, (Py_ssize_t *)&blen)) return NULL; if ((r = mpatch_decode(buffer, blen, &res)) < 0) { if (!PyErr_Occurred()) @@ -68,8 +68,7 @@ return res; } -static PyObject * -patches(PyObject *self, PyObject *args) +static PyObject *patches(PyObject *self, PyObject *args) { PyObject *text, *bins, *result; struct mpatch_flist *patch; @@ -123,8 +122,7 @@ } /* calculate size of a patched file directly */ -static PyObject * -patchedsize(PyObject *self, PyObject *args) +static PyObject *patchedsize(PyObject *self, PyObject *args) { long orig, start, end, len, outlen = 0, last = 0, pos = 0; Py_ssize_t patchlen; @@ -147,7 +145,8 @@ if (pos != patchlen) { if (!PyErr_Occurred()) - PyErr_SetString(mpatch_Error, "patch cannot be decoded"); + PyErr_SetString(mpatch_Error, + "patch cannot be decoded"); return NULL; } @@ -156,20 +155,16 @@ } static PyMethodDef methods[] = { - {"patches", patches, METH_VARARGS, "apply a series of patches\n"}, - {"patchedsize", patchedsize, METH_VARARGS, "calculed patched size\n"}, - {NULL, NULL} + {"patches", patches, METH_VARARGS, "apply a series of patches\n"}, + {"patchedsize", patchedsize, METH_VARARGS, "calculed patched size\n"}, + {NULL, NULL}, }; static const int version = 1; #ifdef IS_PY3K static struct PyModuleDef mpatch_module = { - PyModuleDef_HEAD_INIT, - "mpatch", - mpatch_doc, - -1, - methods + PyModuleDef_HEAD_INIT, "mpatch", mpatch_doc, -1, methods, }; PyMODINIT_FUNC PyInit_mpatch(void) @@ -180,8 +175,8 @@ if (m == NULL) return NULL; - mpatch_Error = PyErr_NewException("mercurial.cext.mpatch.mpatchError", - NULL, NULL); + mpatch_Error = + PyErr_NewException("mercurial.cext.mpatch.mpatchError", NULL, NULL); Py_INCREF(mpatch_Error); PyModule_AddObject(m, "mpatchError", mpatch_Error); PyModule_AddIntConstant(m, "version", version); @@ -189,13 +184,12 @@ return m; } #else -PyMODINIT_FUNC -initmpatch(void) +PyMODINIT_FUNC initmpatch(void) { PyObject *m; m = Py_InitModule3("mpatch", methods, mpatch_doc); - mpatch_Error = PyErr_NewException("mercurial.cext.mpatch.mpatchError", - NULL, NULL); + mpatch_Error = + PyErr_NewException("mercurial.cext.mpatch.mpatchError", NULL, NULL); PyModule_AddIntConstant(m, "version", version); } #endif