Merge branch '1.3'
authorPetri Lehtinen <petri@digip.org>
Sat, 14 Aug 2010 18:02:08 +0000 (21:02 +0300)
committerPetri Lehtinen <petri@digip.org>
Sat, 14 Aug 2010 18:02:08 +0000 (21:02 +0300)
Conflicts:
doc/apiref.rst
src/jansson_private.h

1  2 
configure.ac
doc/apiref.rst
doc/conformance.rst
src/Makefile.am
src/jansson.h
src/jansson_private.h
src/value.c

diff --cc configure.ac
Simple merge
diff --cc doc/apiref.rst
@@@ -287,46 -293,13 +293,52 @@@ U+10FFFF are allowed
  Number
  ======
  
 -.. cfunction:: json_t *json_integer(int value)
+ The JSON specification only contains one numeric type, "number". The C
+ programming language has distinct types for integer and floating-point
+ numbers, so for practical reasons Jansson also has distinct types for
+ the two. They are called "integer" and "real", respectively. For more
+ information, see :ref:`rfc-conformance`.
 +.. ctype:: json_int_t
 +
 +   This is the C type that is used to store JSON integer values. It
 +   represents the widest integer type available on your system. In
 +   practice it's just a typedef of ``long long`` if your compiler
 +   supports it, otherwise ``long``.
 +
 +   Usually, you can safely use plain ``int`` in place of
 +   ``json_int_t``, and the implicit C integer conversion handles the
 +   rest. Only when you know that you need the full 64-bit range, you
 +   should use ``json_int_t`` explicitly.
 +
 +``JSON_INTEGER_IS_LONG_LONG``
 +
 +   This is a preprocessor variable that holds the value 1 if
 +   :ctype:`json_int_t` is ``long long``, and 0 if it's ``long``. It
 +   can be used as follows::
 +
 +       #if JSON_INTEGER_IS_LONG_LONG
 +       /* Code specific for long long */
 +       #else
 +       /* Code specific for long */
 +       #endif
 +
 +``JSON_INTEGER_FORMAT``
 +
 +   This is a macro that expands to a :cfunc:`printf()` conversion
 +   specifier that corresponds to :ctype:`json_int_t`, without the
 +   leading ``%`` sign, i.e. either ``"lld"`` or ``"ld"``. This macro
 +   is required because the actual type of :ctype:`json_int_t` can be
 +   either ``long`` or ``long long``, and :cfunc:`printf()` reuiqres
 +   different length modifiers for the two.
 +
 +   Example::
 +
 +       json_int_t x = 123123123;
 +       printf("x is %" JSON_INTEGER_FORMAT "\n", x);
 +
 +
 +.. cfunction:: json_t *json_integer(json_int_t value)
  
     .. refcounting:: new
  
Simple merge
diff --cc src/Makefile.am
Simple merge
diff --cc src/jansson.h
Simple merge
@@@ -51,8 -52,8 +52,8 @@@ typedef struct 
  #define json_to_integer(json_) container_of(json_, json_integer_t, json)
  
  typedef struct {
 -    unsigned long serial;
 +    size_t serial;
-     char key[];
+     char key[1];
  } object_key_t;
  
  const object_key_t *jsonp_object_iter_fullkey(void *iter);
diff --cc src/value.c
Simple merge