X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/202d82b7a790102c5da9dbb54d36e731e326f3f0..740847afe208bb8f33e7d6cf642acaf4aa739f6a:/group.c diff --git a/group.c b/group.c index 3d29070..239456f 100644 --- a/group.c +++ b/group.c @@ -461,7 +461,7 @@ PyTypeObject *primegroup_pytype, *bingroup_pytype, *ecgroup_pytype; group *group_copy(group *g) { - if (strcmp(G_NAME(g), "prime") == 0) { + if (STRCMP(G_NAME(g), ==, "prime")) { gctx_prime *gc = (gctx_prime *)g; gprime_param gp; gp.g = G_TOINT(g, MP_NEW, g->g); @@ -469,7 +469,7 @@ group *group_copy(group *g) gp.q = gc->g.r; g = group_prime(&gp); MP_DROP(gp.g); - } else if (strcmp(G_NAME(g), "bin") == 0) { + } else if (STRCMP(G_NAME(g), ==, "bin")) { gctx_bin *gc = (gctx_bin *)g; gbin_param gb; gb.g = G_TOINT(g, MP_NEW, g->g); @@ -477,7 +477,7 @@ group *group_copy(group *g) gb.q = gc->g.r; g = group_binary(&gb); MP_DROP(gb.g); - } else if (strcmp(G_NAME(g), "ec") == 0) { + } else if (STRCMP(G_NAME(g), ==, "ec")) { gctx_ec *gc = (gctx_ec *)g; ec_info ei; if ((ei.c = eccurve_copy(gc->ei.c)) == 0) @@ -560,9 +560,9 @@ PyObject *group_pywrap(group *g) { PyTypeObject *ty; - if (strcmp(G_NAME(g), "prime") == 0) ty = primegroup_pytype; - else if (strcmp(G_NAME(g), "bin") == 0) ty = bingroup_pytype; - else if (strcmp(G_NAME(g), "ec") == 0) ty = ecgroup_pytype; + if (STRCMP(G_NAME(g), ==, "prime")) ty = primegroup_pytype; + else if (STRCMP(G_NAME(g), ==, "bin")) ty = bingroup_pytype; + else if (STRCMP(G_NAME(g), ==, "ec")) ty = ecgroup_pytype; else abort(); return (group_dopywrap(ty, g)); } @@ -740,7 +740,7 @@ static PyObject *gemeth_toec(PyObject *me, PyObject *arg, PyObject *kw) if (!PyType_Check(cty) || !PyType_IsSubtype(cty, ecpt_pytype)) TYERR("want subtype of catacomb.ECPt"); Py_INCREF((PyObject *)cty); - } else if (strcmp(G_NAME(g), "ec") == 0) { + } else if (STRCMP(G_NAME(g), ==, "ec")) { c = eccurve_copy(((gctx_ec *)g)->ei.c); cty = (PyTypeObject *)eccurve_pywrap(0, c); } else {