From 989638174888e6f73bcc67008469da25bb393d57 Mon Sep 17 00:00:00 2001 Message-Id: <989638174888e6f73bcc67008469da25bb393d57.1716739372.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sun, 23 Jun 2013 09:04:24 +0100 Subject: [PATCH] Fix a few minor warnings. Organization: Straylight/Edgeware From: Mark Wooding --- ec.c | 2 +- group.c | 2 +- rand.c | 2 +- util.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ec.c b/ec.c index 2b2dba0..21aa352 100644 --- a/ec.c +++ b/ec.c @@ -1527,7 +1527,7 @@ static PyObject *namedcurves(void) } c = PyInt_FromLong(i); found: - PyDict_SetItemString(d, (/*unconst*/ char *)ectab[i].name, c); + PyDict_SetItemString(d, (/*unconst*/ char *)p, c); Py_DECREF(c); } ncurves = i; diff --git a/group.c b/group.c index 544a8c7..1f733a0 100644 --- a/group.c +++ b/group.c @@ -225,7 +225,7 @@ static PyObject *namedgroups(const pentry *pp, int *ne) } c = PyInt_FromLong(i); found: - PyDict_SetItemString(d, (/*unconst*/ char *)pp[i].name, c); + PyDict_SetItemString(d, (/*unconst*/ char *)p, c); Py_DECREF(c); } *ne = i; diff --git a/rand.c b/rand.c index 9f086e6..3bcd0a9 100644 --- a/rand.c +++ b/rand.c @@ -978,7 +978,7 @@ static PyObject *dsarand_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw) goto end; rc = grand_dopywrap(ty, dsarand_create(p, sz), f_freeme); end: - return (0); + return (rc); } static PyObject *drget_seed(PyObject *me, void *hunoz) diff --git a/util.c b/util.c index 96a4052..f56c7fd 100644 --- a/util.c +++ b/util.c @@ -163,7 +163,7 @@ void *newtype(PyTypeObject *metaty, ty->ht_name = PyString_FromString(ty->ht_type.tp_name); if (ty->ht_name) ty->ht_type.tp_name = PyString_AS_STRING(ty->ht_name); - PyObject_INIT(&ty->ht_type, metaty); + DISCARD(PyObject_INIT(&ty->ht_type, metaty)); Py_INCREF(metaty); return (ty); } -- [mdw]