Skip to content

Commit 8c25201

Browse files
committed
socket: Make sure that symbol definitions are const.
1 parent ac0134d commit 8c25201

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

unix/socket.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ extern mp_obj_type_t sockaddr_in_type;
333333

334334
#define C(name) { #name, name }
335335

336-
struct sym_entry {
336+
static const struct sym_entry {
337337
const char *sym;
338338
int val;
339339
} constants[] = {
@@ -369,7 +369,7 @@ void microsocket_init() {
369369
rt_store_attr(m, MP_QSTR_gethostbyname, (mp_obj_t)&mod_socket_gethostbyname_obj);
370370
#endif
371371
rt_store_attr(m, MP_QSTR_getaddrinfo, (mp_obj_t)&mod_socket_getaddrinfo_obj);
372-
for (struct sym_entry *p = constants; p->sym != NULL; p++) {
372+
for (const struct sym_entry *p = constants; p->sym != NULL; p++) {
373373
rt_store_attr(m, QSTR_FROM_STR_STATIC(p->sym), MP_OBJ_NEW_SMALL_INT((machine_int_t)p->val));
374374
}
375375
}

0 commit comments

Comments
 (0)