Permalink
Browse files

fix compiler warnings

& remove redundant enum
  • Loading branch information...
1 parent d041aba commit 79e980641d3e6f7cf2c0de4a7fcea89c4aae49bf @Komnomnomnom Komnomnomnom committed Jun 11, 2012
Showing with 15 additions and 35 deletions.
  1. +1 −1 lib/ultrajsondec.c
  2. +1 −1 lib/ultrajsonenc.c
  3. +4 −24 python/objToJSON.c
  4. +9 −9 python/ujson.c
View
@@ -642,7 +642,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_array( struct DecoderState *ds)
if ((*ds->start) == ']')
{
- *ds->start ++;
+ ds->start++;
return newObj;
}
View
@@ -196,7 +196,7 @@ int Buffer_EscapeStringUnvalidated (JSOBJ obj, JSONObjectEncoder *enc, const cha
default: (*of++) = (*io); break;
}
- *io++;
+ io++;
}
return FALSE;
View
@@ -36,26 +36,6 @@ typedef struct __TypeContext
#define GET_TC(__ptrtc) ((TypeContext *)((__ptrtc)->prv))
-
-enum PRIVATE
-{
- PRV_CONV_FUNC, // Function pointer to converter function
- PRV_CONV_NEWOBJ, // Any new PyObject created by converter function that should be released by releaseValue
- PRV_ITER_BEGIN_FUNC, // Function pointer to iterBegin for specific type
- PRV_ITER_END_FUNC, // Function pointer to iterEnd for specific type
- PRV_ITER_NEXT_FUNC, // Function pointer to iterNext for specific type
- PRV_ITER_GETVALUE_FUNC,
- PRV_ITER_GETNAME_FUNC,
- PRV_ITER_INDEX, // Index in the iteration list
- PRV_ITER_SIZE, // Size of the iteration list
- PRV_ITER_ITEM, // Current iter item
- PRV_ITER_ITEM_NAME, // Name of iter item
- PRV_ITER_ITEM_VALUE, // Value of iteritem
- PRV_ITER_DICTITEMS,
- PRV_ITER_DICTOBJ,
- PRV_ITER_ATTRLIST,
-};
-
struct PyDictIterState
{
PyObject *keys;
@@ -67,7 +47,7 @@ struct PyDictIterState
//#define PRINTMARK() fprintf(stderr, "%s: MARK(%d)\n", __FILE__, __LINE__)
#define PRINTMARK()
-void initObjToJSON()
+void initObjToJSON(void)
{
//FIXME: DECREF on these?
PyDateTime_IMPORT;
@@ -98,7 +78,6 @@ static void *PyIntToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size_
static void *PyLongToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size_t *_outLen)
{
- PyObject *obj = (PyObject *) _obj;
*((JSINT64 *) outValue) = GET_TC(tc)->longValue;
return NULL;
}
@@ -416,8 +395,9 @@ char *Dict_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
}
-void Object_beginTypeContext (PyObject *obj, JSONTypeContext *tc)
+void Object_beginTypeContext (JSOBJ _obj, JSONTypeContext *tc)
{
+ PyObject* obj = (PyObject*) _obj;
TypeContext *pc = (TypeContext *) tc->prv;
PyObject *toDictFunc;
@@ -646,7 +626,7 @@ double Object_getDoubleValue(JSOBJ obj, JSONTypeContext *tc)
return ret;
}
-static void Object_releaseObject(JSOBJ *_obj)
+static void Object_releaseObject(JSOBJ _obj)
{
Py_DECREF( (PyObject *) _obj);
}
View
@@ -2,26 +2,26 @@
#include "version.h"
/* objToJSON */
-PyObject* objToJSON(PyObject* self, PyObject *arg);
-void initObjToJSON();
+PyObject* objToJSON(PyObject* self, PyObject *args, PyObject *kwargs);
+void initObjToJSON(void);
/* JSONToObj */
PyObject* JSONToObj(PyObject* self, PyObject *arg);
/* objToJSONFile */
-PyObject* objToJSONFile(PyObject* self, PyObject *args);
+PyObject* objToJSONFile(PyObject* self, PyObject *args, PyObject *kwargs);
/* JSONFileToObj */
PyObject* JSONFileToObj(PyObject* self, PyObject *file);
static PyMethodDef ujsonMethods[] = {
- {"encode", objToJSON, METH_VARARGS | METH_KEYWORDS, "Converts arbitrary object recursivly into JSON. Use ensure_ascii=false to output UTF-8. Pass in double_precision to alter the maximum digit precision with doubles"},
- {"decode", JSONToObj, METH_O, "Converts JSON as string to dict object structure"},
- {"dumps", objToJSON, METH_VARARGS | METH_KEYWORDS, "Converts arbitrary object recursivly into JSON. Use ensure_ascii=false to output UTF-8"},
- {"loads", JSONToObj, METH_O, "Converts JSON as string to dict object structure"},
- {"dump", objToJSONFile, METH_VARARGS | METH_KEYWORDS, "Converts arbitrary object recursively into JSON file. Use ensure_ascii=false to output UTF-8"},
- {"load", JSONFileToObj, METH_O, "Converts JSON as file to dict object structure"},
+ {"encode", (PyCFunction) objToJSON, METH_VARARGS | METH_KEYWORDS, "Converts arbitrary object recursivly into JSON. Use ensure_ascii=false to output UTF-8. Pass in double_precision to alter the maximum digit precision with doubles"},
+ {"decode", (PyCFunction) JSONToObj, METH_O, "Converts JSON as string to dict object structure"},
+ {"dumps", (PyCFunction) objToJSON, METH_VARARGS | METH_KEYWORDS, "Converts arbitrary object recursivly into JSON. Use ensure_ascii=false to output UTF-8"},
+ {"loads", (PyCFunction) JSONToObj, METH_O, "Converts JSON as string to dict object structure"},
+ {"dump", (PyCFunction) objToJSONFile, METH_VARARGS | METH_KEYWORDS, "Converts arbitrary object recursively into JSON file. Use ensure_ascii=false to output UTF-8"},
+ {"load", (PyCFunction) JSONFileToObj, METH_O, "Converts JSON as file to dict object structure"},
{NULL, NULL, 0, NULL} /* Sentinel */
};

0 comments on commit 79e9806

Please sign in to comment.