Fix compiler warnings in trim.cpp.