summaryrefslogtreecommitdiffstatshomepage
path: root/py/objcomplex.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-01 20:27:54 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-01 20:32:09 +0000
commit51dfcb4bb7613ed164952712d9a5235a7b833cde (patch)
treec1856c7db0ff6d5ae51190be4325804a0aad43f4 /py/objcomplex.c
parentdb1ac360c39aeedd28b6ef5d653faaa14c3ce01e (diff)
downloadmicropython-51dfcb4bb7613ed164952712d9a5235a7b833cde.tar.gz
micropython-51dfcb4bb7613ed164952712d9a5235a7b833cde.zip
py: Move to guarded includes, everywhere in py/ core.
Addresses issue #1022.
Diffstat (limited to 'py/objcomplex.c')
-rw-r--r--py/objcomplex.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/py/objcomplex.c b/py/objcomplex.c
index 2768a01e65..9e158fac69 100644
--- a/py/objcomplex.c
+++ b/py/objcomplex.c
@@ -28,21 +28,18 @@
#include <stdio.h>
#include <assert.h>
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "parsenum.h"
-#include "runtime0.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/obj.h"
+#include "py/parsenum.h"
+#include "py/runtime0.h"
+#include "py/runtime.h"
#if MICROPY_PY_BUILTINS_COMPLEX
#include <math.h>
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
-#include "formatfloat.h"
+#include "py/formatfloat.h"
#endif
typedef struct _mp_obj_complex_t {
@@ -58,12 +55,12 @@ STATIC void complex_print(void (*print)(void *env, const char *fmt, ...), void *
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
char buf[16];
if (o->real == 0) {
- format_float(o->imag, buf, sizeof(buf), 'g', 7, '\0');
+ mp_format_float(o->imag, buf, sizeof(buf), 'g', 7, '\0');
print(env, "%sj", buf);
} else {
- format_float(o->real, buf, sizeof(buf), 'g', 7, '\0');
+ mp_format_float(o->real, buf, sizeof(buf), 'g', 7, '\0');
print(env, "(%s+", buf);
- format_float(o->imag, buf, sizeof(buf), 'g', 7, '\0');
+ mp_format_float(o->imag, buf, sizeof(buf), 'g', 7, '\0');
print(env, "%sj)", buf);
}
#else