diff options
author | Damien George <damien.p.george@gmail.com> | 2020-02-27 15:36:53 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-02-28 10:33:03 +1100 |
commit | 69661f3343bedf86e514337cff63d96cc42f8859 (patch) | |
tree | af5dfb380ffdb75dda84828f63cf9d840d992f0f /py/qstr.c | |
parent | 3f39d18c2b884d32f0443e2e8114ff9d7a14d718 (diff) | |
download | micropython-69661f3343bedf86e514337cff63d96cc42f8859.tar.gz micropython-69661f3343bedf86e514337cff63d96cc42f8859.zip |
all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
Diffstat (limited to 'py/qstr.c')
-rw-r--r-- | py/qstr.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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) { |