summaryrefslogtreecommitdiffstatshomepage
path: root/py/stream.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/stream.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/stream.c')
-rw-r--r--py/stream.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/py/stream.c b/py/stream.c
index cfdea15cca..98f62518a5 100644
--- a/py/stream.c
+++ b/py/stream.c
@@ -67,7 +67,7 @@ STATIC mp_obj_t stream_read(uint n_args, const mp_obj_t *args) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "Operation not supported"));
}
- machine_int_t sz;
+ mp_int_t sz;
if (n_args == 1 || ((sz = mp_obj_get_int(args[1])) == -1)) {
return stream_readall(args[0]);
}
@@ -80,7 +80,7 @@ STATIC mp_obj_t stream_read(uint n_args, const mp_obj_t *args) {
byte *buf = m_new(byte, sz);
int error;
- machine_int_t out_sz = o->type->stream_p->read(o, buf, sz, &error);
+ mp_int_t out_sz = o->type->stream_p->read(o, buf, sz, &error);
if (out_sz == -1) {
if (is_nonblocking_error(error)) {
// https://docs.python.org/3.4/library/io.html#io.RawIOBase.read
@@ -109,7 +109,7 @@ STATIC mp_obj_t stream_write(mp_obj_t self_in, mp_obj_t arg) {
mp_get_buffer_raise(arg, &bufinfo, MP_BUFFER_READ);
int error;
- machine_int_t out_sz = o->type->stream_p->write(self_in, bufinfo.buf, bufinfo.len, &error);
+ mp_int_t out_sz = o->type->stream_p->write(self_in, bufinfo.buf, bufinfo.len, &error);
if (out_sz == -1) {
if (is_nonblocking_error(error)) {
// http://docs.python.org/3/library/io.html#io.RawIOBase.write
@@ -139,7 +139,7 @@ STATIC mp_obj_t stream_readall(mp_obj_t self_in) {
int error;
int current_read = DEFAULT_BUFFER_SIZE;
while (true) {
- machine_int_t out_sz = o->type->stream_p->read(self_in, p, current_read, &error);
+ mp_int_t out_sz = o->type->stream_p->read(self_in, p, current_read, &error);
if (out_sz == -1) {
if (is_nonblocking_error(error)) {
// With non-blocking streams, we read as much as we can.
@@ -182,7 +182,7 @@ STATIC mp_obj_t stream_unbuffered_readline(uint n_args, const mp_obj_t *args) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "Operation not supported"));
}
- machine_int_t max_size = -1;
+ mp_int_t max_size = -1;
if (n_args > 1) {
max_size = MP_OBJ_SMALL_INT_VALUE(args[1]);
}
@@ -201,7 +201,7 @@ STATIC mp_obj_t stream_unbuffered_readline(uint n_args, const mp_obj_t *args) {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_MemoryError, "out of memory"));
}
- machine_int_t out_sz = o->type->stream_p->read(o, p, 1, &error);
+ mp_int_t out_sz = o->type->stream_p->read(o, p, 1, &error);
if (out_sz == -1) {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_OSError, "[Errno %d]", error));
}