From: Mark Wooding Date: Fri, 9 Nov 2018 17:02:20 +0000 (+0000) Subject: algorithms.c: Slightly simplify integer-hashing methods. X-Git-Tag: 1.3.0~15 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/commitdiff_plain/0e5c668c75eb9f7bb4394bf69fe96c760308df58 algorithms.c: Slightly simplify integer-hashing methods. There's no need for these to have an `end' label. --- diff --git a/algorithms.c b/algorithms.c index 3e1866f..033176b 100644 --- a/algorithms.c +++ b/algorithms.c @@ -788,11 +788,9 @@ static PyObject *ghmeth_hash(PyObject *me, PyObject *arg) static PyObject *ghmeth_hashu##w(PyObject *me, PyObject *arg) \ { \ uint##n x; \ - if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) goto end; \ + if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) return (0); \ GH_HASHU##W(GHASH_H(me), x); \ RETURN_ME; \ - end: \ - return (0); \ } DOUINTCONV(GHMETH_HASHU_) @@ -1308,11 +1306,9 @@ static PyObject *polymeth_hash(PyObject *me, PyObject *arg) { \ uint##n x; \ octet b[SZ_##W]; \ - if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) goto end; \ + if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) return (0); \ STORE##W(b, x); poly1305_hash(P1305_CTX(me), b, sizeof(b)); \ RETURN_ME; \ - end: \ - return (0); \ } DOUINTCONV(POLYMETH_HASHU_) @@ -1807,12 +1803,10 @@ static PyObject *shakemeth_hash(PyObject *me, PyObject *arg) { \ uint##n x; \ octet b[SZ_##W]; \ - if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) goto end; \ - if (shake_check(me, 0)) goto end; \ + if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) return (0); \ + if (shake_check(me, 0)) return (0); \ STORE##W(b, x); shake_hash(SHAKE_H(me), b, sizeof(b)); \ RETURN_ME; \ - end: \ - return (0); \ } DOUINTCONV(SHAKEMETH_HASHU_)