diff options
author | INADA Naoki <inada-n@klab.com> | 2013-10-20 20:28:32 +0900 |
---|---|---|
committer | INADA Naoki <inada-n@klab.com> | 2013-10-20 20:28:32 +0900 |
commit | 96bcd76f49afd00f5b7def1ff7cfd002a7fa477d (patch) | |
tree | ba89ca218c7c3f0463d451254ed23eed48b4fe6a /msgpack/unpack.h | |
parent | aa68c9b8330b130d600b22ec47d5c3841499b536 (diff) | |
download | msgpack-python-96bcd76f49afd00f5b7def1ff7cfd002a7fa477d.tar.gz |
Packing ExtType and some cleanup
Diffstat (limited to 'msgpack/unpack.h')
-rw-r--r-- | msgpack/unpack.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/msgpack/unpack.h b/msgpack/unpack.h index 327a524..3c09747 100644 --- a/msgpack/unpack.h +++ b/msgpack/unpack.h @@ -24,7 +24,7 @@ typedef struct unpack_user { PyObject *object_hook; bool has_pairs_hook; PyObject *list_hook; - PyObject *ext_type_hook; + PyObject *ext_hook; const char *encoding; const char *unicode_errors; } unpack_user; @@ -241,12 +241,12 @@ static inline int unpack_callback_ext(unpack_user* u, const char* base, const ch { PyObject *py; int8_t typecode = (int8_t)*pos++; - if (!u->ext_type_hook) { - PyErr_SetString(PyExc_AssertionError, "u->ext_type_hook cannot be NULL"); + if (!u->ext_hook) { + PyErr_SetString(PyExc_AssertionError, "u->ext_hook cannot be NULL"); return -1; } - // lenght also includes the typecode, so the actual data is lenght-1 - py = PyEval_CallFunction(u->ext_type_hook, "(is#)", typecode, pos, lenght-1); + // length also includes the typecode, so the actual data is lenght-1 + py = PyEval_CallFunction(u->ext_hook, "(is#)", typecode, pos, lenght-1); if (!py) return -1; *o = py; |