Permalink
Browse files

Merge pull request #107 from romuloceccon/silence_unused_PyIntToINTXX…

…_warning

Silence warning about unused PyIntToINTXX
  • Loading branch information...
2 parents 1b251e4 + 343d367 commit e339f5b9d7229533946b7658e677face4b510247 @jskorpan jskorpan committed Oct 4, 2013
Showing with 7 additions and 5 deletions.
  1. +7 −5 python/objToJSON.c
View
@@ -96,19 +96,21 @@ void initObjToJSON(void)
PyDateTime_IMPORT;
}
-static void *PyIntToINT32(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size_t *_outLen)
+#ifdef _LP64
+static void *PyIntToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size_t *_outLen)
{
PyObject *obj = (PyObject *) _obj;
- *((JSINT32 *) outValue) = PyInt_AS_LONG (obj);
+ *((JSINT64 *) outValue) = PyInt_AS_LONG (obj);
return NULL;
}
-
-static void *PyIntToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size_t *_outLen)
+#else
+static void *PyIntToINT32(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size_t *_outLen)
{
PyObject *obj = (PyObject *) _obj;
- *((JSINT64 *) outValue) = PyInt_AS_LONG (obj);
+ *((JSINT32 *) outValue) = PyInt_AS_LONG (obj);
return NULL;
}
+#endif
static void *PyLongToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size_t *_outLen)
{

0 comments on commit e339f5b

Please sign in to comment.