SparkFun_VL53L1X_Arduino_Library icon indicating copy to clipboard operation
SparkFun_VL53L1X_Arduino_Library copied to clipboard

Unnecessary (int) cast of return value in SFEVL53L1X::getDistance()

Open thuscoder opened this issue 2 years ago • 0 comments
trafficstars

uint16_t SFEVL53L1X::getDistance() { uint16_t distance; _device->VL53L1X_GetDistance(&distance); return (int)distance; }

The function return type is uint16_t. Why is there an "(int)" cast in the return statement?

thuscoder avatar Jan 15 '23 02:01 thuscoder