Skip to content

Commit 8f1f143

Browse files
committed
Add explicit cast for mac
1 parent 875feac commit 8f1f143

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/portable/NetworkInterface/MPS2_AN385/ether_lan9118/smsc9220_eth_drv.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -955,12 +955,12 @@ enum smsc9220_error_t smsc9220_read_mac_address( const struct smsc9220_eth_dev_t
955955
return SMSC9220_ERROR_INTERNAL;
956956
}
957957

958-
mac[ 0 ] = mac_low & 0xFF;
959-
mac[ 1 ] = ( mac_low >> 8 ) & 0xFF;
960-
mac[ 2 ] = ( mac_low >> 16 ) & 0xFF;
958+
mac[ 0 ] = ( char ) ( mac_low & 0xFF );
959+
mac[ 1 ] = ( char ) ( ( mac_low >> 8 ) & 0xFF );
960+
mac[ 2 ] = ( char ) ( ( mac_low >> 16 ) & 0xFF );
961961
mac[ 3 ] = ( char ) ( ( mac_low >> 24 ) & 0xFF );
962-
mac[ 4 ] = mac_high & 0xFF;
963-
mac[ 5 ] = ( mac_high >> 8 ) & 0xFF;
962+
mac[ 4 ] = ( char ) ( mac_high & 0xFF );
963+
mac[ 5 ] = ( char ) ( ( mac_high >> 8 ) & 0xFF );
964964

965965
return SMSC9220_ERROR_NONE;
966966
}

0 commit comments

Comments
 (0)