Commit 55baff4c authored by Damien George's avatar Damien George
Browse files

Revamp qstrs: they now include length and hash.

Can now have null bytes in strings.  Can define ROM qstrs per port using
qstrdefsport.h
parent 91d457a2
......@@ -4,7 +4,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
......
......@@ -6,6 +6,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
......
......@@ -5,6 +5,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
......
......@@ -6,6 +6,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
......
......@@ -6,7 +6,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "runtime0.h"
#include "map.h"
......
......@@ -6,7 +6,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "runtime0.h"
#include "runtime.h"
......
......@@ -3,6 +3,7 @@
#include "misc.h"
#include "mpconfig.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
......
......@@ -7,7 +7,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "objtuple.h"
......@@ -100,7 +100,7 @@ mp_obj_t mp_obj_new_exception_msg_varg(qstr id, const char *fmt, ...) {
va_start(ap, fmt);
vstr_vprintf(vstr, fmt, ap);
va_end(ap);
o->msg = qstr_from_str_take(vstr->buf, vstr->alloc);
o->msg = qstr_from_strn_take(vstr->buf, vstr->alloc, vstr->len);
}
return o;
......
......@@ -4,7 +4,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
......
......@@ -6,7 +6,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "runtime0.h"
......
......@@ -6,7 +6,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "map.h"
#include "runtime.h"
......
......@@ -6,7 +6,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
#include "bc.h"
......
......@@ -6,7 +6,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "objint.h"
......
......@@ -6,7 +6,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "objint.h"
#include "runtime0.h"
......
......@@ -6,7 +6,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "map.h"
#include "runtime0.h"
......@@ -259,8 +259,8 @@ mp_obj_t mp_obj_list_sort(uint n_args, const mp_obj_t *args, mp_map_t *kwargs) {
}
mp_obj_list_t *self = args[0];
if (self->len > 1) {
mp_map_elem_t *keyfun = mp_map_lookup(kwargs, MP_OBJ_NEW_QSTR(qstr_from_str_static("key")), MP_MAP_LOOKUP);
mp_map_elem_t *reverse = mp_map_lookup(kwargs, MP_OBJ_NEW_QSTR(qstr_from_str_static("reverse")), MP_MAP_LOOKUP);
mp_map_elem_t *keyfun = mp_map_lookup(kwargs, MP_OBJ_NEW_QSTR(QSTR_FROM_STR_STATIC("key")), MP_MAP_LOOKUP);
mp_map_elem_t *reverse = mp_map_lookup(kwargs, MP_OBJ_NEW_QSTR(QSTR_FROM_STR_STATIC("reverse")), MP_MAP_LOOKUP);
mp_quicksort(self->items, self->items + self->len - 1,
keyfun ? keyfun->value : NULL,
reverse && reverse->value ? rt_is_true(reverse->value) : false);
......
......@@ -4,7 +4,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
......
......@@ -6,7 +6,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
#include "map.h"
......
......@@ -4,6 +4,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "qstr.h"
#include "obj.h"
typedef struct _mp_obj_none_t {
......
......@@ -4,6 +4,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "qstr.h"
#include "obj.h"
/******************************************************************************/
......
......@@ -6,7 +6,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
#include "mpqstr.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
#include "runtime0.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment