changed static cast int16_t to uint16_t

change in static cast to prevent compiler warnings