[04/10] test-pmd: do explicit 64-bit shift to avoid implicit conversion
Checks
Commit Message
Compiling with MSVC results in warnings like the one below:
app/test-pmd/util.c(201): warning C4334: '<<': result of 32-bit shift
implicitly converted to 64 bits (was 64-bit shift intended?)
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
app/test-pmd/cmdline.c | 4 ++--
app/test-pmd/testpmd.c | 2 +-
app/test-pmd/util.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
Comments
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
On 2025/2/12 6:02, Andre Muezerie wrote:
> Compiling with MSVC results in warnings like the one below:
>
> app/test-pmd/util.c(201): warning C4334: '<<': result of 32-bit shift
> implicitly converted to 64 bits (was 64-bit shift intended?)
>
> Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
@@ -12632,11 +12632,11 @@ cmd_config_dynf_specific_parsed(void *parsed_result,
}
old_port_flags = ports[res->port_id].mbuf_dynf;
if (!strcmp(res->value, "set")) {
- ports[res->port_id].mbuf_dynf |= 1UL << flag;
+ ports[res->port_id].mbuf_dynf |= RTE_BIT64(flag);
if (old_port_flags == 0)
add_tx_dynf_callback(res->port_id);
} else {
- ports[res->port_id].mbuf_dynf &= ~(1UL << flag);
+ ports[res->port_id].mbuf_dynf &= ~RTE_BIT64(flag);
if (ports[res->port_id].mbuf_dynf == 0)
remove_tx_dynf_callback(res->port_id);
}
@@ -4152,7 +4152,7 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, enum dcb_mode_enable dcb_mode,
for (i = 0; i < vmdq_rx_conf->nb_pool_maps; i++) {
vmdq_rx_conf->pool_map[i].vlan_id = vlan_tags[i];
vmdq_rx_conf->pool_map[i].pools =
- 1 << (i % vmdq_rx_conf->nb_queue_pools);
+ RTE_BIT64(i % vmdq_rx_conf->nb_queue_pools);
}
for (i = 0; i < RTE_ETH_DCB_NUM_USER_PRIORITIES; i++) {
vmdq_rx_conf->dcb_tc[i] = i % num_tcs;
@@ -201,7 +201,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
MKDUMPSTR(print_buf, buf_size, cur_len,
" - dynf %s: %d",
dynf_names[dynf_index],
- !!(ol_flags & (1UL << dynf_index)));
+ !!(ol_flags & RTE_BIT64(dynf_index)));
}
if (mb->packet_type) {
rte_get_ptype_name(mb->packet_type, buf, sizeof(buf));