Browse Source

Minor typing changes

Change array type back to unsigned (accidentally changed to signed
previously).  Make codepoint types "fast integer" variants, as they're
used in loops and such, and are not used in significant structs.  This
increases code footprint by ~200 bytes but is the better choice as it
also simplifies API typing.
pull/30/head
Sami Vaarala 11 years ago
parent
commit
ce46f0dc49
  1. 10
      src/duk_features.h.in

10
src/duk_features.h.in

@ -893,14 +893,14 @@ typedef duk_small_int_t duk_bool_t;
/* Index values must have at least 32-bit signed range. */
typedef duk_int_t duk_idx_t;
/* Array index values, currently same type, could be exact 32 bits. */
typedef duk_int_t duk_arridx_t;
/* Array index values, could be exact 32 bits. */
typedef duk_uint_t duk_arridx_t;
/* Duktape/C function return value, platform int is enough for now to
* represent 0, 1, or negative error code. Must be compatible with
* assigning truth values (e.g. duk_ret_t rc = (foo == bar);).
*/
typedef int duk_ret_t;
typedef duk_small_int_t duk_ret_t;
/* Error codes are represented with platform int. */
typedef duk_small_int_t duk_errcode_t;
@ -912,8 +912,8 @@ typedef duk_small_int_t duk_errcode_t;
* ensure duk_uint32_t casts back and forth nicely. Almost everything
* else uses the signed one.
*/
typedef duk_int32_t duk_codepoint_t;
typedef duk_uint32_t duk_ucodepoint_t;
typedef duk_int_fast32_t duk_codepoint_t;
typedef duk_uint_fast32_t duk_ucodepoint_t;
/* IEEE double typedef. */
typedef double duk_double_t;

Loading…
Cancel
Save