Commit Graph

4 Commits

Author SHA1 Message Date
Pino Toscano
9d25b4e564 python: add simple wrappers for PyObject<->string functions
The current need for #ifdef's based on the presence of
PyString_FromString makes both the OCaml code of the generator, and the
generated C code a mess to read.

Hence, add three simple wrappers to make both the OCaml, and C code more
readable, and easier to tweak in the future.

This should be just refactoring, with no actual behaviour changes.

Thanks to: Matteo Cafasso
2017-05-09 16:45:31 +02:00
Pino Toscano
b890fd2900 python: do not try to malloc 0 elements in get_all_event_callbacks
In case there are no event handlers registered with the handle,
get_all_event_callbacks will count 0 elements, trying to malloc a buffer
of that size.  POSIX says that this can result in either a null pointer,
or an unusable pointer.

Short-circuit get_all_event_callbacks to allocate nothing when there are
no events, making sure to use its results only when there were events.
2017-03-06 09:02:02 +01:00
Pino Toscano
55bf7de97c Update copyright dates for 2017
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2016/$1-2017/g' `git ls-files`

(Thanks Rich for the perl snippet, as used in past years.)
2017-01-03 16:48:21 +01:00
Richard W.M. Jones
63db9ae81f python: Split up large Python extension into smaller C files.
Reduces build time in this directory from 11s to 3s.
2016-09-02 23:14:08 +01:00