From: Mark Wooding Date: Sun, 24 Nov 2019 15:11:46 +0000 (+0000) Subject: catacomb.c, util.c: Publish negative constants correctly. X-Git-Url: https://git.distorted.org.uk/~mdw/pyke/commitdiff_plain/2ec562f15a095c23bc7c16199ea7428007b7b8ec?hp=2ec562f15a095c23bc7c16199ea7428007b7b8ec catacomb.c, util.c: Publish negative constants correctly. The various `KERR_...' constants and `PGEN_ABORT' are canonically negative integers, but weren't published correctly. Add a flags word to `struct nameval' to identify constants which should really be signed, and some fancy footwork to convert unsigned integers back to negative values without upsetting C. Adjust the `C' macro to spot negative constants and mark them specially. Not all is well. In particular, the `KEXP_...' constants should /not/ be published as signed values, even if `time_t' is signed on the target platform, because the Python bindings handle them exclusively as `unsigned long' values. To make this work, also introduce `CF' which allows us to set the flags explicitly, and use it for `KEXP_...'. ---