summaryrefslogtreecommitdiffstatshomepage
path: root/py/misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'py/misc.h')
-rw-r--r--py/misc.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/py/misc.h b/py/misc.h
index 149ca8a518..1bf4d8f291 100644
--- a/py/misc.h
+++ b/py/misc.h
@@ -5,11 +5,7 @@
/** types *******************************************************/
-typedef int MP_BOOL;
-enum {
- MP_FALSE = 0,
- MP_TRUE = 1
-};
+#include <stdbool.h>
typedef unsigned char byte;
typedef unsigned int uint;
@@ -42,10 +38,10 @@ typedef int unichar; // TODO
unichar utf8_get_char(const char *s);
char *utf8_next_char(const char *s);
-MP_BOOL unichar_isspace(unichar c);
-MP_BOOL unichar_isalpha(unichar c);
-MP_BOOL unichar_isprint(unichar c);
-MP_BOOL unichar_isdigit(unichar c);
+bool unichar_isspace(unichar c);
+bool unichar_isalpha(unichar c);
+bool unichar_isprint(unichar c);
+bool unichar_isdigit(unichar c);
/** string ******************************************************/
@@ -59,7 +55,7 @@ typedef struct _vstr_t {
int alloc;
int len;
char *buf;
- MP_BOOL had_error;
+ bool had_error;
} vstr_t;
void vstr_init(vstr_t *vstr);
@@ -67,7 +63,7 @@ void vstr_clear(vstr_t *vstr);
vstr_t *vstr_new(void);
void vstr_free(vstr_t *vstr);
void vstr_reset(vstr_t *vstr);
-MP_BOOL vstr_had_error(vstr_t *vstr);
+bool vstr_had_error(vstr_t *vstr);
char *vstr_str(vstr_t *vstr);
int vstr_len(vstr_t *vstr);
void vstr_hint_size(vstr_t *vstr, int size);