Use min_t() instead of min(). use ssize_t instead size_t.