Skip to content

Commit 7553b42

Browse files
authored
Fix conversion warning (project-chip#41899)
This commit explicitly cast the interface number to fix the conversion warning: ```bash error: conversion from ‘long unsigned int’ to ‘chip::Inet::InterfaceId::PlatformType’ {aka ‘unsigned int’} may change value [-Werror=conversion] ```
1 parent 320b105 commit 7553b42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/inet/InetInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ CHIP_ERROR InterfaceId::InterfaceNameToId(const char * intfName, InterfaceId & i
9595
return INET_ERROR_UNKNOWN_INTERFACE;
9696
}
9797

98-
interface = InterfaceId(intfNum);
98+
interface = InterfaceId(static_cast<PlatformType>(intfNum));
9999
if (intfNum == 0)
100100
{
101101
return INET_ERROR_UNKNOWN_INTERFACE;

0 commit comments

Comments
 (0)