X-Git-Url: https://git.distorted.org.uk/~mdw/pyke/blobdiff_plain/2ec562f15a095c23bc7c16199ea7428007b7b8ec..d920a806df51ec41ffef2f8fb66a54235c2506eb:/catacomb.c diff --git a/catacomb.c b/catacomb.c index daa404a..e868f0f 100644 --- a/catacomb.c +++ b/catacomb.c @@ -52,6 +52,8 @@ static const struct nameval consts[] = { C(ED25519_KEYSZ), C(ED25519_PUBSZ), C(ED25519_SIGSZ), C(ED25519_MAXPERSOSZ), C(ED448_KEYSZ), C(ED448_PUBSZ), C(ED448_SIGSZ), C(ED448_MAXPERSOSZ), + C(AEADF_PCHSZ), C(AEADF_PCMSZ), C(AEADF_PCTSZ), + C(AEADF_AADNDEP), C(AEADF_AADFIRST), C(AEADF_NOAAD), #define ENTRY(tag, val, str) C(KERR_##tag), KEY_ERRORS(ENTRY) #undef ENTRY @@ -76,7 +78,8 @@ PyObject *mexp_common(PyObject *me, PyObject *arg, arg = PyTuple_GetItem(arg, 0); Py_INCREF(arg); if (!PySequence_Check(arg)) TYERR("not a sequence"); - n = PySequence_Size(arg); if (!n) { z = id(me); goto end; } + n = PySequence_Size(arg); if (n < 0) goto end; + if (!n) { z = id(me); goto end; } x = PySequence_GetItem(arg, 0); if (PySequence_Check(x)) flat = 0; @@ -141,7 +144,7 @@ static PyObject *meth__ego(PyObject *me, PyObject *arg) char *argv0; if (!PyArg_ParseTuple(arg, "s:_ego", &argv0)) return (0); - if (strcmp(QUIS, "") == 0) + if (STRCMP(QUIS, ==, "")) ego(argv0); RETURN_NONE; } @@ -161,14 +164,14 @@ static void init_random(void) if (!Py_HashRandomizationFlag) return; seed = getenv("PYTHONHASHSEED"); - if (!seed || strcmp(seed, "random") == 0) r = GR_WORD(&rand_global); + if (!seed || STRCMP(seed, ==, "random")) r = GR_WORD(&rand_global); else r = strtoul(seed, 0, 0); if (!r) r = 0xe011f220; /* zero doesn't work well */ unihash_setkey(&unihash_global, r); #endif } -void init_base(void) +EXPORT void init_base(void) { PyObject *mod; addmethods(methods);