@@ -123,7 +123,7 @@ void qstr_init(void) {
123
123
STATIC const char * find_qstr (qstr q , qstr_attr_t * attr ) {
124
124
// search pool for this qstr
125
125
// total_prev_len==0 in the final pool, so the loop will always terminate
126
- qstr_pool_t * pool = MP_STATE_VM (last_pool );
126
+ const qstr_pool_t * pool = MP_STATE_VM (last_pool );
127
127
while (q < pool -> total_prev_len ) {
128
128
pool = pool -> prev ;
129
129
}
@@ -181,7 +181,7 @@ qstr qstr_find_strn(const char *str, size_t str_len) {
181
181
mp_uint_t str_hash = qstr_compute_hash ((const byte * )str , str_len );
182
182
183
183
// search pools for the data
184
- for (qstr_pool_t * pool = MP_STATE_VM (last_pool ); pool != NULL ; pool = pool -> prev ) {
184
+ for (const qstr_pool_t * pool = MP_STATE_VM (last_pool ); pool != NULL ; pool = pool -> prev ) {
185
185
qstr_attr_t * attrs = pool -> attrs ;
186
186
for (mp_uint_t at = 0 , top = pool -> len ; at < top ; at ++ ) {
187
187
if (attrs [at ].hash == str_hash && attrs [at ].len == str_len && memcmp (pool -> qstrs [at ], str , str_len ) == 0 ) {
@@ -290,7 +290,7 @@ void qstr_pool_info(size_t *n_pool, size_t *n_qstr, size_t *n_str_data_bytes, si
290
290
* n_qstr = 0 ;
291
291
* n_str_data_bytes = 0 ;
292
292
* n_total_bytes = 0 ;
293
- for (qstr_pool_t * pool = MP_STATE_VM (last_pool ); pool != NULL && pool != & CONST_POOL ; pool = pool -> prev ) {
293
+ for (const qstr_pool_t * pool = MP_STATE_VM (last_pool ); pool != NULL && pool != & CONST_POOL ; pool = pool -> prev ) {
294
294
* n_pool += 1 ;
295
295
* n_qstr += pool -> len ;
296
296
for (const qstr_attr_t * q = pool -> attrs , * q_top = pool -> attrs + pool -> len ; q < q_top ; q ++ ) {
@@ -310,8 +310,8 @@ void qstr_pool_info(size_t *n_pool, size_t *n_qstr, size_t *n_str_data_bytes, si
310
310
#if MICROPY_PY_MICROPYTHON_MEM_INFO
311
311
void qstr_dump_data (void ) {
312
312
QSTR_ENTER ();
313
- for (qstr_pool_t * pool = MP_STATE_VM (last_pool ); pool != NULL && pool != & CONST_POOL ; pool = pool -> prev ) {
314
- for (const char * * q = pool -> qstrs , * * q_top = pool -> qstrs + pool -> len ; q < q_top ; q ++ ) {
313
+ for (const qstr_pool_t * pool = MP_STATE_VM (last_pool ); pool != NULL && pool != & CONST_POOL ; pool = pool -> prev ) {
314
+ for (const char * const * q = pool -> qstrs , * const * q_top = pool -> qstrs + pool -> len ; q < q_top ; q ++ ) {
315
315
mp_printf (& mp_plat_print , "Q(%s)\n" , * q );
316
316
}
317
317
}
0 commit comments