summaryrefslogtreecommitdiffstatshomepage
path: root/py/binary.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-07-03 13:25:24 +0100
committerDamien George <damien.p.george@gmail.com>2014-07-03 13:25:24 +0100
commit40f3c026823f8951a2fa04e9c7fc93c75bc27bec (patch)
treec9c8210654c7114f00c5234a8481d9b5fbd28ce0 /py/binary.c
parent065aba587571150074ea79483ffa72c0fe6bc8c8 (diff)
downloadmicropython-40f3c026823f8951a2fa04e9c7fc93c75bc27bec.tar.gz
micropython-40f3c026823f8951a2fa04e9c7fc93c75bc27bec.zip
Rename machine_(u)int_t to mp_(u)int_t.
See discussion in issue #50.
Diffstat (limited to 'py/binary.c')
-rw-r--r--py/binary.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/py/binary.c b/py/binary.c
index d755bc86e0..a0af97208d 100644
--- a/py/binary.c
+++ b/py/binary.c
@@ -88,7 +88,7 @@ int mp_binary_get_size(char struct_type, char val_type, uint *palign) {
}
mp_obj_t mp_binary_get_val_array(char typecode, void *p, int index) {
- machine_int_t val = 0;
+ mp_int_t val = 0;
switch (typecode) {
case 'b':
val = ((int8_t*)p)[index];
@@ -125,7 +125,7 @@ mp_obj_t mp_binary_get_val_array(char typecode, void *p, int index) {
return MP_OBJ_NEW_SMALL_INT(val);
}
-machine_int_t mp_binary_get_int(uint size, bool is_signed, bool big_endian, byte *p) {
+mp_int_t mp_binary_get_int(uint size, bool is_signed, bool big_endian, byte *p) {
int delta;
if (!big_endian) {
delta = -1;
@@ -134,7 +134,7 @@ machine_int_t mp_binary_get_int(uint size, bool is_signed, bool big_endian, byte
delta = 1;
}
- machine_int_t val = 0;
+ mp_int_t val = 0;
if (is_signed && *p & 0x80) {
val = -1;
}
@@ -155,7 +155,7 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr) {
int size = mp_binary_get_size(struct_type, val_type, &align);
if (struct_type == '@') {
// Make pointer aligned
- p = (byte*)(((machine_uint_t)p + align - 1) & ~((machine_uint_t)align - 1));
+ p = (byte*)(((mp_uint_t)p + align - 1) & ~((mp_uint_t)align - 1));
#if MP_ENDIANNESS_LITTLE
struct_type = '<';
#else
@@ -164,7 +164,7 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr) {
}
*ptr = p + size;
- machine_int_t val = mp_binary_get_int(size, is_signed(val_type), (struct_type == '>'), p);
+ mp_int_t val = mp_binary_get_int(size, is_signed(val_type), (struct_type == '>'), p);
if (val_type == 'O') {
return (mp_obj_t)val;
@@ -184,7 +184,7 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte **
int size = mp_binary_get_size(struct_type, val_type, &align);
if (struct_type == '@') {
// Make pointer aligned
- p = (byte*)(((machine_uint_t)p + align - 1) & ~((machine_uint_t)align - 1));
+ p = (byte*)(((mp_uint_t)p + align - 1) & ~((mp_uint_t)align - 1));
#if MP_ENDIANNESS_LITTLE
struct_type = '<';
#else
@@ -196,7 +196,7 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte **
#if MP_ENDIANNESS_BIG
#error Not implemented
#endif
- machine_int_t val;
+ mp_int_t val;
byte *in = (byte*)&val;
switch (val_type) {
case 'O':
@@ -239,7 +239,7 @@ void mp_binary_set_val_array(char typecode, void *p, int index, mp_obj_t val_in)
}
}
-void mp_binary_set_val_array_from_int(char typecode, void *p, int index, machine_int_t val) {
+void mp_binary_set_val_array_from_int(char typecode, void *p, int index, mp_int_t val) {
switch (typecode) {
case 'b':
((int8_t*)p)[index] = val;