upgrading.rst (jansson-2.13.1.tar.bz2) | : | upgrading.rst (jansson-2.14.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 47 | skipping to change at line 47 | |||
argument. For example:: | argument. For example:: | |||
/* old code */ | /* old code */ | |||
json_loads(input, &error); | json_loads(input, &error); | |||
/* new code */ | /* new code */ | |||
json_loads(input, 0, &error); | json_loads(input, 0, &error); | |||
**Underlying type of JSON integers** | **Underlying type of JSON integers** | |||
The underlying C type of JSON integers has been changed from | The underlying C type of JSON integers has been changed from | |||
:type:`int` to the widest available signed integer type, i.e. | ``int`` to the widest available signed integer type, i.e. | |||
:type:`long long` or :type:`long`, depending on whether | ``long long`` or ``long``, depending on whether | |||
:type:`long long` is supported on your system or not. This makes | ``long long`` is supported on your system or not. This makes | |||
the whole 64-bit integer range available on most modern systems. | the whole 64-bit integer range available on most modern systems. | |||
``jansson.h`` has a typedef :type:`json_int_t` to the underlying | ``jansson.h`` has a typedef :type:`json_int_t` to the underlying | |||
integer type. :type:`int` should still be used in most cases when | integer type. ``int`` should still be used in most cases when | |||
dealing with smallish JSON integers, as the compiler handles | dealing with smallish JSON integers, as the compiler handles | |||
implicit type coercion. Only when the full 64-bit range is needed, | implicit type coercion. Only when the full 64-bit range is needed, | |||
:type:`json_int_t` should be explicitly used. | :type:`json_int_t` should be explicitly used. | |||
**Maximum encoder indentation depth** | **Maximum encoder indentation depth** | |||
The maximum argument of the ``JSON_INDENT()`` macro has been | The maximum argument of the ``JSON_INDENT()`` macro has been | |||
changed from 255 to 31, to free up bits from the ``flags`` | changed from 255 to 31, to free up bits from the ``flags`` | |||
parameter of :func:`json_dumps()`, :func:`json_dumpf()` and | parameter of :func:`json_dumps()`, :func:`json_dumpf()` and | |||
:func:`json_dump_file()`. If your code uses a bigger indentation | :func:`json_dump_file()`. If your code uses a bigger indentation | |||
than 31, it needs to be changed. | than 31, it needs to be changed. | |||
**Unsigned integers in API functions** | **Unsigned integers in API functions** | |||
Version 2.0 unifies unsigned integer usage in the API. All uses of | Version 2.0 unifies unsigned integer usage in the API. All uses of | |||
:type:`unsigned int` and :type:`unsigned long` have been replaced | ``unsigned int`` and ``unsigned long`` have been replaced | |||
with :type:`size_t`. This includes flags, container sizes, etc. | with ``size_t``. This includes flags, container sizes, etc. | |||
This should not require source code changes, as both | This should not require source code changes, as both | |||
:type:`unsigned int` and :type:`unsigned long` are usually | ``unsigned int`` and ``unsigned long`` are usually | |||
compatible with :type:`size_t`. | compatible with ``size_t``. | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added |