Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/ujson/, dev-python/ujson/files/
Date: Sat, 15 Apr 2017 01:17:33
Message-Id: 1492219032.c3a74efba946c7428e8984f810fdd5d219f3c16d.chutzpah@gentoo
1 commit: c3a74efba946c7428e8984f810fdd5d219f3c16d
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 15 01:17:12 2017 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 15 01:17:12 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3a74efb
7
8 dev-python/ujson: Version bump to 1.35
9
10 Also pull in a few bugfixes from upstream and fix a DeprecationWarning in the
11 tests.
12
13 Package-Manager: Portage-2.3.5, Repoman-2.3.2
14
15 dev-python/ujson/Manifest | 1 +
16 .../ujson-1.35-fix-for-overflowing-long.patch | 84 +++
17 .../ujson-1.35-fix-ordering-of-orderdict.patch | 122 +++++
18 .../files/ujson-1.35-sort_keys-segfault.patch | 73 +++
19 .../ujson-1.35-standard-handling-of-none.patch | 77 +++
20 .../files/ujson-1.35-test-depricationwarning.patch | 11 +
21 .../ujson-1.35-use-static-where-possible.patch | 591 +++++++++++++++++++++
22 dev-python/ujson/ujson-1.35.ebuild | 33 ++
23 8 files changed, 992 insertions(+)
24
25 diff --git a/dev-python/ujson/Manifest b/dev-python/ujson/Manifest
26 index aa37f161ee9..04f6da34d64 100644
27 --- a/dev-python/ujson/Manifest
28 +++ b/dev-python/ujson/Manifest
29 @@ -1 +1,2 @@
30 DIST ujson-1.33.zip 197034 SHA256 68cf825f227c82e1ac61e423cfcad923ff734c27b5bdd7174495d162c42c602b SHA512 0f1f66212fbf94c03e048ba64c3bd817c50443d1a29b87f6a3a38f697a050f38821be4ba36a3b17a96930c69ee92973ac31bdd41851dea071af14cd4bbaf8480 WHIRLPOOL d3080fcf3e979b43deb8fe099427a8311c55e7e54105626bf12b3b6fe9e8567f70501884bd24b7a26d53ddfcd98f535de4aa708801106aa4a1b76e543217835c
31 +DIST ujson-1.35.tar.gz 192027 SHA256 f66073e5506e91d204ab0c614a148d5aa938bdbf104751be66f8ad7a222f5f86 SHA512 931d8f574fc4920c9ded48369774666060e951f40982606ce9f1d9de3420004042af7d797075a54d92a2b25c4f313572a5e1a30f3bc8ce387ef8f3881193eee7 WHIRLPOOL aff7a034304366e95ec51164de78afbee8daa496022abdae1b9928ea90928758e675027f2202ca77790788a3057c978d9ba9348684bc087843aa2e16932a1144
32
33 diff --git a/dev-python/ujson/files/ujson-1.35-fix-for-overflowing-long.patch b/dev-python/ujson/files/ujson-1.35-fix-for-overflowing-long.patch
34 new file mode 100644
35 index 00000000000..98659ce1722
36 --- /dev/null
37 +++ b/dev-python/ujson/files/ujson-1.35-fix-for-overflowing-long.patch
38 @@ -0,0 +1,84 @@
39 +commit 409c6d4006fdea27e746ea397124f98c92a41a92
40 +Author: Joakim Hamren <joakim.hamren@×××××.com>
41 +Date: Sat Feb 4 04:21:05 2017 +0100
42 +
43 + Fix for overflowing long causing invalid json
44 +
45 + This was caused by checking for "__json__" using PyObject_HasAttrString
46 + which clears the error set by a previous long overflow. Thus this was dependent
47 + on the order of processing of dict items, which explains why it was
48 + seemingly random as the dict items are likely ordered by a hash of
49 + the key.
50 +
51 + This fixes GH224 and GH240.
52 +
53 +diff --git a/python/objToJSON.c b/python/objToJSON.c
54 +index 8133fb5..adea2f6 100644
55 +--- a/python/objToJSON.c
56 ++++ b/python/objToJSON.c
57 +@@ -226,6 +226,21 @@ static void *PyDateToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size
58 + return NULL;
59 + }
60 +
61 ++static int PyHasAttrStringPreserveErr(PyObject *obj, const char *attr)
62 ++{
63 ++ int res;
64 ++ PyObject *excType = NULL, *excValue, *excTraceback;
65 ++
66 ++ if (!PyErr_Occurred())
67 ++ return PyObject_HasAttrString(obj, "__json__");
68 ++
69 ++ PyErr_Fetch(&excType, &excValue, &excTraceback);
70 ++ res = PyObject_HasAttrString(obj, "__json__");
71 ++ PyErr_Restore(excType, excValue, excTraceback);
72 ++
73 ++ return res;
74 ++}
75 ++
76 + static int Tuple_iterNext(JSOBJ obj, JSONTypeContext *tc)
77 + {
78 + PyObject *item;
79 +@@ -471,21 +486,21 @@ static int Dict_iterNext(JSOBJ obj, JSONTypeContext *tc)
80 + GET_TC(tc)->itemName = PyUnicode_AsUTF8String (GET_TC(tc)->itemName);
81 + }
82 + else
83 +- if (!PyString_Check(GET_TC(tc)->itemName))
84 +- {
85 +- GET_TC(tc)->itemName = PyObject_Str(GET_TC(tc)->itemName);
86 ++ if (!PyString_Check(GET_TC(tc)->itemName))
87 ++ {
88 ++ GET_TC(tc)->itemName = PyObject_Str(GET_TC(tc)->itemName);
89 + #if PY_MAJOR_VERSION >= 3
90 +- itemNameTmp = GET_TC(tc)->itemName;
91 +- GET_TC(tc)->itemName = PyUnicode_AsUTF8String (GET_TC(tc)->itemName);
92 +- Py_DECREF(itemNameTmp);
93 ++ itemNameTmp = GET_TC(tc)->itemName;
94 ++ GET_TC(tc)->itemName = PyUnicode_AsUTF8String (GET_TC(tc)->itemName);
95 ++ Py_DECREF(itemNameTmp);
96 + #endif
97 +- }
98 +- else
99 +- {
100 +- Py_INCREF(GET_TC(tc)->itemName);
101 +- }
102 +- PRINTMARK();
103 +- return 1;
104 ++ }
105 ++ else
106 ++ {
107 ++ Py_INCREF(GET_TC(tc)->itemName);
108 ++ }
109 ++ PRINTMARK();
110 ++ return 1;
111 + }
112 +
113 + static void Dict_iterEnd(JSOBJ obj, JSONTypeContext *tc)
114 +@@ -728,7 +743,7 @@ static void Object_beginTypeContext (JSOBJ _obj, JSONTypeContext *tc, JSONObject
115 + return;
116 + }
117 + else
118 +- if (PyString_Check(obj) && !PyObject_HasAttrString(obj, "__json__"))
119 ++ if (PyString_Check(obj) && !PyHasAttrStringPreserveErr(obj, "__json__"))
120 + {
121 + PRINTMARK();
122 + pc->PyTypeToJSON = PyStringToUTF8; tc->type = JT_UTF8;
123
124 diff --git a/dev-python/ujson/files/ujson-1.35-fix-ordering-of-orderdict.patch b/dev-python/ujson/files/ujson-1.35-fix-ordering-of-orderdict.patch
125 new file mode 100644
126 index 00000000000..37270d41e3b
127 --- /dev/null
128 +++ b/dev-python/ujson/files/ujson-1.35-fix-ordering-of-orderdict.patch
129 @@ -0,0 +1,122 @@
130 +commit c9f8318bd823ae9d44797b6b881a2b3e22cdbade
131 +Author: Joakim Hamren <joakim.hamren@×××××.com>
132 +Date: Tue Feb 7 02:02:38 2017 +0100
133 +
134 + Fix for incorrect order when using OrderedDict
135 +
136 +diff --git a/python/objToJSON.c b/python/objToJSON.c
137 +index abe6588..9e6a390 100644
138 +--- a/python/objToJSON.c
139 ++++ b/python/objToJSON.c
140 +@@ -253,8 +253,13 @@ static int Dict_iterNext(JSOBJ obj, JSONTypeContext *tc)
141 + GET_TC(tc)->itemName = NULL;
142 + }
143 +
144 ++ if (!(GET_TC(tc)->itemName = PyIter_Next(GET_TC(tc)->iterator)))
145 ++ {
146 ++ PRINTMARK();
147 ++ return 0;
148 ++ }
149 +
150 +- if (!PyDict_Next ( (PyObject *)GET_TC(tc)->dictObj, &GET_TC(tc)->index, &GET_TC(tc)->itemName, &GET_TC(tc)->itemValue))
151 ++ if (!(GET_TC(tc)->itemValue = PyObject_GetItem(GET_TC(tc)->dictObj, GET_TC(tc)->itemName)))
152 + {
153 + PRINTMARK();
154 + return 0;
155 +@@ -295,6 +300,7 @@ static void Dict_iterEnd(JSOBJ obj, JSONTypeContext *tc)
156 + Py_DECREF(GET_TC(tc)->itemName);
157 + GET_TC(tc)->itemName = NULL;
158 + }
159 ++ Py_CLEAR(GET_TC(tc)->iterator);
160 + Py_DECREF(GET_TC(tc)->dictObj);
161 + PRINTMARK();
162 + }
163 +@@ -425,20 +431,23 @@ static char *SortedDict_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outL
164 +
165 + static void SetupDictIter(PyObject *dictObj, TypeContext *pc, JSONObjectEncoder *enc)
166 + {
167 +- if (enc->sortKeys) {
168 ++ pc->dictObj = dictObj;
169 ++ if (enc->sortKeys)
170 ++ {
171 + pc->iterEnd = SortedDict_iterEnd;
172 + pc->iterNext = SortedDict_iterNext;
173 + pc->iterGetValue = SortedDict_iterGetValue;
174 + pc->iterGetName = SortedDict_iterGetName;
175 ++ pc->index = 0;
176 + }
177 +- else {
178 ++ else
179 ++ {
180 + pc->iterEnd = Dict_iterEnd;
181 + pc->iterNext = Dict_iterNext;
182 + pc->iterGetValue = Dict_iterGetValue;
183 + pc->iterGetName = Dict_iterGetName;
184 ++ pc->iterator = PyObject_GetIter(dictObj);
185 + }
186 +- pc->dictObj = dictObj;
187 +- pc->index = 0;
188 + }
189 +
190 + static void Object_beginTypeContext (JSOBJ _obj, JSONTypeContext *tc, JSONObjectEncoder *enc)
191 +@@ -446,7 +455,8 @@ static void Object_beginTypeContext (JSOBJ _obj, JSONTypeContext *tc, JSONObject
192 + PyObject *obj, *objRepr, *exc;
193 + TypeContext *pc;
194 + PRINTMARK();
195 +- if (!_obj) {
196 ++ if (!_obj)
197 ++ {
198 + tc->type = JT_INVALID;
199 + return;
200 + }
201 +diff --git a/tests/tests.py b/tests/tests.py
202 +index cd928e6..b7e46af 100644
203 +--- a/tests/tests.py
204 ++++ b/tests/tests.py
205 +@@ -10,6 +10,8 @@ import json
206 + import math
207 + import time
208 + import pytz
209 ++from collections import OrderedDict
210 ++
211 + if six.PY2:
212 + import unittest2 as unittest
213 + else:
214 +@@ -383,6 +385,10 @@ class UltraJSONTests(unittest.TestCase):
215 + input = -float('inf')
216 + self.assertRaises(OverflowError, ujson.encode, input)
217 +
218 ++ def test_encodeOrderedDict(self):
219 ++ input = OrderedDict([(1, 1), (0, 0), (8, 8), (2, 2)])
220 ++ self.assertEqual('{"1":1,"0":0,"8":8,"2":2}', ujson.encode(input))
221 ++
222 + def test_decodeJibberish(self):
223 + input = "fdsa sda v9sa fdsa"
224 + self.assertRaises(ValueError, ujson.decode, input)
225 +@@ -668,7 +674,7 @@ class UltraJSONTests(unittest.TestCase):
226 + d = {u'key': JSONTest()}
227 + output = ujson.encode(d)
228 + dec = ujson.decode(output)
229 +- self.assertEquals(dec, {u'key': output_text})
230 ++ self.assertEqual(dec, {u'key': output_text})
231 +
232 + def test_object_with_json_unicode(self):
233 + # If __json__ returns a string, then that string
234 +@@ -681,7 +687,7 @@ class UltraJSONTests(unittest.TestCase):
235 + d = {u'key': JSONTest()}
236 + output = ujson.encode(d)
237 + dec = ujson.decode(output)
238 +- self.assertEquals(dec, {u'key': output_text})
239 ++ self.assertEqual(dec, {u'key': output_text})
240 +
241 + def test_object_with_complex_json(self):
242 + # If __json__ returns a string, then that string
243 +@@ -694,7 +700,7 @@ class UltraJSONTests(unittest.TestCase):
244 + d = {u'key': JSONTest()}
245 + output = ujson.encode(d)
246 + dec = ujson.decode(output)
247 +- self.assertEquals(dec, {u'key': obj})
248 ++ self.assertEqual(dec, {u'key': obj})
249 +
250 + def test_object_with_json_type_error(self):
251 + # __json__ must return a string, otherwise it should raise an error.
252
253 diff --git a/dev-python/ujson/files/ujson-1.35-sort_keys-segfault.patch b/dev-python/ujson/files/ujson-1.35-sort_keys-segfault.patch
254 new file mode 100644
255 index 00000000000..7239bca3e23
256 --- /dev/null
257 +++ b/dev-python/ujson/files/ujson-1.35-sort_keys-segfault.patch
258 @@ -0,0 +1,73 @@
259 +commit 870ee48fe109c289033cd0b7543b6f5ea4e6f128
260 +Author: Joakim Hamren <joakim.hamren@×××××.com>
261 +Date: Sat Feb 4 01:07:52 2017 +0100
262 +
263 + Fixes for sort_keys bug and a typo.
264 +
265 + - Fixed segfault when using sort_keys=True on dict with unorderable keys (GH247)
266 +
267 + - Fixed refcount becoming negative when using sort_keys=True (GH243)
268 +
269 + - Fixed compile error when defining JSON_NO_EXTRA_WHITESPACE
270 + caused by a wrongly named variable. (GH245)
271 +
272 +diff --git a/lib/ultrajsonenc.c b/lib/ultrajsonenc.c
273 +index cb10024..1bfa8f4 100644
274 +--- a/lib/ultrajsonenc.c
275 ++++ b/lib/ultrajsonenc.c
276 +@@ -717,7 +717,7 @@ static void encode(JSOBJ obj, JSONObjectEncoder *enc, const char *name, size_t c
277 + {
278 + const char *value;
279 + char *objName;
280 +- int count;
281 ++ int count, res;
282 + JSOBJ iterObj;
283 + size_t szlen;
284 + JSONTypeContext tc;
285 +@@ -796,7 +796,7 @@ static void encode(JSOBJ obj, JSONObjectEncoder *enc, const char *name, size_t c
286 + {
287 + Buffer_AppendCharUnchecked (enc, ',');
288 + #ifndef JSON_NO_EXTRA_WHITESPACE
289 +- Buffer_AppendCharUnchecked (buffer, ' ');
290 ++ Buffer_AppendCharUnchecked (enc, ' ');
291 + #endif
292 + Buffer_AppendIndentNewlineUnchecked (enc);
293 + }
294 +@@ -823,8 +823,16 @@ static void encode(JSOBJ obj, JSONObjectEncoder *enc, const char *name, size_t c
295 + Buffer_AppendCharUnchecked (enc, '{');
296 + Buffer_AppendIndentNewlineUnchecked (enc);
297 +
298 +- while (enc->iterNext(obj, &tc))
299 ++ while ((res = enc->iterNext(obj, &tc)))
300 + {
301 ++ if(res < 0)
302 ++ {
303 ++ enc->iterEnd(obj, &tc);
304 ++ enc->endTypeContext(obj, &tc);
305 ++ enc->level--;
306 ++ return;
307 ++ }
308 ++
309 + if (count > 0)
310 + {
311 + Buffer_AppendCharUnchecked (enc, ',');
312 +diff --git a/python/objToJSON.c b/python/objToJSON.c
313 +index 1960d40..8133fb5 100644
314 +--- a/python/objToJSON.c
315 ++++ b/python/objToJSON.c
316 +@@ -537,6 +537,7 @@ static int SortedDict_iterNext(JSOBJ obj, JSONTypeContext *tc)
317 + // Sort the list.
318 + if (PyList_Sort(items) < 0)
319 + {
320 ++ PyErr_SetString(PyExc_ValueError, "unorderable keys");
321 + goto error;
322 + }
323 +
324 +@@ -607,7 +608,6 @@ static void SortedDict_iterEnd(JSOBJ obj, JSONTypeContext *tc)
325 + {
326 + GET_TC(tc)->itemName = NULL;
327 + GET_TC(tc)->itemValue = NULL;
328 +- Py_DECREF(GET_TC(tc)->newObj);
329 + Py_DECREF(GET_TC(tc)->dictObj);
330 + PRINTMARK();
331 + }
332
333 diff --git a/dev-python/ujson/files/ujson-1.35-standard-handling-of-none.patch b/dev-python/ujson/files/ujson-1.35-standard-handling-of-none.patch
334 new file mode 100644
335 index 00000000000..e2b7b9103f4
336 --- /dev/null
337 +++ b/dev-python/ujson/files/ujson-1.35-standard-handling-of-none.patch
338 @@ -0,0 +1,77 @@
339 +commit ac4637fbc4e72bd59f221d9bba19127820d21023
340 +Author: Joakim Hamren <joakim.hamren@×××××.com>
341 +Date: Sat Feb 4 16:36:14 2017 +0100
342 +
343 + Following std json handling of None dict key
344 +
345 + Previously a None dict item key would be outputted in JSON as "None".
346 + To better align with the standard json module this was changed to output
347 + "null". There's no proper representation of null object keys in JSON so
348 + this is implementation specific but it seems more natural to follow
349 + suit when it can be done without a significant performance hit.
350 +
351 + Added and used branch prediction macros (LIKELY/UNLIKELY) as well.
352 +
353 +diff --git a/lib/ultrajson.h b/lib/ultrajson.h
354 +index 6c1dbc1..ca82a29 100644
355 +--- a/lib/ultrajson.h
356 ++++ b/lib/ultrajson.h
357 +@@ -117,6 +117,14 @@ typedef uint32_t JSUINT32;
358 +
359 + #define INLINE_PREFIX inline
360 +
361 ++#ifdef __GNUC__
362 ++#define LIKELY(x) __builtin_expect(!!(x), 1)
363 ++#define UNLIKELY(x) __builtin_expect(!!(x), 0)
364 ++#else
365 ++#define LIKELY(x) (x)
366 ++#define UNLIKELY(x) (x)
367 ++#endif
368 ++
369 + typedef uint8_t JSUINT8;
370 + typedef uint16_t JSUTF16;
371 + typedef uint32_t JSUTF32;
372 +diff --git a/python/objToJSON.c b/python/objToJSON.c
373 +index adea2f6..41d4289 100644
374 +--- a/python/objToJSON.c
375 ++++ b/python/objToJSON.c
376 +@@ -488,6 +488,12 @@ static int Dict_iterNext(JSOBJ obj, JSONTypeContext *tc)
377 + else
378 + if (!PyString_Check(GET_TC(tc)->itemName))
379 + {
380 ++ if (UNLIKELY(GET_TC(tc)->itemName == Py_None))
381 ++ {
382 ++ GET_TC(tc)->itemName = PyString_FromString("null");
383 ++ return 1;
384 ++ }
385 ++
386 + GET_TC(tc)->itemName = PyObject_Str(GET_TC(tc)->itemName);
387 + #if PY_MAJOR_VERSION >= 3
388 + itemNameTmp = GET_TC(tc)->itemName;
389 +@@ -743,7 +749,7 @@ static void Object_beginTypeContext (JSOBJ _obj, JSONTypeContext *tc, JSONObject
390 + return;
391 + }
392 + else
393 +- if (PyString_Check(obj) && !PyHasAttrStringPreserveErr(obj, "__json__"))
394 ++ if (PyString_Check(obj) && LIKELY(!PyHasAttrStringPreserveErr(obj, "__json__")))
395 + {
396 + PRINTMARK();
397 + pc->PyTypeToJSON = PyStringToUTF8; tc->type = JT_UTF8;
398 +@@ -837,7 +843,7 @@ ISITERABLE:
399 + }
400 + */
401 +
402 +- if (PyObject_HasAttrString(obj, "toDict"))
403 ++ if (UNLIKELY(PyObject_HasAttrString(obj, "toDict")))
404 + {
405 + PyObject* toDictFunc = PyObject_GetAttrString(obj, "toDict");
406 + PyObject* tuple = PyTuple_New(0);
407 +@@ -863,7 +869,7 @@ ISITERABLE:
408 + return;
409 + }
410 + else
411 +- if (PyObject_HasAttrString(obj, "__json__"))
412 ++ if (UNLIKELY(PyObject_HasAttrString(obj, "__json__")))
413 + {
414 + PyObject* toJSONFunc = PyObject_GetAttrString(obj, "__json__");
415 + PyObject* tuple = PyTuple_New(0);
416
417 diff --git a/dev-python/ujson/files/ujson-1.35-test-depricationwarning.patch b/dev-python/ujson/files/ujson-1.35-test-depricationwarning.patch
418 new file mode 100644
419 index 00000000000..6ce987581c4
420 --- /dev/null
421 +++ b/dev-python/ujson/files/ujson-1.35-test-depricationwarning.patch
422 @@ -0,0 +1,11 @@
423 +--- ujson-1.35.orig/tests/tests.py 2017-04-14 18:14:36.298345782 -0700
424 ++++ ujson-1.35/tests/tests.py 2017-04-14 18:14:47.899947795 -0700
425 +@@ -702,7 +702,7 @@
426 +
427 + output = ujson.encode(ObjectTest())
428 + dec = ujson.decode(output)
429 +- self.assertEquals(dec, {})
430 ++ self.assertEqual(dec, {})
431 +
432 + def test_toDict(self):
433 + d = {"key": 31337}
434
435 diff --git a/dev-python/ujson/files/ujson-1.35-use-static-where-possible.patch b/dev-python/ujson/files/ujson-1.35-use-static-where-possible.patch
436 new file mode 100644
437 index 00000000000..7ce5d44e0e7
438 --- /dev/null
439 +++ b/dev-python/ujson/files/ujson-1.35-use-static-where-possible.patch
440 @@ -0,0 +1,591 @@
441 +commit 6cf6c7ff25c883349e8e9e5468e61498358e2e91
442 +Author: WGH <wgh@××××××.ru>
443 +Date: Sat Aug 27 17:34:22 2016 +0300
444 +
445 + added "static" to C functions, where possible
446 +
447 + 1. It reduces clutter in symbol table.
448 + 2. It fixes issues with C99 inline semantics for functions
449 + marked as inline (#237, #180, #222), which manifests
450 + when compiled with GCC>=5.
451 +
452 +diff --git a/lib/ultrajsondec.c b/lib/ultrajsondec.c
453 +index 21a732e..19efc60 100644
454 +--- a/lib/ultrajsondec.c
455 ++++ b/lib/ultrajsondec.c
456 +@@ -66,7 +66,7 @@ struct DecoderState
457 + JSONObjectDecoder *dec;
458 + };
459 +
460 +-JSOBJ FASTCALL_MSVC decode_any( struct DecoderState *ds) FASTCALL_ATTR;
461 ++static JSOBJ FASTCALL_MSVC decode_any( struct DecoderState *ds) FASTCALL_ATTR;
462 + typedef JSOBJ (*PFN_DECODER)( struct DecoderState *ds);
463 +
464 + static JSOBJ SetError( struct DecoderState *ds, int offset, const char *message)
465 +@@ -76,13 +76,13 @@ static JSOBJ SetError( struct DecoderState *ds, int offset, const char *message)
466 + return NULL;
467 + }
468 +
469 +-double createDouble(double intNeg, double intValue, double frcValue, int frcDecimalCount)
470 ++static double createDouble(double intNeg, double intValue, double frcValue, int frcDecimalCount)
471 + {
472 + static const double g_pow10[] = {1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001,0.0000001, 0.00000001, 0.000000001, 0.0000000001, 0.00000000001, 0.000000000001, 0.0000000000001, 0.00000000000001, 0.000000000000001};
473 + return (intValue + (frcValue * g_pow10[frcDecimalCount])) * intNeg;
474 + }
475 +
476 +-FASTCALL_ATTR JSOBJ FASTCALL_MSVC decodePreciseFloat(struct DecoderState *ds)
477 ++static FASTCALL_ATTR JSOBJ FASTCALL_MSVC decodePreciseFloat(struct DecoderState *ds)
478 + {
479 + char *end;
480 + double value;
481 +@@ -99,7 +99,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decodePreciseFloat(struct DecoderState *ds)
482 + return ds->dec->newDouble(ds->prv, value);
483 + }
484 +
485 +-FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_numeric (struct DecoderState *ds)
486 ++static FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_numeric (struct DecoderState *ds)
487 + {
488 + int intNeg = 1;
489 + int mantSize = 0;
490 +@@ -309,7 +309,7 @@ BREAK_EXP_LOOP:
491 + return ds->dec->newDouble (ds->prv, createDouble( (double) intNeg, (double) intValue , frcValue, decimalCount) * pow(10.0, expValue * expNeg));
492 + }
493 +
494 +-FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_true ( struct DecoderState *ds)
495 ++static FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_true ( struct DecoderState *ds)
496 + {
497 + char *offset = ds->start;
498 + offset ++;
499 +@@ -329,7 +329,7 @@ SETERROR:
500 + return SetError(ds, -1, "Unexpected character found when decoding 'true'");
501 + }
502 +
503 +-FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_false ( struct DecoderState *ds)
504 ++static FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_false ( struct DecoderState *ds)
505 + {
506 + char *offset = ds->start;
507 + offset ++;
508 +@@ -351,7 +351,7 @@ SETERROR:
509 + return SetError(ds, -1, "Unexpected character found when decoding 'false'");
510 + }
511 +
512 +-FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_null ( struct DecoderState *ds)
513 ++static FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_null ( struct DecoderState *ds)
514 + {
515 + char *offset = ds->start;
516 + offset ++;
517 +@@ -371,7 +371,7 @@ SETERROR:
518 + return SetError(ds, -1, "Unexpected character found when decoding 'null'");
519 + }
520 +
521 +-FASTCALL_ATTR void FASTCALL_MSVC SkipWhitespace(struct DecoderState *ds)
522 ++static FASTCALL_ATTR void FASTCALL_MSVC SkipWhitespace(struct DecoderState *ds)
523 + {
524 + char *offset = ds->start;
525 +
526 +@@ -422,7 +422,7 @@ static const JSUINT8 g_decoderLookup[256] =
527 + /* 0xf0 */ 4, 4, 4, 4, 4, 4, 4, 4, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR,
528 + };
529 +
530 +-FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_string ( struct DecoderState *ds)
531 ++static FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_string ( struct DecoderState *ds)
532 + {
533 + JSUTF16 sur[2] = { 0 };
534 + int iSur = 0;
535 +@@ -672,7 +672,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_string ( struct DecoderState *ds)
536 + }
537 + }
538 +
539 +-FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_array(struct DecoderState *ds)
540 ++static FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_array(struct DecoderState *ds)
541 + {
542 + JSOBJ itemValue;
543 + JSOBJ newObj;
544 +@@ -736,7 +736,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_array(struct DecoderState *ds)
545 + }
546 + }
547 +
548 +-FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_object( struct DecoderState *ds)
549 ++static FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_object( struct DecoderState *ds)
550 + {
551 + JSOBJ itemName;
552 + JSOBJ itemValue;
553 +@@ -819,7 +819,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_object( struct DecoderState *ds)
554 + }
555 + }
556 +
557 +-FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_any(struct DecoderState *ds)
558 ++static FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_any(struct DecoderState *ds)
559 + {
560 + for (;;)
561 + {
562 +diff --git a/lib/ultrajsonenc.c b/lib/ultrajsonenc.c
563 +index 6c1b120..f330171 100644
564 +--- a/lib/ultrajsonenc.c
565 ++++ b/lib/ultrajsonenc.c
566 +@@ -112,7 +112,7 @@ static void SetError (JSOBJ obj, JSONObjectEncoder *enc, const char *message)
567 + /*
568 + FIXME: Keep track of how big these get across several encoder calls and try to make an estimate
569 + That way we won't run our head into the wall each call */
570 +-void Buffer_Realloc (JSONObjectEncoder *enc, size_t cbNeeded)
571 ++static void Buffer_Realloc (JSONObjectEncoder *enc, size_t cbNeeded)
572 + {
573 + size_t curSize = enc->end - enc->start;
574 + size_t newSize = curSize * 2;
575 +@@ -148,7 +148,7 @@ void Buffer_Realloc (JSONObjectEncoder *enc, size_t cbNeeded)
576 + enc->end = enc->start + newSize;
577 + }
578 +
579 +-FASTCALL_ATTR INLINE_PREFIX void FASTCALL_MSVC Buffer_AppendShortHexUnchecked (char *outputOffset, unsigned short value)
580 ++static FASTCALL_ATTR INLINE_PREFIX void FASTCALL_MSVC Buffer_AppendShortHexUnchecked (char *outputOffset, unsigned short value)
581 + {
582 + *(outputOffset++) = g_hexChars[(value & 0xf000) >> 12];
583 + *(outputOffset++) = g_hexChars[(value & 0x0f00) >> 8];
584 +@@ -156,7 +156,7 @@ FASTCALL_ATTR INLINE_PREFIX void FASTCALL_MSVC Buffer_AppendShortHexUnchecked (c
585 + *(outputOffset++) = g_hexChars[(value & 0x000f) >> 0];
586 + }
587 +
588 +-int Buffer_EscapeStringUnvalidated (JSONObjectEncoder *enc, const char *io, const char *end)
589 ++static int Buffer_EscapeStringUnvalidated (JSONObjectEncoder *enc, const char *io, const char *end)
590 + {
591 + char *of = (char *) enc->offset;
592 +
593 +@@ -260,7 +260,7 @@ int Buffer_EscapeStringUnvalidated (JSONObjectEncoder *enc, const char *io, cons
594 + }
595 + }
596 +
597 +-int Buffer_EscapeStringValidated (JSOBJ obj, JSONObjectEncoder *enc, const char *io, const char *end)
598 ++static int Buffer_EscapeStringValidated (JSOBJ obj, JSONObjectEncoder *enc, const char *io, const char *end)
599 + {
600 + JSUTF32 ucs;
601 + char *of = (char *) enc->offset;
602 +@@ -498,19 +498,19 @@ int Buffer_EscapeStringValidated (JSOBJ obj, JSONObjectEncoder *enc, const char
603 + #define Buffer_AppendCharUnchecked(__enc, __chr) \
604 + *((__enc)->offset++) = __chr; \
605 +
606 +-FASTCALL_ATTR INLINE_PREFIX void FASTCALL_MSVC strreverse(char* begin, char* end)
607 ++static FASTCALL_ATTR INLINE_PREFIX void FASTCALL_MSVC strreverse(char* begin, char* end)
608 + {
609 + char aux;
610 + while (end > begin)
611 + aux = *end, *end-- = *begin, *begin++ = aux;
612 + }
613 +
614 +-void Buffer_AppendIndentNewlineUnchecked(JSONObjectEncoder *enc)
615 ++static void Buffer_AppendIndentNewlineUnchecked(JSONObjectEncoder *enc)
616 + {
617 + if (enc->indent > 0) Buffer_AppendCharUnchecked(enc, '\n');
618 + }
619 +
620 +-void Buffer_AppendIndentUnchecked(JSONObjectEncoder *enc, JSINT32 value)
621 ++static void Buffer_AppendIndentUnchecked(JSONObjectEncoder *enc, JSINT32 value)
622 + {
623 + int i;
624 + if (enc->indent > 0)
625 +@@ -519,7 +519,7 @@ void Buffer_AppendIndentUnchecked(JSONObjectEncoder *enc, JSINT32 value)
626 + Buffer_AppendCharUnchecked(enc, ' ');
627 + }
628 +
629 +-void Buffer_AppendIntUnchecked(JSONObjectEncoder *enc, JSINT32 value)
630 ++static void Buffer_AppendIntUnchecked(JSONObjectEncoder *enc, JSINT32 value)
631 + {
632 + char* wstr;
633 + JSUINT32 uvalue = (value < 0) ? -value : value;
634 +@@ -535,7 +535,7 @@ void Buffer_AppendIntUnchecked(JSONObjectEncoder *enc, JSINT32 value)
635 + enc->offset += (wstr - (enc->offset));
636 + }
637 +
638 +-void Buffer_AppendLongUnchecked(JSONObjectEncoder *enc, JSINT64 value)
639 ++static void Buffer_AppendLongUnchecked(JSONObjectEncoder *enc, JSINT64 value)
640 + {
641 + char* wstr;
642 + JSUINT64 uvalue = (value < 0) ? -value : value;
643 +@@ -551,7 +551,7 @@ void Buffer_AppendLongUnchecked(JSONObjectEncoder *enc, JSINT64 value)
644 + enc->offset += (wstr - (enc->offset));
645 + }
646 +
647 +-void Buffer_AppendUnsignedLongUnchecked(JSONObjectEncoder *enc, JSUINT64 value)
648 ++static void Buffer_AppendUnsignedLongUnchecked(JSONObjectEncoder *enc, JSUINT64 value)
649 + {
650 + char* wstr;
651 + JSUINT64 uvalue = value;
652 +@@ -566,7 +566,7 @@ void Buffer_AppendUnsignedLongUnchecked(JSONObjectEncoder *enc, JSUINT64 value)
653 + enc->offset += (wstr - (enc->offset));
654 + }
655 +
656 +-int Buffer_AppendDoubleUnchecked(JSOBJ obj, JSONObjectEncoder *enc, double value)
657 ++static int Buffer_AppendDoubleUnchecked(JSOBJ obj, JSONObjectEncoder *enc, double value)
658 + {
659 + /* if input is larger than thres_max, revert to exponential */
660 + const double thres_max = (double) 1e16 - 1;
661 +@@ -714,7 +714,7 @@ Handle integration functions returning NULL here */
662 + FIXME:
663 + Perhaps implement recursion detection */
664 +
665 +-void encode(JSOBJ obj, JSONObjectEncoder *enc, const char *name, size_t cbName)
666 ++static void encode(JSOBJ obj, JSONObjectEncoder *enc, const char *name, size_t cbName)
667 + {
668 + const char *value;
669 + char *objName;
670 +diff --git a/python/JSONtoObj.c b/python/JSONtoObj.c
671 +index 79d9f1a..6cef088 100644
672 +--- a/python/JSONtoObj.c
673 ++++ b/python/JSONtoObj.c
674 +@@ -43,7 +43,7 @@ http://www.opensource.apple.com/source/tcl/tcl-14/tcl/license.terms
675 + //#define PRINTMARK() fprintf(stderr, "%s: MARK(%d)\n", __FILE__, __LINE__)
676 + #define PRINTMARK()
677 +
678 +-void Object_objectAddKey(void *prv, JSOBJ obj, JSOBJ name, JSOBJ value)
679 ++static void Object_objectAddKey(void *prv, JSOBJ obj, JSOBJ name, JSOBJ value)
680 + {
681 + PyDict_SetItem (obj, name, value);
682 + Py_DECREF( (PyObject *) name);
683 +@@ -51,59 +51,59 @@ void Object_objectAddKey(void *prv, JSOBJ obj, JSOBJ name, JSOBJ value)
684 + return;
685 + }
686 +
687 +-void Object_arrayAddItem(void *prv, JSOBJ obj, JSOBJ value)
688 ++static void Object_arrayAddItem(void *prv, JSOBJ obj, JSOBJ value)
689 + {
690 + PyList_Append(obj, value);
691 + Py_DECREF( (PyObject *) value);
692 + return;
693 + }
694 +
695 +-JSOBJ Object_newString(void *prv, wchar_t *start, wchar_t *end)
696 ++static JSOBJ Object_newString(void *prv, wchar_t *start, wchar_t *end)
697 + {
698 + return PyUnicode_FromWideChar (start, (end - start));
699 + }
700 +
701 +-JSOBJ Object_newTrue(void *prv)
702 ++static JSOBJ Object_newTrue(void *prv)
703 + {
704 + Py_RETURN_TRUE;
705 + }
706 +
707 +-JSOBJ Object_newFalse(void *prv)
708 ++static JSOBJ Object_newFalse(void *prv)
709 + {
710 + Py_RETURN_FALSE;
711 + }
712 +
713 +-JSOBJ Object_newNull(void *prv)
714 ++static JSOBJ Object_newNull(void *prv)
715 + {
716 + Py_RETURN_NONE;
717 + }
718 +
719 +-JSOBJ Object_newObject(void *prv)
720 ++static JSOBJ Object_newObject(void *prv)
721 + {
722 + return PyDict_New();
723 + }
724 +
725 +-JSOBJ Object_newArray(void *prv)
726 ++static JSOBJ Object_newArray(void *prv)
727 + {
728 + return PyList_New(0);
729 + }
730 +
731 +-JSOBJ Object_newInteger(void *prv, JSINT32 value)
732 ++static JSOBJ Object_newInteger(void *prv, JSINT32 value)
733 + {
734 + return PyInt_FromLong( (long) value);
735 + }
736 +
737 +-JSOBJ Object_newLong(void *prv, JSINT64 value)
738 ++static JSOBJ Object_newLong(void *prv, JSINT64 value)
739 + {
740 + return PyLong_FromLongLong (value);
741 + }
742 +
743 +-JSOBJ Object_newUnsignedLong(void *prv, JSUINT64 value)
744 ++static JSOBJ Object_newUnsignedLong(void *prv, JSUINT64 value)
745 + {
746 + return PyLong_FromUnsignedLongLong (value);
747 + }
748 +
749 +-JSOBJ Object_newDouble(void *prv, double value)
750 ++static JSOBJ Object_newDouble(void *prv, double value)
751 + {
752 + return PyFloat_FromDouble(value);
753 + }
754 +diff --git a/python/objToJSON.c b/python/objToJSON.c
755 +index 04a4575..1960d40 100644
756 +--- a/python/objToJSON.c
757 ++++ b/python/objToJSON.c
758 +@@ -226,7 +226,7 @@ static void *PyDateToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size
759 + return NULL;
760 + }
761 +
762 +-int Tuple_iterNext(JSOBJ obj, JSONTypeContext *tc)
763 ++static int Tuple_iterNext(JSOBJ obj, JSONTypeContext *tc)
764 + {
765 + PyObject *item;
766 +
767 +@@ -242,21 +242,21 @@ int Tuple_iterNext(JSOBJ obj, JSONTypeContext *tc)
768 + return 1;
769 + }
770 +
771 +-void Tuple_iterEnd(JSOBJ obj, JSONTypeContext *tc)
772 ++static void Tuple_iterEnd(JSOBJ obj, JSONTypeContext *tc)
773 + {
774 + }
775 +
776 +-JSOBJ Tuple_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
777 ++static JSOBJ Tuple_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
778 + {
779 + return GET_TC(tc)->itemValue;
780 + }
781 +
782 +-char *Tuple_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
783 ++static char *Tuple_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
784 + {
785 + return NULL;
786 + }
787 +
788 +-int Iter_iterNext(JSOBJ obj, JSONTypeContext *tc)
789 ++static int Iter_iterNext(JSOBJ obj, JSONTypeContext *tc)
790 + {
791 + PyObject *item;
792 +
793 +@@ -282,7 +282,7 @@ int Iter_iterNext(JSOBJ obj, JSONTypeContext *tc)
794 + return 1;
795 + }
796 +
797 +-void Iter_iterEnd(JSOBJ obj, JSONTypeContext *tc)
798 ++static void Iter_iterEnd(JSOBJ obj, JSONTypeContext *tc)
799 + {
800 + if (GET_TC(tc)->itemValue)
801 + {
802 +@@ -297,17 +297,17 @@ void Iter_iterEnd(JSOBJ obj, JSONTypeContext *tc)
803 + }
804 + }
805 +
806 +-JSOBJ Iter_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
807 ++static JSOBJ Iter_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
808 + {
809 + return GET_TC(tc)->itemValue;
810 + }
811 +
812 +-char *Iter_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
813 ++static char *Iter_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
814 + {
815 + return NULL;
816 + }
817 +
818 +-void Dir_iterEnd(JSOBJ obj, JSONTypeContext *tc)
819 ++static void Dir_iterEnd(JSOBJ obj, JSONTypeContext *tc)
820 + {
821 + if (GET_TC(tc)->itemValue)
822 + {
823 +@@ -325,7 +325,7 @@ void Dir_iterEnd(JSOBJ obj, JSONTypeContext *tc)
824 + PRINTMARK();
825 + }
826 +
827 +-int Dir_iterNext(JSOBJ _obj, JSONTypeContext *tc)
828 ++static int Dir_iterNext(JSOBJ _obj, JSONTypeContext *tc)
829 + {
830 + PyObject *obj = (PyObject *) _obj;
831 + PyObject *itemValue = GET_TC(tc)->itemValue;
832 +@@ -401,20 +401,20 @@ int Dir_iterNext(JSOBJ _obj, JSONTypeContext *tc)
833 + return 1;
834 + }
835 +
836 +-JSOBJ Dir_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
837 ++static JSOBJ Dir_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
838 + {
839 + PRINTMARK();
840 + return GET_TC(tc)->itemValue;
841 + }
842 +
843 +-char *Dir_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
844 ++static char *Dir_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
845 + {
846 + PRINTMARK();
847 + *outLen = PyString_GET_SIZE(GET_TC(tc)->itemName);
848 + return PyString_AS_STRING(GET_TC(tc)->itemName);
849 + }
850 +
851 +-int List_iterNext(JSOBJ obj, JSONTypeContext *tc)
852 ++static int List_iterNext(JSOBJ obj, JSONTypeContext *tc)
853 + {
854 + if (GET_TC(tc)->index >= GET_TC(tc)->size)
855 + {
856 +@@ -427,16 +427,16 @@ int List_iterNext(JSOBJ obj, JSONTypeContext *tc)
857 + return 1;
858 + }
859 +
860 +-void List_iterEnd(JSOBJ obj, JSONTypeContext *tc)
861 ++static void List_iterEnd(JSOBJ obj, JSONTypeContext *tc)
862 + {
863 + }
864 +
865 +-JSOBJ List_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
866 ++static JSOBJ List_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
867 + {
868 + return GET_TC(tc)->itemValue;
869 + }
870 +
871 +-char *List_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
872 ++static char *List_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
873 + {
874 + return NULL;
875 + }
876 +@@ -447,7 +447,7 @@ char *List_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
877 + // itemValue is borrowed from object (which is dict). No refCounting
878 + //=============================================================================
879 +
880 +-int Dict_iterNext(JSOBJ obj, JSONTypeContext *tc)
881 ++static int Dict_iterNext(JSOBJ obj, JSONTypeContext *tc)
882 + {
883 + #if PY_MAJOR_VERSION >= 3
884 + PyObject* itemNameTmp;
885 +@@ -488,7 +488,7 @@ int Dict_iterNext(JSOBJ obj, JSONTypeContext *tc)
886 + return 1;
887 + }
888 +
889 +-void Dict_iterEnd(JSOBJ obj, JSONTypeContext *tc)
890 ++static void Dict_iterEnd(JSOBJ obj, JSONTypeContext *tc)
891 + {
892 + if (GET_TC(tc)->itemName)
893 + {
894 +@@ -499,18 +499,18 @@ void Dict_iterEnd(JSOBJ obj, JSONTypeContext *tc)
895 + PRINTMARK();
896 + }
897 +
898 +-JSOBJ Dict_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
899 ++static JSOBJ Dict_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
900 + {
901 + return GET_TC(tc)->itemValue;
902 + }
903 +
904 +-char *Dict_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
905 ++static char *Dict_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
906 + {
907 + *outLen = PyString_GET_SIZE(GET_TC(tc)->itemName);
908 + return PyString_AS_STRING(GET_TC(tc)->itemName);
909 + }
910 +
911 +-int SortedDict_iterNext(JSOBJ obj, JSONTypeContext *tc)
912 ++static int SortedDict_iterNext(JSOBJ obj, JSONTypeContext *tc)
913 + {
914 + PyObject *items = NULL, *item = NULL, *key = NULL, *value = NULL;
915 + Py_ssize_t i, nitems;
916 +@@ -603,7 +603,7 @@ error:
917 + return -1;
918 + }
919 +
920 +-void SortedDict_iterEnd(JSOBJ obj, JSONTypeContext *tc)
921 ++static void SortedDict_iterEnd(JSOBJ obj, JSONTypeContext *tc)
922 + {
923 + GET_TC(tc)->itemName = NULL;
924 + GET_TC(tc)->itemValue = NULL;
925 +@@ -612,19 +612,19 @@ void SortedDict_iterEnd(JSOBJ obj, JSONTypeContext *tc)
926 + PRINTMARK();
927 + }
928 +
929 +-JSOBJ SortedDict_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
930 ++static JSOBJ SortedDict_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
931 + {
932 + return GET_TC(tc)->itemValue;
933 + }
934 +
935 +-char *SortedDict_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
936 ++static char *SortedDict_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
937 + {
938 + *outLen = PyString_GET_SIZE(GET_TC(tc)->itemName);
939 + return PyString_AS_STRING(GET_TC(tc)->itemName);
940 + }
941 +
942 +
943 +-void SetupDictIter(PyObject *dictObj, TypeContext *pc, JSONObjectEncoder *enc)
944 ++static void SetupDictIter(PyObject *dictObj, TypeContext *pc, JSONObjectEncoder *enc)
945 + {
946 + if (enc->sortKeys) {
947 + pc->iterEnd = SortedDict_iterEnd;
948 +@@ -642,7 +642,7 @@ void SetupDictIter(PyObject *dictObj, TypeContext *pc, JSONObjectEncoder *enc)
949 + pc->index = 0;
950 + }
951 +
952 +-void Object_beginTypeContext (JSOBJ _obj, JSONTypeContext *tc, JSONObjectEncoder *enc)
953 ++static void Object_beginTypeContext (JSOBJ _obj, JSONTypeContext *tc, JSONObjectEncoder *enc)
954 + {
955 + PyObject *obj, *exc, *iter;
956 + TypeContext *pc;
957 +@@ -929,7 +929,7 @@ INVALID:
958 + return;
959 + }
960 +
961 +-void Object_endTypeContext(JSOBJ obj, JSONTypeContext *tc)
962 ++static void Object_endTypeContext(JSOBJ obj, JSONTypeContext *tc)
963 + {
964 + Py_XDECREF(GET_TC(tc)->newObj);
965 +
966 +@@ -937,33 +937,33 @@ void Object_endTypeContext(JSOBJ obj, JSONTypeContext *tc)
967 + tc->prv = NULL;
968 + }
969 +
970 +-const char *Object_getStringValue(JSOBJ obj, JSONTypeContext *tc, size_t *_outLen)
971 ++static const char *Object_getStringValue(JSOBJ obj, JSONTypeContext *tc, size_t *_outLen)
972 + {
973 + return GET_TC(tc)->PyTypeToJSON (obj, tc, NULL, _outLen);
974 + }
975 +
976 +-JSINT64 Object_getLongValue(JSOBJ obj, JSONTypeContext *tc)
977 ++static JSINT64 Object_getLongValue(JSOBJ obj, JSONTypeContext *tc)
978 + {
979 + JSINT64 ret;
980 + GET_TC(tc)->PyTypeToJSON (obj, tc, &ret, NULL);
981 + return ret;
982 + }
983 +
984 +-JSUINT64 Object_getUnsignedLongValue(JSOBJ obj, JSONTypeContext *tc)
985 ++static JSUINT64 Object_getUnsignedLongValue(JSOBJ obj, JSONTypeContext *tc)
986 + {
987 + JSUINT64 ret;
988 + GET_TC(tc)->PyTypeToJSON (obj, tc, &ret, NULL);
989 + return ret;
990 + }
991 +
992 +-JSINT32 Object_getIntValue(JSOBJ obj, JSONTypeContext *tc)
993 ++static JSINT32 Object_getIntValue(JSOBJ obj, JSONTypeContext *tc)
994 + {
995 + JSINT32 ret;
996 + GET_TC(tc)->PyTypeToJSON (obj, tc, &ret, NULL);
997 + return ret;
998 + }
999 +
1000 +-double Object_getDoubleValue(JSOBJ obj, JSONTypeContext *tc)
1001 ++static double Object_getDoubleValue(JSOBJ obj, JSONTypeContext *tc)
1002 + {
1003 + double ret;
1004 + GET_TC(tc)->PyTypeToJSON (obj, tc, &ret, NULL);
1005 +@@ -975,22 +975,22 @@ static void Object_releaseObject(JSOBJ _obj)
1006 + Py_DECREF( (PyObject *) _obj);
1007 + }
1008 +
1009 +-int Object_iterNext(JSOBJ obj, JSONTypeContext *tc)
1010 ++static int Object_iterNext(JSOBJ obj, JSONTypeContext *tc)
1011 + {
1012 + return GET_TC(tc)->iterNext(obj, tc);
1013 + }
1014 +
1015 +-void Object_iterEnd(JSOBJ obj, JSONTypeContext *tc)
1016 ++static void Object_iterEnd(JSOBJ obj, JSONTypeContext *tc)
1017 + {
1018 + GET_TC(tc)->iterEnd(obj, tc);
1019 + }
1020 +
1021 +-JSOBJ Object_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
1022 ++static JSOBJ Object_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
1023 + {
1024 + return GET_TC(tc)->iterGetValue(obj, tc);
1025 + }
1026 +
1027 +-char *Object_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
1028 ++static char *Object_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
1029 + {
1030 + return GET_TC(tc)->iterGetName(obj, tc, outLen);
1031 + }
1032
1033 diff --git a/dev-python/ujson/ujson-1.35.ebuild b/dev-python/ujson/ujson-1.35.ebuild
1034 new file mode 100644
1035 index 00000000000..19d94beed91
1036 --- /dev/null
1037 +++ b/dev-python/ujson/ujson-1.35.ebuild
1038 @@ -0,0 +1,33 @@
1039 +# Copyright 1999-2017 Gentoo Foundation
1040 +# Distributed under the terms of the GNU General Public License v2
1041 +
1042 +EAPI=6
1043 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
1044 +
1045 +inherit distutils-r1
1046 +
1047 +DESCRIPTION="Ultra fast JSON encoder and decoder for Python"
1048 +HOMEPAGE="https://pypi.python.org/pypi/ujson/"
1049 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
1050 +
1051 +LICENSE="BSD"
1052 +SLOT="0"
1053 +KEYWORDS="~amd64 ~arm ~x86"
1054 +IUSE="test"
1055 +
1056 +DEPEND="
1057 + dev-python/setuptools[${PYTHON_USEDEP}]"
1058 +RDEPEND="${DEPEND}"
1059 +
1060 +PATCHES=(
1061 + "${FILESDIR}/${P}-sort_keys-segfault.patch"
1062 + "${FILESDIR}/${P}-use-static-where-possible.patch"
1063 + "${FILESDIR}/${P}-fix-for-overflowing-long.patch"
1064 + "${FILESDIR}/${P}-standard-handling-of-none.patch"
1065 + "${FILESDIR}/${P}-fix-ordering-of-orderdict.patch"
1066 + "${FILESDIR}/${P}-test-depricationwarning.patch"
1067 +)
1068 +
1069 +python_test() {
1070 + "${PYTHON}" tests/tests.py || die
1071 +}