X-Git-Url: https://git.distorted.org.uk/~mdw/mLib-python/blobdiff_plain/799dffb291a9e8600ca2385ce9545ac3559863f8..1e082a8681747b3968d0af6ce6a55283460bc641:/util.c diff --git a/util.c b/util.c index 27af83a..166cdbb 100644 --- a/util.c +++ b/util.c @@ -32,15 +32,13 @@ /*----- Conversions -------------------------------------------------------*/ -#define GETU_(n) \ - PyObject *getu##n(uint##n w) \ - { \ - if (w <= MASK##n) \ - return (PyInt_FromLong(w)); \ - else \ - return (PyLong_FromUnsignedLong(w)); \ - } -DOUINTSZ(GETU_) +PyObject *getulong(unsigned long w) +{ + if (w <= MASK32) + return (PyInt_FromLong(w)); + else + return (PyLong_FromUnsignedLong(w)); +} PyObject *getbool(int b) {