# HG changeset patch # User Fredrik Lundh # Date 1257475409 -3600 # Node ID 9f3809fc04b43f2b75dd97ce9fb01442a039ea55 # Parent 1c35f4b846b698339ad388b3cc393e2e21c49cea More lint fixes. diff -r 1c35f4b846b698339ad388b3cc393e2e21c49cea -r 9f3809fc04b43f2b75dd97ce9fb01442a039ea55 cjson.c --- a/cjson.c Fri Nov 06 03:36:33 2009 +0100 +++ b/cjson.c Fri Nov 06 03:43:29 2009 +0100 @@ -668,14 +668,14 @@ /* For performance, we don't want to call * PyOS_snprintf here (extra layers of * function call). */ - sprintf(p, "\\u%04x", (int) (c & 0xff)); + sprintf(p, "\\u%04x", (unsigned int) (c & 0xff)); p += 6; } } assert(newsize - (p - PyString_AS_STRING(v)) >= 1); *p++ = '"'; - _PyString_Resize(&v, (int) (p - PyString_AS_STRING(v))); + _PyString_Resize(&v, (Py_ssize_t) (p - PyString_AS_STRING(v))); return v; } } @@ -686,7 +686,7 @@ encode_string_utf8(PyObject *string) { register PyStringObject* op = (PyStringObject*) string; - size_t newsize = 2 + 6 * op->ob_size; + Py_ssize_t newsize = 2 + 6 * op->ob_size; PyObject *v; if (op->ob_size > (PY_SSIZE_T_MAX-2)/6) { @@ -745,12 +745,12 @@ return NULL; p = PyString_AS_STRING(v) + offset; } - sprintf(p, "\\U%08x", (int) (ch & 0xffffffff)); + sprintf(p, "\\U%08x", (unsigned int) (ch & 0xffffffff)); p += 10; continue; } #endif - sprintf(p, "\\u%04x", (int) ch); + sprintf(p, "\\u%04x", (unsigned int) ch); p += 6; } }