summaryrefslogtreecommitdiffstatshomepage
path: root/py/vstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/vstr.c')
-rw-r--r--py/vstr.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/py/vstr.c b/py/vstr.c
index 80841b24ca..76232cc100 100644
--- a/py/vstr.c
+++ b/py/vstr.c
@@ -11,11 +11,11 @@ void vstr_init(vstr_t *vstr) {
vstr->len = 0;
vstr->buf = m_new(char, vstr->alloc);
if (vstr->buf == NULL) {
- vstr->had_error = true;
+ vstr->had_error = MP_TRUE;
return;
}
vstr->buf[0] = 0;
- vstr->had_error = false;
+ vstr->had_error = MP_FALSE;
}
void vstr_clear(vstr_t *vstr) {
@@ -42,10 +42,10 @@ void vstr_free(vstr_t *vstr) {
void vstr_reset(vstr_t *vstr) {
vstr->len = 0;
vstr->buf[0] = 0;
- vstr->had_error = false;
+ vstr->had_error = MP_FALSE;
}
-bool vstr_had_error(vstr_t *vstr) {
+MP_BOOL vstr_had_error(vstr_t *vstr) {
return vstr->had_error;
}
@@ -63,23 +63,23 @@ int vstr_len(vstr_t *vstr) {
return vstr->len;
}
-bool vstr_ensure_extra(vstr_t *vstr, int size) {
+MP_BOOL vstr_ensure_extra(vstr_t *vstr, int size) {
if (vstr->len + size + 1 > vstr->alloc) {
int new_alloc = ROUND_ALLOC((vstr->len + size + 1) * 2);
char *new_buf = m_renew(char, vstr->buf, vstr->alloc, new_alloc);
if (new_buf == NULL) {
- vstr->had_error = true;
- return false;
+ vstr->had_error = MP_TRUE;
+ return MP_FALSE;
}
vstr->alloc = new_alloc;
vstr->buf = new_buf;
}
- return true;
+ return MP_TRUE;
}
void vstr_hint_size(vstr_t *vstr, int size) {
// it's not an error if we fail to allocate for the size hint
- bool er = vstr->had_error;
+ MP_BOOL er = vstr->had_error;
vstr_ensure_extra(vstr, size);
vstr->had_error = er;
}