TS-1690: Fix build on arm/Ubuntu/gcc 4.4

Cast an unsigned to a long int.
TS-1690: build-fix for arm/ubuntu/gcc-4.2

again, we static_cast to long int, as it's what the FMT expects, and
it's the bigger type.