aboutsummaryrefslogtreecommitdiff
path: root/py/qstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/qstr.c')
-rw-r--r--py/qstr.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/py/qstr.c b/py/qstr.c
index 940d09ea4..c3d78bfda 100644
--- a/py/qstr.c
+++ b/py/qstr.c
@@ -106,11 +106,11 @@ const qstr_pool_t mp_qstr_const_pool = {
MICROPY_ALLOC_QSTR_ENTRIES_INIT,
MP_QSTRnumber_of, // corresponds to number of strings in array just below
{
-#ifndef NO_QSTR
+ #ifndef NO_QSTR
#define QDEF(id, str) str,
-#include "genhdr/qstrdefs.generated.h"
+ #include "genhdr/qstrdefs.generated.h"
#undef QDEF
-#endif
+ #endif
},
};
@@ -122,7 +122,7 @@ extern const qstr_pool_t MICROPY_QSTR_EXTRA_POOL;
#endif
void qstr_init(void) {
- MP_STATE_VM(last_pool) = (qstr_pool_t*)&CONST_POOL; // we won't modify the const_pool since it has no allocated room left
+ MP_STATE_VM(last_pool) = (qstr_pool_t *)&CONST_POOL; // we won't modify the const_pool since it has no allocated room left
MP_STATE_VM(qstr_last_chunk) = NULL;
#if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL
@@ -151,7 +151,7 @@ STATIC qstr qstr_add(const byte *q_ptr) {
// Put a lower bound on the allocation size in case the extra qstr pool has few entries
new_alloc = MAX(MICROPY_ALLOC_QSTR_ENTRIES_INIT, new_alloc);
#endif
- qstr_pool_t *pool = m_new_obj_var_maybe(qstr_pool_t, const char*, new_alloc);
+ qstr_pool_t *pool = m_new_obj_var_maybe(qstr_pool_t, const char *, new_alloc);
if (pool == NULL) {
QSTR_EXIT();
m_malloc_fail(new_alloc);
@@ -173,7 +173,7 @@ STATIC qstr qstr_add(const byte *q_ptr) {
qstr qstr_find_strn(const char *str, size_t str_len) {
// work out hash of str
- mp_uint_t str_hash = qstr_compute_hash((const byte*)str, str_len);
+ mp_uint_t str_hash = qstr_compute_hash((const byte *)str, str_len);
// search pools for the data
for (qstr_pool_t *pool = MP_STATE_VM(last_pool); pool != NULL; pool = pool->prev) {
@@ -245,7 +245,7 @@ qstr qstr_from_strn(const char *str, size_t len) {
MP_STATE_VM(qstr_last_used) += n_bytes;
// store the interned strings' data
- mp_uint_t hash = qstr_compute_hash((const byte*)str, len);
+ mp_uint_t hash = qstr_compute_hash((const byte *)str, len);
Q_SET_HASH(q_ptr, hash);
Q_SET_LENGTH(q_ptr, len);
memcpy(q_ptr + MICROPY_QSTR_BYTES_IN_HASH + MICROPY_QSTR_BYTES_IN_LEN, str, len);
@@ -268,7 +268,7 @@ size_t qstr_len(qstr q) {
const char *qstr_str(qstr q) {
const byte *qd = find_qstr(q);
- return (const char*)Q_GET_DATA(qd);
+ return (const char *)Q_GET_DATA(qd);
}
const byte *qstr_data(qstr q, size_t *len) {