buffer.cpp: cast to unsigned long