Browse Source

all: Move BYTES_PER_WORD definition from ports to py/mpconfig.h

It can still be overwritten by a port in mpconfigport.h but for almost
all cases one can use the provided default.
pull/3013/head
Damien George 8 years ago
parent
commit
4c307bfba1
  1. 2
      bare-arm/mpconfigport.h
  2. 1
      cc3200/mpconfigport.h
  3. 2
      esp8266/mpconfigport.h
  4. 2
      examples/embedding/mpconfigport_minimal.h
  5. 2
      minimal/mpconfigport.h
  6. 2
      mpy-cross/mpconfigport.h
  7. 1
      pic16bit/mpconfigport.h
  8. 5
      py/mpconfig.h
  9. 2
      qemu-arm/mpconfigport.h
  10. 2
      stmhal/mpconfigport.h
  11. 2
      teensy/mpconfigport.h
  12. 2
      unix/mpconfigport.h
  13. 2
      unix/mpconfigport_minimal.h
  14. 2
      windows/mpconfigport.h
  15. 2
      zephyr/mpconfigport.h
  16. 2
      zephyr/mpconfigport_minimal.h

2
bare-arm/mpconfigport.h

@ -46,8 +46,6 @@
// type definitions for the specific machine
#define BYTES_PER_WORD (4)
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
#define UINT_FMT "%lu"

1
cc3200/mpconfigport.h

@ -200,7 +200,6 @@ extern const struct _mp_obj_module_t mp_module_ussl;
// type definitions for the specific machine
#define BYTES_PER_WORD (4)
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
#define MP_SSIZE_MAX (0x7FFFFFFF)

2
esp8266/mpconfigport.h

@ -118,8 +118,6 @@
// type definitions for the specific machine
#define BYTES_PER_WORD (4)
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p)))
#define MP_SSIZE_MAX (0x7fffffff)

2
examples/embedding/mpconfigport_minimal.h

@ -119,8 +119,6 @@ typedef int mp_int_t; // must be pointer size
typedef unsigned int mp_uint_t; // must be pointer size
#endif
#define BYTES_PER_WORD sizeof(mp_int_t)
// Cannot include <sys/types.h>, as it may lead to symbol name clashes
#if _FILE_OFFSET_BITS == 64 && !defined(__LP64__)
typedef long long mp_off_t;

2
minimal/mpconfigport.h

@ -57,8 +57,6 @@
// type definitions for the specific machine
#define BYTES_PER_WORD (4)
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
// This port is intended to be 32-bit, but unfortunately, int32_t for

2
mpy-cross/mpconfigport.h

@ -100,8 +100,6 @@ typedef int mp_int_t; // must be pointer size
typedef unsigned int mp_uint_t; // must be pointer size
#endif
#define BYTES_PER_WORD sizeof(mp_int_t)
// Cannot include <sys/types.h>, as it may lead to symbol name clashes
#if _FILE_OFFSET_BITS == 64 && !defined(__LP64__)
typedef long long mp_off_t;

1
pic16bit/mpconfigport.h

@ -68,7 +68,6 @@
// type definitions for the specific machine
#define MP_ENDIANNESS_LITTLE (1)
#define BYTES_PER_WORD (2)
#define MPZ_DIG_SIZE (8)
// The xc16 compiler doesn't seem to respect alignment (!!) so we

5
py/mpconfig.h

@ -1105,6 +1105,11 @@ typedef double mp_float_t;
#define STATIC static
#endif
// Number of bytes in a word
#ifndef BYTES_PER_WORD
#define BYTES_PER_WORD (sizeof(mp_uint_t))
#endif
#define BITS_PER_BYTE (8)
#define BITS_PER_WORD (BITS_PER_BYTE * BYTES_PER_WORD)
// mp_int_t value with most significant bit set

2
qemu-arm/mpconfigport.h

@ -39,8 +39,6 @@
// type definitions for the specific machine
#define BYTES_PER_WORD (4)
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
#define MP_SSIZE_MAX (0x7fffffff)

2
stmhal/mpconfigport.h

@ -264,8 +264,6 @@ extern const struct _mp_obj_module_t mp_module_network;
// type definitions for the specific machine
#define BYTES_PER_WORD (4)
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
#define MP_SSIZE_MAX (0x7fffffff)

2
teensy/mpconfigport.h

@ -54,8 +54,6 @@ extern const struct _mp_obj_module_t time_module;
// type definitions for the specific machine
#define BYTES_PER_WORD (4)
#define UINT_FMT "%u"
#define INT_FMT "%d"

2
unix/mpconfigport.h

@ -233,8 +233,6 @@ typedef unsigned int mp_uint_t; // must be pointer size
#endif
#endif
#define BYTES_PER_WORD sizeof(mp_int_t)
// Cannot include <sys/types.h>, as it may lead to symbol name clashes
#if _FILE_OFFSET_BITS == 64 && !defined(__LP64__)
typedef long long mp_off_t;

2
unix/mpconfigport_minimal.h

@ -127,8 +127,6 @@ typedef int mp_int_t; // must be pointer size
typedef unsigned int mp_uint_t; // must be pointer size
#endif
#define BYTES_PER_WORD sizeof(mp_int_t)
// Cannot include <sys/types.h>, as it may lead to symbol name clashes
#if _FILE_OFFSET_BITS == 64 && !defined(__LP64__)
typedef long long mp_off_t;

2
windows/mpconfigport.h

@ -128,8 +128,6 @@ typedef int mp_int_t; // must be pointer size
typedef unsigned int mp_uint_t; // must be pointer size
#endif
#define BYTES_PER_WORD sizeof(mp_int_t)
// Just assume Windows is little-endian - mingw32 gcc doesn't
// define standard endianness macros.
#define MP_ENDIANNESS_LITTLE (1)

2
zephyr/mpconfigport.h

@ -99,8 +99,6 @@ typedef void *machine_ptr_t; // must be of pointer size
typedef const void *machine_const_ptr_t; // must be of pointer size
typedef long mp_off_t;
#define BYTES_PER_WORD (sizeof(mp_int_t))
#define MP_STATE_PORT MP_STATE_VM
#define MICROPY_PORT_ROOT_POINTERS \

2
zephyr/mpconfigport_minimal.h

@ -85,8 +85,6 @@ typedef void *machine_ptr_t; // must be of pointer size
typedef const void *machine_const_ptr_t; // must be of pointer size
typedef long mp_off_t;
#define BYTES_PER_WORD (sizeof(mp_int_t))
#define MP_STATE_PORT MP_STATE_VM
#define MICROPY_PORT_ROOT_POINTERS \

Loading…
Cancel
Save