summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaoki INADA <inada-n@gear>2009-06-08 04:33:47 +0900
committerNaoki INADA <inada-n@gear>2009-06-08 04:33:47 +0900
commit9b5a25ec32f716715311f2d2386762a1fd5714b7 (patch)
tree1850b626c3f51c1355f2fef7722409d194e04620
parentabe2a99ad2d57ef38c96643e93e0a1bb33dee1c9 (diff)
downloadmsgpack-python-9b5a25ec32f716715311f2d2386762a1fd5714b7.tar.gz
Fix unpacking True, False and True.
-rw-r--r--unpack.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/unpack.h b/unpack.h
index eb72001..e51557f 100644
--- a/unpack.h
+++ b/unpack.h
@@ -26,7 +26,7 @@ typedef struct {
struct template ## name
#define msgpack_unpack_func(ret, name) \
- ret template ## name
+ static inline ret template ## name
#define msgpack_unpack_callback(name) \
template_callback ## name
@@ -39,16 +39,8 @@ typedef struct {
struct template_context;
typedef struct template_context template_context;
-static inline void template_init(template_context* ctx);
-
-static inline msgpack_unpack_object template_data(template_context* ctx);
-
-static inline int template_execute(template_context* ctx,
- const char* data, size_t len, size_t* off);
-
-
static inline msgpack_unpack_object template_callback_root(unpack_user* u)
-{ PyObject *o = Py_None; Py_INCREF(o); return o; }
+{ return NULL; }
static inline int template_callback_uint8(unpack_user* u, uint8_t d, msgpack_unpack_object* o)
{ *o = PyInt_FromLong((long)d); return 0; }
@@ -88,13 +80,13 @@ static inline int template_callback_double(unpack_user* u, double d, msgpack_unp
{ *o = PyFloat_FromDouble(d); return 0; }
static inline int template_callback_nil(unpack_user* u, msgpack_unpack_object* o)
-{ *o = Py_None; Py_INCREF(o); return 0; }
+{ Py_INCREF(Py_None); *o = Py_None; return 0; }
static inline int template_callback_true(unpack_user* u, msgpack_unpack_object* o)
-{ *o = Py_True; Py_INCREF(o); return 0; }
+{ Py_INCREF(Py_True); *o = Py_True; return 0; }
static inline int template_callback_false(unpack_user* u, msgpack_unpack_object* o)
-{ *o = Py_False; Py_INCREF(o); return 0; }
+{ Py_INCREF(Py_False); *o = Py_False; return 0; }
static inline int template_callback_array(unpack_user* u, unsigned int n, msgpack_unpack_object* o)
{