diff --git a/core/include/msg.h b/core/include/msg.h index a10bd6d132418932ad2b8dc08d5bd2facc503118..4fc8eac33a386d953a56b7a0bdffb68ae69e9c2c 100644 --- a/core/include/msg.h +++ b/core/include/msg.h @@ -186,7 +186,7 @@ typedef struct { by msg_send. */ uint16_t type; /**< Type field. */ union { - char *ptr; /**< Pointer content field. */ + void *ptr; /**< Pointer content field. */ uint32_t value; /**< Value content field. */ } content; /**< Content of the message. */ } msg_t; diff --git a/core/msg.c b/core/msg.c index cd8209c355fe906ec450c4f55ff1015d9effea9b..4ab2061411c56eb8b6741a6c1f6ca6b3d3fde4d1 100644 --- a/core/msg.c +++ b/core/msg.c @@ -404,7 +404,7 @@ void msg_queue_print(void) msg_t *m = &msg_array[i]; printf(" * %u: sender: %" PRIkernel_pid ", type: 0x%04" PRIu16 ", content: %" PRIu32 " (%p)\n", i, m->sender_pid, m->type, - m->content.value, (void *)m->content.ptr); + m->content.value, m->content.ptr); } irq_restore(state); diff --git a/drivers/nrf24l01p/nrf24l01p.c b/drivers/nrf24l01p/nrf24l01p.c index 3ca880bf840147cbe472001dc541f785aed464dc..8bf6331a552c7a67268fc072a40b9ecb3472c84a 100644 --- a/drivers/nrf24l01p/nrf24l01p.c +++ b/drivers/nrf24l01p/nrf24l01p.c @@ -1019,7 +1019,7 @@ void nrf24l01p_rx_cb(void *arg) if (dev->listener != KERNEL_PID_UNDEF) { msg_t m; m.type = RCV_PKT_NRF24L01P; - m.content.ptr = (char *)dev; + m.content.ptr = dev; /* transmit more things here ? */ msg_send_int(&m, dev->listener); } diff --git a/drivers/pir/pir.c b/drivers/pir/pir.c index 3419e166945d6bb3c81e14cbac9596e889f6fadd..2bc6ccb7d77fc49fd1d2b55462f29eb0d62bfcb3 100644 --- a/drivers/pir/pir.c +++ b/drivers/pir/pir.c @@ -77,7 +77,7 @@ int pir_register_thread(pir_t *dev) static void pir_send_msg(pir_t *dev, pir_event_t event) { DEBUG("pir_send_msg\n"); - msg_t m = { .type = event, .content.ptr = (char*) dev, }; + msg_t m = { .type = event, .content.ptr = dev, }; int ret = msg_send_int(&m, dev->msg_thread_pid); DEBUG("pir_send_msg: msg_send_int: %i\n", ret); diff --git a/pkg/emb6/contrib/conn/udp/emb6_conn_udp.c b/pkg/emb6/contrib/conn/udp/emb6_conn_udp.c index bbd488edfe3f9ddb346037d8e52189883cac6eab..e4efda8be9d3e45dcdbdc2224460ba2551d527b2 100644 --- a/pkg/emb6/contrib/conn/udp/emb6_conn_udp.c +++ b/pkg/emb6/contrib/conn/udp/emb6_conn_udp.c @@ -93,7 +93,7 @@ void conn_udp_close(conn_udp_t *conn) if (conn->waiting_thread != KERNEL_PID_UNDEF) { msg_t msg; msg.type = _MSG_TYPE_CLOSE; - msg.content.ptr = (char *)conn; + msg.content.ptr = conn; mutex_unlock(&conn->mutex); msg_send(&msg, conn->waiting_thread); mutex_lock(&conn->mutex); @@ -139,7 +139,7 @@ int conn_udp_recvfrom(conn_udp_t *conn, void *data, size_t max_len, void *addr, } else if (msg.type == _MSG_TYPE_RCV) { mutex_lock(&conn->mutex); - if (msg.content.ptr == (char *)conn) { + if (msg.content.ptr == conn) { if (max_len < conn->recv_info.datalen) { conn->waiting_thread = KERNEL_PID_UNDEF; mutex_unlock(&conn->mutex); @@ -219,7 +219,7 @@ static void _input_callback(struct udp_socket *c, void *ptr, conn->recv_info.data = data; conn->recv_info.datalen = datalen - sizeof(ipv6_hdr_t); msg.type = _MSG_TYPE_RCV; - msg.content.ptr = (char *)conn; + msg.content.ptr = conn; mutex_unlock(&conn->mutex); msg_send(&msg, conn->waiting_thread); } diff --git a/pkg/lwip/contrib/netdev2/lwip_netdev2.c b/pkg/lwip/contrib/netdev2/lwip_netdev2.c index 991aad3f8977e08992b8219d6f0303226f5afd1d..359fc41338bd762303c6567a1fe5c4fc4f4ef03c 100644 --- a/pkg/lwip/contrib/netdev2/lwip_netdev2.c +++ b/pkg/lwip/contrib/netdev2/lwip_netdev2.c @@ -216,7 +216,7 @@ static void _event_cb(netdev2_t *dev, netdev2_event_t event) msg_t msg; msg.type = LWIP_NETDEV2_MSG_TYPE_EVENT; - msg.content.ptr = (char *)dev; + msg.content.ptr = dev; if (msg_send(&msg, _pid) <= 0) { DEBUG("lwip_netdev2: possibly lost interrupt.\n"); @@ -251,7 +251,7 @@ static void *_event_loop(void *arg) msg_t msg; msg_receive(&msg); if (msg.type == LWIP_NETDEV2_MSG_TYPE_EVENT) { - netdev2_t *dev = (netdev2_t *)msg.content.ptr; + netdev2_t *dev = msg.content.ptr; dev->driver->isr(dev); } } diff --git a/sys/include/net/gnrc.h b/sys/include/net/gnrc.h index 89ffb966968c4c5457ecd4d8f9f593064ed1f8be..8a9dbe5d3183f8aed89c8bd08834c495d37ff7b4 100644 --- a/sys/include/net/gnrc.h +++ b/sys/include/net/gnrc.h @@ -121,11 +121,11 @@ * msg_receive(&msg); * switch (msg.type) { * case GNRC_NETAPI_MSG_TYPE_RCV: - * pkt = (gnrc_pktsnip_t *) msg.content.ptr; + * pkt = msg.content.ptr; * _handle_incoming_pkt(pkt); * break; * case GNRC_NETAPI_MSG_TYPE_SND: - * pkt = (gnrc_pktsnip_t *) msg.content.ptr; + * pkt = msg.content.ptr; * _handle_outgoing_pkt(pkt); * break; * case GNRC_NETAPI_MSG_TYPE_SET: diff --git a/sys/net/gnrc/application_layer/tftp/gnrc_tftp.c b/sys/net/gnrc/application_layer/tftp/gnrc_tftp.c index 6feaf4b4c3fda8ccde3029c21ab5b870c6acd70f..f7d62acf5df9bd5080a75713be345ce06389b762 100644 --- a/sys/net/gnrc/application_layer/tftp/gnrc_tftp.c +++ b/sys/net/gnrc/application_layer/tftp/gnrc_tftp.c @@ -485,7 +485,7 @@ int _tftp_server(tftp_context_t *ctxt) /* release packet if we received one */ if (msg.type == GNRC_NETAPI_MSG_TYPE_RCV) { - gnrc_pktbuf_release((gnrc_pktsnip_t *) msg.content.ptr); + gnrc_pktbuf_release(msg.content.ptr); } } @@ -544,7 +544,7 @@ int _tftp_do_client_transfer(tftp_context_t *ctxt) /* release packet if we received one */ if (msg.type == GNRC_NETAPI_MSG_TYPE_RCV) { - gnrc_pktbuf_release((gnrc_pktsnip_t *) msg.content.ptr); + gnrc_pktbuf_release(msg.content.ptr); } } @@ -595,7 +595,7 @@ tftp_state _tftp_state_processes(tftp_context_t *ctxt, msg_t *m) return TS_BUSY; } - gnrc_pktsnip_t *pkt = (gnrc_pktsnip_t *)(m->content.ptr); + gnrc_pktsnip_t *pkt = m->content.ptr; gnrc_pktsnip_t *tmp; tmp = gnrc_pktsnip_search_type(pkt, GNRC_NETTYPE_UDP); diff --git a/sys/net/gnrc/application_layer/zep/gnrc_zep.c b/sys/net/gnrc/application_layer/zep/gnrc_zep.c index 3008c908e21f82371f9b8819a7d6bbde6018d5fb..1d2c210e0143073ab6f50a80d3b7aa6c28010d6d 100644 --- a/sys/net/gnrc/application_layer/zep/gnrc_zep.c +++ b/sys/net/gnrc/application_layer/zep/gnrc_zep.c @@ -573,7 +573,7 @@ void *_event_loop(void *args) switch (msg.type) { case GNRC_NETAPI_MSG_TYPE_RCV: DEBUG("zep: GNRC_NETAPI_MSG_TYPE_RCV\n"); - ringbuffer_add(&_rx_buf, (char *)(&msg.content.ptr), + ringbuffer_add(&_rx_buf, (void*)&msg.content.ptr, sizeof(gnrc_pktsnip_t *)); ack.type = GNRC_NETDEV_MSG_TYPE_EVENT; ack.content.value = _EVENT_RX_STARTED; @@ -582,12 +582,12 @@ void *_event_loop(void *args) case GNRC_NETAPI_MSG_TYPE_SND: DEBUG("zep: GNRC_NETAPI_MSG_TYPE_SND\n"); - _send(dev, (gnrc_pktsnip_t *)msg.content.ptr); + _send(dev, msg.content.ptr); break; case GNRC_NETAPI_MSG_TYPE_GET: DEBUG("zep: GNRC_NETAPI_MSG_TYPE_GET\n"); - opt = (gnrc_netapi_opt_t *)msg.content.ptr; + opt = msg.content.ptr; ack.type = GNRC_NETAPI_MSG_TYPE_ACK; ack.content.value = _get(dev, opt->opt, opt->data, opt->data_len); msg_reply(&msg, &ack); @@ -595,7 +595,7 @@ void *_event_loop(void *args) case GNRC_NETAPI_MSG_TYPE_SET: DEBUG("zep: GNRC_NETAPI_MSG_TYPE_SET\n"); - opt = (gnrc_netapi_opt_t *)msg.content.ptr; + opt = msg.content.ptr; ack.type = GNRC_NETAPI_MSG_TYPE_ACK; ack.content.value = _set(dev, opt->opt, opt->data, opt->data_len); msg_reply(&msg, &ack); diff --git a/sys/net/gnrc/conn/gnrc_conn.c b/sys/net/gnrc/conn/gnrc_conn.c index 0675020671b70aff53f3fc1533f1c139ba74f922..c2991ae5cfad506ab334d042f5e965293b2274f6 100644 --- a/sys/net/gnrc/conn/gnrc_conn.c +++ b/sys/net/gnrc/conn/gnrc_conn.c @@ -32,7 +32,7 @@ int gnrc_conn_recvfrom(conn_t *conn, void *data, size_t max_len, void *addr, siz msg_receive(&msg); switch (msg.type) { case GNRC_NETAPI_MSG_TYPE_RCV: - pkt = (gnrc_pktsnip_t *)msg.content.ptr; + pkt = msg.content.ptr; if (pkt->size > max_len) { return -ENOMEM; } diff --git a/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2.c b/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2.c index b28d6e772ed9752a5e3d07136135aa76ef97ee35..0bb967ac1378000318b581e2109ea1ef13c759ca 100644 --- a/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2.c +++ b/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2.c @@ -54,7 +54,7 @@ static void _event_cb(netdev2_t *dev, netdev2_event_t event) msg_t msg; msg.type = NETDEV2_MSG_TYPE_EVENT; - msg.content.ptr = (void*) gnrc_netdev2; + msg.content.ptr = gnrc_netdev2; if (msg_send(&msg, gnrc_netdev2->pid) <= 0) { puts("gnrc_netdev2: possibly lost interrupt."); @@ -142,12 +142,12 @@ static void *_gnrc_netdev2_thread(void *args) break; case GNRC_NETAPI_MSG_TYPE_SND: DEBUG("gnrc_netdev2: GNRC_NETAPI_MSG_TYPE_SND received\n"); - gnrc_pktsnip_t *pkt = (gnrc_pktsnip_t *)msg.content.ptr; + gnrc_pktsnip_t *pkt = msg.content.ptr; gnrc_netdev2->send(gnrc_netdev2, pkt); break; case GNRC_NETAPI_MSG_TYPE_SET: /* read incoming options */ - opt = (gnrc_netapi_opt_t *)msg.content.ptr; + opt = msg.content.ptr; DEBUG("gnrc_netdev2: GNRC_NETAPI_MSG_TYPE_SET received. opt=%s\n", netopt2str(opt->opt)); /* set option for device driver */ @@ -160,7 +160,7 @@ static void *_gnrc_netdev2_thread(void *args) break; case GNRC_NETAPI_MSG_TYPE_GET: /* read incoming options */ - opt = (gnrc_netapi_opt_t *)msg.content.ptr; + opt = msg.content.ptr; DEBUG("gnrc_netdev2: GNRC_NETAPI_MSG_TYPE_GET received. opt=%s\n", netopt2str(opt->opt)); /* get option from device driver */ diff --git a/sys/net/gnrc/link_layer/nomac/gnrc_nomac.c b/sys/net/gnrc/link_layer/nomac/gnrc_nomac.c index 7e5f9f9ee1dc339dc1f82311b52ea5d739b848d2..d3731ec6c75a4e790d6eafdd5118225a4d61a8a5 100644 --- a/sys/net/gnrc/link_layer/nomac/gnrc_nomac.c +++ b/sys/net/gnrc/link_layer/nomac/gnrc_nomac.c @@ -88,14 +88,14 @@ static void *_nomac_thread(void *args) break; case GNRC_NETAPI_MSG_TYPE_SND: DEBUG("nomac: GNRC_NETAPI_MSG_TYPE_SND received\n"); - dev->driver->send_data(dev, (gnrc_pktsnip_t *)msg.content.ptr); + dev->driver->send_data(dev, msg.content.ptr); break; case GNRC_NETAPI_MSG_TYPE_SET: /* TODO: filter out MAC layer options -> for now forward everything to the device driver */ DEBUG("nomac: GNRC_NETAPI_MSG_TYPE_SET received\n"); /* read incoming options */ - opt = (gnrc_netapi_opt_t *)msg.content.ptr; + opt = msg.content.ptr; /* set option for device driver */ res = dev->driver->set(dev, opt->opt, opt->data, opt->data_len); DEBUG("nomac: response of netdev->set: %i\n", res); @@ -109,7 +109,7 @@ static void *_nomac_thread(void *args) everything to the device driver */ DEBUG("nomac: GNRC_NETAPI_MSG_TYPE_GET received\n"); /* read incoming options */ - opt = (gnrc_netapi_opt_t *)msg.content.ptr; + opt = msg.content.ptr; /* get option from device driver */ res = dev->driver->get(dev, opt->opt, opt->data, opt->data_len); DEBUG("nomac: response of netdev->get: %i\n", res); diff --git a/sys/net/gnrc/link_layer/slip/gnrc_slip.c b/sys/net/gnrc/link_layer/slip/gnrc_slip.c index 9ab6559339239097f5a51d919ca1afb9ae00ae81..8e3fd0285db4146db17f87bc4c8c7db5b7c5c926 100644 --- a/sys/net/gnrc/link_layer/slip/gnrc_slip.c +++ b/sys/net/gnrc/link_layer/slip/gnrc_slip.c @@ -218,13 +218,13 @@ static void *_slip(void *args) case GNRC_NETAPI_MSG_TYPE_SND: DEBUG("slip: GNRC_NETAPI_MSG_TYPE_SND received\n"); - _slip_send(dev, (gnrc_pktsnip_t *)msg.content.ptr); + _slip_send(dev, msg.content.ptr); break; case GNRC_NETAPI_MSG_TYPE_GET: DEBUG("slip: GNRC_NETAPI_MSG_TYPE_GET received\n"); reply.type = GNRC_NETAPI_MSG_TYPE_ACK; - reply.content.value = (uint32_t)_slip_get((gnrc_netapi_opt_t *)msg.content.ptr); + reply.content.value = (uint32_t)_slip_get(msg.content.ptr); msg_reply(&msg, &reply); break; diff --git a/sys/net/gnrc/nettest/gnrc_nettest.c b/sys/net/gnrc/nettest/gnrc_nettest.c index 5259935efccb47898a87051ee67636c41dfe7358..a2aaa154806c7331860dc64c694c32174b678e5e 100644 --- a/sys/net/gnrc/nettest/gnrc_nettest.c +++ b/sys/net/gnrc/nettest/gnrc_nettest.c @@ -57,7 +57,7 @@ static gnrc_nettest_res_t _pkt_test(uint16_t cmd_type, kernel_pid_t pid, gnrc_nettest_res_t res = GNRC_NETTEST_SUCCESS; msg.type = cmd_type; - msg.content.ptr = (char *)in; + msg.content.ptr = in; msg_send(&msg, pid); @@ -81,7 +81,7 @@ static gnrc_nettest_res_t _pkt_test(uint16_t cmd_type, kernel_pid_t pid, return GNRC_NETTEST_WRONG_SENDER; } - out = (gnrc_pktsnip_t *)msg.content.ptr; + out = msg.content.ptr; if (out == NULL) { return GNRC_NETTEST_FAIL; @@ -99,7 +99,7 @@ static gnrc_nettest_res_t _pkt_test(uint16_t cmd_type, kernel_pid_t pid, exp = exp->next; } - gnrc_pktbuf_release((gnrc_pktsnip_t *)msg.content.ptr); + gnrc_pktbuf_release(msg.content.ptr); } return res; @@ -234,14 +234,14 @@ static void *_event_loop(void *arg) switch (msg.type) { case GNRC_NETAPI_MSG_TYPE_GET: - opt = (gnrc_netapi_opt_t *)msg.content.ptr; + opt = msg.content.ptr; reply.content.value = _get_set_opt(_opt_cbs[opt->opt].get, opt->context, opt->data, opt->data_len); break; case GNRC_NETAPI_MSG_TYPE_SET: - opt = (gnrc_netapi_opt_t *)msg.content.ptr; + opt = msg.content.ptr; reply.content.value = _get_set_opt(_opt_cbs[opt->opt].set, opt->context, opt->data, opt->data_len); diff --git a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c index 397429c0ddb86e636eaa861daee812b2b87d2e3c..c10365c5d7c3410922903352b2cc5bc307793ffa 100644 --- a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c +++ b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c @@ -263,12 +263,12 @@ static void *_event_loop(void *args) switch (msg.type) { case GNRC_NETAPI_MSG_TYPE_RCV: DEBUG("ipv6: GNRC_NETAPI_MSG_TYPE_RCV received\n"); - _receive((gnrc_pktsnip_t *)msg.content.ptr); + _receive(msg.content.ptr); break; case GNRC_NETAPI_MSG_TYPE_SND: DEBUG("ipv6: GNRC_NETAPI_MSG_TYPE_SND received\n"); - _send((gnrc_pktsnip_t *)msg.content.ptr, true); + _send(msg.content.ptr, true); break; case GNRC_NETAPI_MSG_TYPE_GET: @@ -289,43 +289,43 @@ static void *_event_loop(void *args) /* case GNRC_NDP_MSG_ADDR_TIMEOUT: */ /* DEBUG("ipv6: Router advertisement timer event received\n"); */ /* gnrc_ipv6_netif_remove_addr(KERNEL_PID_UNDEF, */ - /* (ipv6_addr_t *)msg.content.ptr); */ + /* msg.content.ptr); */ /* break; */ case GNRC_NDP_MSG_NBR_SOL_RETRANS: DEBUG("ipv6: Neigbor solicitation retransmission timer event received\n"); - gnrc_ndp_retrans_nbr_sol((gnrc_ipv6_nc_t *)msg.content.ptr); + gnrc_ndp_retrans_nbr_sol(msg.content.ptr); break; case GNRC_NDP_MSG_NC_STATE_TIMEOUT: DEBUG("ipv6: Neigbor cache state timeout received\n"); - gnrc_ndp_state_timeout((gnrc_ipv6_nc_t *)msg.content.ptr); + gnrc_ndp_state_timeout(msg.content.ptr); break; #endif #ifdef MODULE_GNRC_NDP_ROUTER case GNRC_NDP_MSG_RTR_ADV_RETRANS: DEBUG("ipv6: Router advertisement retransmission event received\n"); - gnrc_ndp_router_retrans_rtr_adv((gnrc_ipv6_netif_t *)msg.content.ptr); + gnrc_ndp_router_retrans_rtr_adv(msg.content.ptr); break; case GNRC_NDP_MSG_RTR_ADV_DELAY: DEBUG("ipv6: Delayed router advertisement event received\n"); - gnrc_ndp_router_send_rtr_adv((gnrc_ipv6_nc_t *)msg.content.ptr); + gnrc_ndp_router_send_rtr_adv(msg.content.ptr); break; #endif #ifdef MODULE_GNRC_NDP_HOST case GNRC_NDP_MSG_RTR_SOL_RETRANS: DEBUG("ipv6: Router solicitation retransmission event received\n"); - gnrc_ndp_host_retrans_rtr_sol((gnrc_ipv6_netif_t *)msg.content.ptr); + gnrc_ndp_host_retrans_rtr_sol(msg.content.ptr); break; #endif #ifdef MODULE_GNRC_SIXLOWPAN_ND case GNRC_SIXLOWPAN_ND_MSG_MC_RTR_SOL: DEBUG("ipv6: Multicast router solicitation event received\n"); - gnrc_sixlowpan_nd_mc_rtr_sol((gnrc_ipv6_netif_t *)msg.content.ptr); + gnrc_sixlowpan_nd_mc_rtr_sol(msg.content.ptr); break; case GNRC_SIXLOWPAN_ND_MSG_UC_RTR_SOL: DEBUG("ipv6: Unicast router solicitation event received\n"); - gnrc_sixlowpan_nd_uc_rtr_sol((gnrc_ipv6_nc_t *)msg.content.ptr); + gnrc_sixlowpan_nd_uc_rtr_sol(msg.content.ptr); break; # ifdef MODULE_GNRC_SIXLOWPAN_CTX case GNRC_SIXLOWPAN_ND_MSG_DELETE_CTX: @@ -338,18 +338,17 @@ static void *_event_loop(void *args) #ifdef MODULE_GNRC_SIXLOWPAN_ND_ROUTER case GNRC_SIXLOWPAN_ND_MSG_ABR_TIMEOUT: DEBUG("ipv6: border router timeout event received\n"); - gnrc_sixlowpan_nd_router_abr_remove( - (gnrc_sixlowpan_nd_router_abr_t *)msg.content.ptr); + gnrc_sixlowpan_nd_router_abr_remove(msg.content.ptr); break; /* XXX reactivate when https://github.com/RIOT-OS/RIOT/issues/5122 is * solved properly */ /* case GNRC_SIXLOWPAN_ND_MSG_AR_TIMEOUT: */ /* DEBUG("ipv6: address registration timeout received\n"); */ - /* gnrc_sixlowpan_nd_router_gc_nc((gnrc_ipv6_nc_t *)msg.content.ptr); */ + /* gnrc_sixlowpan_nd_router_gc_nc(msg.content.ptr); */ /* break; */ case GNRC_NDP_MSG_RTR_ADV_SIXLOWPAN_DELAY: DEBUG("ipv6: Delayed router advertisement event received\n"); - gnrc_ipv6_nc_t *nc_entry = (gnrc_ipv6_nc_t *)msg.content.ptr; + gnrc_ipv6_nc_t *nc_entry = msg.content.ptr; gnrc_ndp_internal_send_rtr_adv(nc_entry->iface, NULL, &(nc_entry->ipv6_addr), false); break; diff --git a/sys/net/gnrc/network_layer/ipv6/nc/gnrc_ipv6_nc.c b/sys/net/gnrc/network_layer/ipv6/nc/gnrc_ipv6_nc.c index a32b176764942c57d2bbeb6240c9d6309638a475..417a442b160663ab362e5a425d637ec26396e3b3 100644 --- a/sys/net/gnrc/network_layer/ipv6/nc/gnrc_ipv6_nc.c +++ b/sys/net/gnrc/network_layer/ipv6/nc/gnrc_ipv6_nc.c @@ -60,7 +60,7 @@ static void _nc_remove(kernel_pid_t iface, gnrc_ipv6_nc_t *entry) gnrc_ipv6_netif_t *if_entry = gnrc_ipv6_netif_get(iface); - if ((if_entry != NULL) && (if_entry->rtr_adv_msg.content.ptr == (char *) entry)) { + if ((if_entry != NULL) && (if_entry->rtr_adv_msg.content.ptr == entry)) { /* cancel timer set by gnrc_ndp_rtr_sol_handle */ xtimer_remove(&if_entry->rtr_adv_timer); } @@ -175,18 +175,18 @@ gnrc_ipv6_nc_t *gnrc_ipv6_nc_add(kernel_pid_t iface, const ipv6_addr_t *ipv6_add #ifdef MODULE_GNRC_SIXLOWPAN_ND_ROUTER free_entry->type_timeout_msg.type = GNRC_SIXLOWPAN_ND_MSG_AR_TIMEOUT; - free_entry->type_timeout_msg.content.ptr = (char *) free_entry; + free_entry->type_timeout_msg.content.ptr = free_entry; #endif free_entry->rtr_timeout_msg.type = GNRC_NDP_MSG_RTR_TIMEOUT; - free_entry->rtr_timeout_msg.content.ptr = (char *) free_entry; + free_entry->rtr_timeout_msg.content.ptr = free_entry; #if defined(MODULE_GNRC_NDP_ROUTER) || defined(MODULE_GNRC_SIXLOWPAN_ND_BORDER_ROUTER) free_entry->rtr_adv_msg.type = GNRC_NDP_MSG_RTR_ADV_DELAY; - free_entry->rtr_adv_msg.content.ptr = (char *) free_entry; + free_entry->rtr_adv_msg.content.ptr = free_entry; #endif - free_entry->nbr_sol_msg.content.ptr = (char *) free_entry; + free_entry->nbr_sol_msg.content.ptr = free_entry; return free_entry; } diff --git a/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c b/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c index c083b2946ecf3c5ad71cd7a3f3f2c0c154542bab..4e55779ae43a6d922f8acaad2ab6735b42783d2f 100644 --- a/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c +++ b/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c @@ -156,7 +156,7 @@ static ipv6_addr_t *_add_addr_to_entry(gnrc_ipv6_netif_t *entry, const ipv6_addr } tmp_addr->valid_timeout_msg.type = GNRC_NDP_MSG_ADDR_TIMEOUT; - tmp_addr->valid_timeout_msg.content.ptr = (char *) &tmp_addr->addr; + tmp_addr->valid_timeout_msg.content.ptr = &tmp_addr->addr; return &(tmp_addr->addr); } diff --git a/sys/net/gnrc/network_layer/ndp/gnrc_ndp.c b/sys/net/gnrc/network_layer/ndp/gnrc_ndp.c index b2625a8e9c39ec81d8b11f4163b5d4da7fd9e282..39acfb3fe602d3d7b54d8e972e5d194e0d62b10f 100644 --- a/sys/net/gnrc/network_layer/ndp/gnrc_ndp.c +++ b/sys/net/gnrc/network_layer/ndp/gnrc_ndp.c @@ -442,7 +442,7 @@ void gnrc_ndp_rtr_sol_handle(kernel_pid_t iface, gnrc_pktsnip_t *pkt, gnrc_ipv6_nc_t *nc_entry = gnrc_ipv6_nc_get(iface, &ipv6->src); if (nc_entry != NULL) { if_entry->rtr_adv_msg.type = GNRC_NDP_MSG_RTR_ADV_SIXLOWPAN_DELAY; - if_entry->rtr_adv_msg.content.ptr = (char *) nc_entry; + if_entry->rtr_adv_msg.content.ptr = nc_entry; xtimer_set_msg(&if_entry->rtr_adv_timer, delay, &if_entry->rtr_adv_msg, gnrc_ipv6_pid); } @@ -451,7 +451,7 @@ void gnrc_ndp_rtr_sol_handle(kernel_pid_t iface, gnrc_pktsnip_t *pkt, if (ipv6_addr_is_unspecified(&ipv6->src)) { /* either multicast, if source unspecified */ if_entry->rtr_adv_msg.type = GNRC_NDP_MSG_RTR_ADV_RETRANS; - if_entry->rtr_adv_msg.content.ptr = (char *) if_entry; + if_entry->rtr_adv_msg.content.ptr = if_entry; xtimer_set_msg(&if_entry->rtr_adv_timer, delay, &if_entry->rtr_adv_msg, gnrc_ipv6_pid); } diff --git a/sys/net/gnrc/network_layer/ndp/host/gnrc_ndp_host.c b/sys/net/gnrc/network_layer/ndp/host/gnrc_ndp_host.c index 3405ff78e68fee7fbf54d1d7973d38f57fc0ab59..153884850536df6a08537a32f4c101f6ce2dd49a 100644 --- a/sys/net/gnrc/network_layer/ndp/host/gnrc_ndp_host.c +++ b/sys/net/gnrc/network_layer/ndp/host/gnrc_ndp_host.c @@ -28,7 +28,7 @@ static inline void _reschedule_rtr_sol(gnrc_ipv6_netif_t *iface, uint32_t delay) { xtimer_remove(&iface->rtr_sol_timer); iface->rtr_sol_msg.type = GNRC_NDP_MSG_RTR_SOL_RETRANS; - iface->rtr_sol_msg.content.ptr = (char *) iface; + iface->rtr_sol_msg.content.ptr = iface; xtimer_set_msg(&iface->rtr_sol_timer, delay, &iface->rtr_sol_msg, gnrc_ipv6_pid); } diff --git a/sys/net/gnrc/network_layer/ndp/internal/gnrc_ndp_internal.c b/sys/net/gnrc/network_layer/ndp/internal/gnrc_ndp_internal.c index a65ad2acd00300d72c1c05102f8b9590b19abd0b..b2caf2227dd9c1731af087a468778a4dcc772905 100644 --- a/sys/net/gnrc/network_layer/ndp/internal/gnrc_ndp_internal.c +++ b/sys/net/gnrc/network_layer/ndp/internal/gnrc_ndp_internal.c @@ -51,7 +51,7 @@ static inline void _send_delayed(xtimer_t *t, msg_t *msg, uint32_t interval, gnr { xtimer_remove(t); msg->type = GNRC_NETAPI_MSG_TYPE_SND; - msg->content.ptr = (char *) pkt; + msg->content.ptr = pkt; xtimer_set_msg(t, interval, msg, gnrc_ipv6_pid); } diff --git a/sys/net/gnrc/network_layer/ndp/router/gnrc_ndp_router.c b/sys/net/gnrc/network_layer/ndp/router/gnrc_ndp_router.c index ae0ecb39c945275486140894628cc1da01369f27..4928a050f7575c6ac27ba5b2beecaa1376be447c 100644 --- a/sys/net/gnrc/network_layer/ndp/router/gnrc_ndp_router.c +++ b/sys/net/gnrc/network_layer/ndp/router/gnrc_ndp_router.c @@ -106,7 +106,7 @@ static void _send_rtr_adv(gnrc_ipv6_netif_t *iface, ipv6_addr_t *dst) /* reset timer for next router advertisement */ xtimer_remove(&iface->rtr_adv_timer); iface->rtr_adv_msg.type = GNRC_NDP_MSG_RTR_ADV_RETRANS; - iface->rtr_adv_msg.content.ptr = (char *) iface; + iface->rtr_adv_msg.content.ptr = iface; xtimer_set_msg(&iface->rtr_adv_timer, interval * SEC_IN_USEC, &iface->rtr_adv_msg, gnrc_ipv6_pid); } diff --git a/sys/net/gnrc/network_layer/sixlowpan/gnrc_sixlowpan.c b/sys/net/gnrc/network_layer/sixlowpan/gnrc_sixlowpan.c index 6813677fa2077ff256809aca831df7c32772c588..888afa685ac5ab2c8e31886dc9969263c6af9e5c 100644 --- a/sys/net/gnrc/network_layer/sixlowpan/gnrc_sixlowpan.c +++ b/sys/net/gnrc/network_layer/sixlowpan/gnrc_sixlowpan.c @@ -290,7 +290,7 @@ static void _send(gnrc_pktsnip_t *pkt) /* set the outgoing message's fields */ msg.type = GNRC_SIXLOWPAN_MSG_FRAG_SND; - msg.content.ptr = (void *)&fragment_msg; + msg.content.ptr = &fragment_msg; /* send message to self */ msg_send_to_self(&msg); } @@ -332,12 +332,12 @@ static void *_event_loop(void *args) switch (msg.type) { case GNRC_NETAPI_MSG_TYPE_RCV: DEBUG("6lo: GNRC_NETDEV_MSG_TYPE_RCV received\n"); - _receive((gnrc_pktsnip_t *)msg.content.ptr); + _receive(msg.content.ptr); break; case GNRC_NETAPI_MSG_TYPE_SND: DEBUG("6lo: GNRC_NETDEV_MSG_TYPE_SND received\n"); - _send((gnrc_pktsnip_t *)msg.content.ptr); + _send(msg.content.ptr); break; case GNRC_NETAPI_MSG_TYPE_GET: @@ -349,7 +349,7 @@ static void *_event_loop(void *args) #ifdef MODULE_GNRC_SIXLOWPAN_FRAG case GNRC_SIXLOWPAN_MSG_FRAG_SND: DEBUG("6lo: send fragmented event received\n"); - gnrc_sixlowpan_frag_send((gnrc_sixlowpan_msg_frag_t *)msg.content.ptr); + gnrc_sixlowpan_frag_send(msg.content.ptr); break; #endif diff --git a/sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c b/sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c index d90f9f93821212a2af059d64351281c2f38fb4b7..a39eef981ab36b9d316d69021d2ca411e557dce3 100644 --- a/sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c +++ b/sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c @@ -30,7 +30,7 @@ static inline void _rtr_sol_reschedule(gnrc_ipv6_netif_t *iface, uint32_t sec_de { xtimer_remove(&iface->rtr_sol_timer); iface->rtr_sol_msg.type = GNRC_SIXLOWPAN_ND_MSG_MC_RTR_SOL; - iface->rtr_sol_msg.content.ptr = (char *) iface; + iface->rtr_sol_msg.content.ptr = iface; xtimer_set_msg(&iface->rtr_sol_timer, sec_delay * SEC_IN_USEC, &iface->rtr_sol_msg, gnrc_ipv6_pid); } @@ -228,7 +228,7 @@ void gnrc_sixlowpan_nd_rtr_sol_reschedule(gnrc_ipv6_nc_t *nce, uint32_t sec_dela gnrc_ipv6_netif_t *iface = gnrc_ipv6_netif_get(nce->iface); xtimer_remove(&iface->rtr_sol_timer); iface->rtr_sol_msg.type = GNRC_SIXLOWPAN_ND_MSG_MC_RTR_SOL; - iface->rtr_sol_msg.content.ptr = (char *) iface; + iface->rtr_sol_msg.content.ptr = iface; xtimer_set_msg(&iface->rtr_sol_timer, sec_delay * SEC_IN_USEC, &iface->rtr_sol_msg, gnrc_ipv6_pid); } diff --git a/sys/net/gnrc/network_layer/sixlowpan/nd/router/gnrc_sixlowpan_nd_router.c b/sys/net/gnrc/network_layer/sixlowpan/nd/router/gnrc_sixlowpan_nd_router.c index 69d6ec47d585f7e972b92d7619aa7241b4a54c02..d30090fbe753c729e85f4f0a47e8c87fae311c07 100644 --- a/sys/net/gnrc/network_layer/sixlowpan/nd/router/gnrc_sixlowpan_nd_router.c +++ b/sys/net/gnrc/network_layer/sixlowpan/nd/router/gnrc_sixlowpan_nd_router.c @@ -243,7 +243,7 @@ void gnrc_sixlowpan_nd_opt_abr_handle(kernel_pid_t iface, ndp_rtr_adv_t *rtr_adv xtimer_remove(&abr->ltimer); abr->ltimer_msg.type = GNRC_SIXLOWPAN_ND_MSG_ABR_TIMEOUT; - abr->ltimer_msg.content.ptr = (char *) abr; + abr->ltimer_msg.content.ptr = abr; xtimer_set_msg(&abr->ltimer, t, &abr->ltimer_msg, gnrc_ipv6_pid); } diff --git a/sys/net/gnrc/pktdump/gnrc_pktdump.c b/sys/net/gnrc/pktdump/gnrc_pktdump.c index 5d3deae32d00922def468008483595c36444d83f..251ea167ef0a1d018a19ff095f0f89ec8cab4a85 100644 --- a/sys/net/gnrc/pktdump/gnrc_pktdump.c +++ b/sys/net/gnrc/pktdump/gnrc_pktdump.c @@ -134,11 +134,11 @@ static void *_eventloop(void *arg) switch (msg.type) { case GNRC_NETAPI_MSG_TYPE_RCV: puts("PKTDUMP: data received:"); - _dump((gnrc_pktsnip_t *)msg.content.ptr); + _dump(msg.content.ptr); break; case GNRC_NETAPI_MSG_TYPE_SND: puts("PKTDUMP: data to send:"); - _dump((gnrc_pktsnip_t *)msg.content.ptr); + _dump(msg.content.ptr); break; case GNRC_NETAPI_MSG_TYPE_GET: case GNRC_NETAPI_MSG_TYPE_SET: diff --git a/sys/net/gnrc/routing/rpl/gnrc_rpl.c b/sys/net/gnrc/routing/rpl/gnrc_rpl.c index f3420d9e412b8de736a1e9337dce989521b00984..7a8018afd8514e4558cb303d61b1ff8af2553762 100644 --- a/sys/net/gnrc/routing/rpl/gnrc_rpl.c +++ b/sys/net/gnrc/routing/rpl/gnrc_rpl.c @@ -210,21 +210,21 @@ static void *_event_loop(void *args) break; case GNRC_RPL_MSG_TYPE_TRICKLE_INTERVAL: DEBUG("RPL: GNRC_RPL_MSG_TYPE_TRICKLE_INTERVAL received\n"); - trickle = (trickle_t *) msg.content.ptr; + trickle = msg.content.ptr; if (trickle && (trickle->callback.func != NULL)) { trickle_interval(trickle); } break; case GNRC_RPL_MSG_TYPE_TRICKLE_CALLBACK: DEBUG("RPL: GNRC_RPL_MSG_TYPE_TRICKLE_CALLBACK received\n"); - trickle = (trickle_t *) msg.content.ptr; + trickle = msg.content.ptr; if (trickle && (trickle->callback.func != NULL)) { trickle_callback(trickle); } break; case GNRC_NETAPI_MSG_TYPE_RCV: DEBUG("RPL: GNRC_NETAPI_MSG_TYPE_RCV received\n"); - _receive((gnrc_pktsnip_t *)msg.content.ptr); + _receive(msg.content.ptr); break; case GNRC_NETAPI_MSG_TYPE_SND: break; diff --git a/sys/net/gnrc/transport_layer/udp/gnrc_udp.c b/sys/net/gnrc/transport_layer/udp/gnrc_udp.c index 9eaddf75cf285de086b768af9ca4d0a9424d98d1..9bb8dc1a251271e0f509936da9185ace3be3ac59 100644 --- a/sys/net/gnrc/transport_layer/udp/gnrc_udp.c +++ b/sys/net/gnrc/transport_layer/udp/gnrc_udp.c @@ -232,11 +232,11 @@ static void *_event_loop(void *arg) switch (msg.type) { case GNRC_NETAPI_MSG_TYPE_RCV: DEBUG("udp: GNRC_NETAPI_MSG_TYPE_RCV\n"); - _receive((gnrc_pktsnip_t *)msg.content.ptr); + _receive(msg.content.ptr); break; case GNRC_NETAPI_MSG_TYPE_SND: DEBUG("udp: GNRC_NETAPI_MSG_TYPE_SND\n"); - _send((gnrc_pktsnip_t *)msg.content.ptr); + _send(msg.content.ptr); break; case GNRC_NETAPI_MSG_TYPE_SET: case GNRC_NETAPI_MSG_TYPE_GET: diff --git a/sys/net/network_layer/fib/fib.c b/sys/net/network_layer/fib/fib.c index a8475d5d3e416e49cff950969cd457837ab4a3f1..fb7183ce33b37fa2f63117c907ab267023636821 100644 --- a/sys/net/network_layer/fib/fib.c +++ b/sys/net/network_layer/fib/fib.c @@ -345,7 +345,7 @@ static int fib_signal_rp(fib_table_t *table, uint16_t type, uint8_t *dat, for (size_t i = 0; i < FIB_MAX_REGISTERED_RP; ++i) { if (table->notify_rp[i] != KERNEL_PID_UNDEF) { DEBUG("[fib_signal_rp] send msg@: %p to pid[%d]: %d\n", \ - (void *)msg.content.ptr, (int)i, (int)(table->notify_rp[i])); + msg.content.ptr, (int)i, (int)(table->notify_rp[i])); /* do only signal a RP if its registered prefix matches */ if (type != FIB_MSG_RP_SIGNAL_SOURCE_ROUTE_CREATED) { diff --git a/sys/net/routing/nhdp/nhdp.c b/sys/net/routing/nhdp/nhdp.c index a545ea383099ee413e372127df41a6dd2d51f901..703325c03fcf2f8073cc76c4619ebfc05686e9f5 100644 --- a/sys/net/routing/nhdp/nhdp.c +++ b/sys/net/routing/nhdp/nhdp.c @@ -203,7 +203,7 @@ int nhdp_register_if(kernel_pid_t if_pid, uint8_t *addr, size_t addr_size, uint8 /* Start sending periodic HELLO */ signal_msg.type = HELLO_TIMER; - signal_msg.content.ptr = (char *) if_entry; + signal_msg.content.ptr = if_entry; /* TODO: msg_send or msg_try_send? */ msg_try_send(&signal_msg, nhdp_pid); @@ -255,7 +255,7 @@ static void *_nhdp_runner(void *arg) switch (msg_rcvd.type) { case HELLO_TIMER: mutex_lock(&send_rcv_mutex); - if_entry = (nhdp_if_entry_t *) msg_rcvd.content.ptr; + if_entry = msg_rcvd.content.ptr; nhdp_writer_send_hello(if_entry); diff --git a/sys/posix/pthread/pthread.c b/sys/posix/pthread/pthread.c index a610d011360eb2ab539596eb10ff4ee806614060..dd7cbdf5a71d798b8e3872dd459bc5dd3ab572fd 100644 --- a/sys/posix/pthread/pthread.c +++ b/sys/posix/pthread/pthread.c @@ -108,7 +108,7 @@ static void *pthread_reaper(void *arg) while (1) { msg_t m; msg_receive(&m); - DEBUG("pthread_reaper(): free(%p)\n", (void *)m.content.ptr); + DEBUG("pthread_reaper(): free(%p)\n", m.content.ptr); free(m.content.ptr); } diff --git a/sys/sema/sema.c b/sys/sema/sema.c index 16b701e7a409bfb2d0fe80a16628725f158e8fe9..1025a7f1037dfe09e3e40b9ba4ec75a52a49558e 100644 --- a/sys/sema/sema.c +++ b/sys/sema/sema.c @@ -57,7 +57,7 @@ int sema_destroy(sema_t *sema) msg_t msg; kernel_pid_t pid = (kernel_pid_t)next->data; msg.type = MSG_DESTROYED; - msg.content.ptr = (void *) sema; + msg.content.ptr = sema; msg_send_int(&msg, pid); } irq_restore(old_state); @@ -77,7 +77,7 @@ int sema_wait_timed_msg(sema_t *sema, uint64_t timeout, msg_t *msg) old_state = irq_disable(); timeout_timer.target = 0, timeout_timer.long_target = 0; timeout_msg.type = MSG_TIMEOUT; - timeout_msg.content.ptr = (char *)sema; + timeout_msg.content.ptr = sema; /* we will stay in the same stack context so we can use timeout_msg */ xtimer_set_msg64(&timeout_timer, timeout, &timeout_msg, sched_active_pid); irq_restore(old_state); @@ -111,7 +111,7 @@ int sema_wait_timed_msg(sema_t *sema, uint64_t timeout, msg_t *msg) } priority_queue_remove(&sema->queue, &n); irq_restore(old_state); - if (msg->content.ptr != (void *)sema) { + if (msg->content.ptr != sema) { return -EAGAIN; } @@ -164,7 +164,7 @@ int sema_post(sema_t *sema) DEBUG("sema_post: %" PRIkernel_pid ": waking up %" PRIkernel_pid "\n", sched_active_thread->pid, next_process->pid); msg.type = MSG_SIGNAL; - msg.content.ptr = (void *) sema; + msg.content.ptr = sema; msg_send_int(&msg, pid); irq_restore(old_state); sched_switch(prio); diff --git a/sys/shell/commands/sc_icmpv6_echo.c b/sys/shell/commands/sc_icmpv6_echo.c index 741130a1ecb7cfac5d2b28b97ec44f5166cfe2c7..1e0225e94156225931c952edc870a37d47cd9627 100644 --- a/sys/shell/commands/sc_icmpv6_echo.c +++ b/sys/shell/commands/sc_icmpv6_echo.c @@ -289,7 +289,7 @@ int _icmpv6_ping(int argc, char **argv) case GNRC_NETAPI_MSG_TYPE_RCV: stop = xtimer_now() - start; - gnrc_pktsnip_t *pkt = (gnrc_pktsnip_t *)msg.content.ptr; + gnrc_pktsnip_t *pkt = msg.content.ptr; success += _handle_reply(pkt, stop); gnrc_pktbuf_release(pkt); @@ -318,7 +318,7 @@ int _icmpv6_ping(int argc, char **argv) while (msg_try_receive(&msg) > 0) { if (msg.type == GNRC_NETAPI_MSG_TYPE_RCV) { printf("dropping additional response packet (probably caused by duplicates)\n"); - gnrc_pktsnip_t *pkt = (gnrc_pktsnip_t *)msg.content.ptr; + gnrc_pktsnip_t *pkt = msg.content.ptr; gnrc_pktbuf_release(pkt); } } @@ -342,7 +342,7 @@ int _icmpv6_ping(int argc, char **argv) while (msg_try_receive(&msg) > 0) { if (msg.type == GNRC_NETAPI_MSG_TYPE_RCV) { printf("dropping additional response packet (probably caused by duplicates)\n"); - gnrc_pktsnip_t *pkt = (gnrc_pktsnip_t *)msg.content.ptr; + gnrc_pktsnip_t *pkt = msg.content.ptr; gnrc_pktbuf_release(pkt); } } diff --git a/sys/trickle/trickle.c b/sys/trickle/trickle.c index 10caca81bd489294580ce708aaaf9ed8c72212c1..49c43ee541451f4122fc744d8a92a96451e9b3d2 100644 --- a/sys/trickle/trickle.c +++ b/sys/trickle/trickle.c @@ -75,9 +75,9 @@ void trickle_start(kernel_pid_t pid, trickle_t *trickle, uint16_t interval_msg_t trickle->Imax = Imax; trickle->I = trickle->Imin + random_uint32_range(0, 4 * trickle->Imin); trickle->pid = pid; - trickle->msg_interval.content.ptr = (char *)trickle; + trickle->msg_interval.content.ptr = trickle; trickle->msg_interval.type = interval_msg_type; - trickle->msg_callback.content.ptr = (char *)trickle; + trickle->msg_callback.content.ptr = trickle; trickle->msg_callback.type = callback_msg_type; trickle_interval(trickle); diff --git a/sys/xtimer/xtimer.c b/sys/xtimer/xtimer.c index 97549435bbd2b384371157dbe0fee626982bf311..0271ef294cf05f8debf9ae840aa4ad8731dd9606 100644 --- a/sys/xtimer/xtimer.c +++ b/sys/xtimer/xtimer.c @@ -166,7 +166,7 @@ void xtimer_now_timex(timex_t *out) static void _setup_timer_msg(msg_t *m, xtimer_t *t) { m->type = MSG_XTIMER; - m->content.ptr = (char *) m; + m->content.ptr = m; t->target = t->long_target = 0; } @@ -175,7 +175,7 @@ static void _setup_timer_msg(msg_t *m, xtimer_t *t) static int _msg_wait(msg_t *m, msg_t *tmsg, xtimer_t *t) { msg_receive(m); - if (m->type == MSG_XTIMER && m->content.ptr == (char *) tmsg) { + if (m->type == MSG_XTIMER && m->content.ptr == tmsg) { /* we hit the timeout */ return -1; } diff --git a/tests/driver_at86rf2xx/main.c b/tests/driver_at86rf2xx/main.c index c2c98cb87beb86036d89309786636b79c404fe8a..6842e5600a848b4a564b04ce2cc91066c73013bf 100644 --- a/tests/driver_at86rf2xx/main.c +++ b/tests/driver_at86rf2xx/main.c @@ -48,7 +48,7 @@ static void _event_cb(netdev2_t *dev, netdev2_event_t event) msg_t msg; msg.type = MSG_TYPE_ISR; - msg.content.ptr = (void *) dev; + msg.content.ptr = dev; if (msg_send(&msg, _recv_pid) <= 0) { puts("gnrc_netdev2: possibly lost interrupt."); @@ -75,7 +75,7 @@ void *_recv_thread(void *arg) msg_t msg; msg_receive(&msg); if (msg.type == MSG_TYPE_ISR) { - netdev2_t *dev = (netdev2_t *)msg.content.ptr; + netdev2_t *dev = msg.content.ptr; dev->driver->isr(dev); } else { diff --git a/tests/driver_nrf24l01p_lowlevel/main.c b/tests/driver_nrf24l01p_lowlevel/main.c index ed6b7b5c56ae8facfad32477db3be7eaa9c7723a..e16fd6b0084c4b2865e32f3e1d7fe4f0415f59ae 100644 --- a/tests/driver_nrf24l01p_lowlevel/main.c +++ b/tests/driver_nrf24l01p_lowlevel/main.c @@ -139,16 +139,16 @@ void *nrf24l01p_rx_handler(void *arg) puts("Received packet."); /* CE low */ - nrf24l01p_stop((nrf24l01p_t *)m.content.ptr); + nrf24l01p_stop(m.content.ptr); /* read payload */ - nrf24l01p_read_payload((nrf24l01p_t *)m.content.ptr, rx_buf, NRF24L01P_MAX_DATA_LENGTH); + nrf24l01p_read_payload(m.content.ptr, rx_buf, NRF24L01P_MAX_DATA_LENGTH); /* flush rx fifo */ - nrf24l01p_flush_rx_fifo((nrf24l01p_t *)m.content.ptr); + nrf24l01p_flush_rx_fifo(m.content.ptr); /* CE high */ - nrf24l01p_start((nrf24l01p_t *)m.content.ptr); + nrf24l01p_start(m.content.ptr); /* print rx buffer */ for (int i = 0; i < NRF24L01P_MAX_DATA_LENGTH; i++) { diff --git a/tests/msg_send_receive/main.c b/tests/msg_send_receive/main.c index 81be76a7de7d1db23003b6165d9fb56200467ba2..7d2741071a22ceaa291cff2e4b7c185411908df6 100644 --- a/tests/msg_send_receive/main.c +++ b/tests/msg_send_receive/main.c @@ -45,7 +45,7 @@ static void *thread1(void *args) int counter = 0, success = 1; msg_resp.content.ptr = NULL; - msg_req.content.ptr = (void *) &counter; + msg_req.content.ptr = &counter; for (int i = 0; i < TEST_EXECUTION_NUM; i++) { msg_send_receive(&msg_req, &msg_resp, thread2_pid); @@ -76,7 +76,7 @@ static void *thread2(void *args) msg_t msg_req, msg_resp; int counter = 0; - msg_resp.content.ptr = (void *) &counter; + msg_resp.content.ptr = &counter; for (int i = 0; i < TEST_EXECUTION_NUM; i++) { msg_receive(&msg_req); diff --git a/tests/netdev2_test/main.c b/tests/netdev2_test/main.c index 13f7411100ccb02068fcbcb91c35ea46cd9cc97e..637174ef74e424497e855dfbcf42891ad40a6786 100644 --- a/tests/netdev2_test/main.c +++ b/tests/netdev2_test/main.c @@ -165,7 +165,7 @@ static int test_receive(void) puts("Expected netapi receive message"); return 0; } - pkt = (gnrc_pktsnip_t *)msg.content.ptr; + pkt = msg.content.ptr; /* check payload */ if (pkt->size != _tmp_len - sizeof(ethernet_hdr_t)) { puts("Payload of unexpected size"); diff --git a/tests/thread_msg_block_w_queue/main.c b/tests/thread_msg_block_w_queue/main.c index 549d12e68854cac6b8e4db6eaf802b7a8437d0ba..6e6617a5d5dacf57a904d18275ae20e4e7a86bdb 100644 --- a/tests/thread_msg_block_w_queue/main.c +++ b/tests/thread_msg_block_w_queue/main.c @@ -44,7 +44,7 @@ void *thread1(void *arg) /* step 2: send message, turning its status into STATUS_REPLY_BLOCKED */ msg_send_receive(&msg, &reply, p_main); printf("received: %" PRIkernel_pid ", %u \n", reply.sender_pid, reply.type); - printf("pointer: %s\n", reply.content.ptr); + printf("pointer: %s\n", (char *)reply.content.ptr); printf("THREAD %" PRIkernel_pid " SHOULD BE BLOCKING :(\n", p1); diff --git a/tests/thread_msg_block_wo_queue/main.c b/tests/thread_msg_block_wo_queue/main.c index cce12b5ea2e111a9dbff538334f9bdd3a4528332..a5e38fbf07d8765e86bf1afe424ced231004b42b 100644 --- a/tests/thread_msg_block_wo_queue/main.c +++ b/tests/thread_msg_block_wo_queue/main.c @@ -44,7 +44,7 @@ void *thread1(void *arg) /* step 2: send message, turning its status into STATUS_REPLY_BLOCKED */ msg_send_receive(&msg, &reply, p_main); printf("received: %" PRIkernel_pid ", %u \n", reply.sender_pid, reply.type); - printf("pointer: %s\n", reply.content.ptr); + printf("pointer: %s\n", (char *)reply.content.ptr); printf("THREAD %" PRIkernel_pid " SHOULD BE BLOCKING :(\n", p1); diff --git a/tests/thread_msg_seq/main.c b/tests/thread_msg_seq/main.c index f07b81264b161d1b26d31c68e02815cc391b12ea..ea9c6fee9ab96829ddbd90f0f6a563f20edef301 100644 --- a/tests/thread_msg_seq/main.c +++ b/tests/thread_msg_seq/main.c @@ -39,7 +39,7 @@ void *sub_thread(void *arg) msg_t msg; - msg.content.ptr = (char*) arg; + msg.content.ptr = arg; msg_send(&msg, p_main); @@ -68,7 +68,7 @@ int main(void) puts("THREADS CREATED\n"); for(int i = 0; i < 3; i++) { msg_receive(&msg); - printf("Got msg from pid %" PRIkernel_pid ": \"%s\"\n", msg.sender_pid, msg.content.ptr); + printf("Got msg from pid %" PRIkernel_pid ": \"%s\"\n", msg.sender_pid, (char *)msg.content.ptr); } return 0; diff --git a/tests/xtimer_drift/main.c b/tests/xtimer_drift/main.c index fbd23b2ead86da23cc11e7804f474c22f7eb1cbf..ef104aa9d92d3bb99d9906b047606060f441c09e 100644 --- a/tests/xtimer_drift/main.c +++ b/tests/xtimer_drift/main.c @@ -73,12 +73,12 @@ void *slacker_thread(void *arg) while (1) { msg_t m; msg_receive(&m); - struct timer_msg *tmsg = (struct timer_msg *) m.content.ptr; + struct timer_msg *tmsg = m.content.ptr; xtimer_now_timex(&now); xtimer_usleep(TEST_MSG_RX_USLEEP); tmsg->msg.type = 12345; - tmsg->msg.content.ptr = (void*)tmsg; + tmsg->msg.content.ptr = tmsg; xtimer_set_msg(&tmsg->timer, tmsg->interval, &tmsg->msg, thread_getpid()); } } @@ -157,11 +157,11 @@ int main(void) "slacker1"); puts("sending 1st msg"); - m.content.ptr = (char *) &msg_a; + m.content.ptr = &msg_a; msg_try_send(&m, pid1); puts("sending 2nd msg"); - m.content.ptr = (char *) &msg_b; + m.content.ptr = &msg_b; msg_try_send(&m, pid1); kernel_pid_t pid2 = thread_create( @@ -174,11 +174,11 @@ int main(void) "slacker2"); puts("sending 3rd msg"); - m.content.ptr = (char *) &msg_c; + m.content.ptr = &msg_c; msg_try_send(&m, pid2); puts("sending 4th msg"); - m.content.ptr = (char *) &msg_d; + m.content.ptr = &msg_d; msg_try_send(&m, pid2); kernel_pid_t pid3 = thread_create( diff --git a/tests/xtimer_msg/main.c b/tests/xtimer_msg/main.c index 341da6119b692ceeb4fa5a048aa913406fc7d0e8..1ceeea27923c3a76c35c26ebf586297bd793f731 100644 --- a/tests/xtimer_msg/main.c +++ b/tests/xtimer_msg/main.c @@ -57,7 +57,7 @@ void *timer_thread(void *arg) while (1) { msg_t m; msg_receive(&m); - struct timer_msg *tmsg = (struct timer_msg *) m.content.ptr; + struct timer_msg *tmsg = m.content.ptr; xtimer_now_timex(&now); printf("now=%" PRIu32 ":%" PRIu32 " -> every %" PRIu32 ".%" PRIu32 "s: %s\n", now.seconds, @@ -67,7 +67,7 @@ void *timer_thread(void *arg) tmsg->text); tmsg->msg.type = 12345; - tmsg->msg.content.ptr = (void*)tmsg; + tmsg->msg.content.ptr = tmsg; xtimer_set_msg(&tmsg->timer, tmsg->interval, &tmsg->msg, thread_getpid()); } } @@ -104,11 +104,11 @@ int main(void) "timer"); puts("sending 1st msg"); - m.content.ptr = (char *) &msg_a; + m.content.ptr = &msg_a; msg_try_send(&m, pid); puts("sending 2nd msg"); - m.content.ptr = (char *) &msg_b; + m.content.ptr = &msg_b; msg_try_send(&m, pid); kernel_pid_t pid2 = thread_create(