sparkfun / SparkFun_VL53L1X_Arduino_Library

A library for the laser based VL53L1X Time Of Flight distance sensor capable of detecting a target 4m away!
MIT License
88 stars 50 forks source link

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

Open thuscoder opened 1 year ago

thuscoder commented 1 year ago

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?