An additivity theorem for uniformly continuous functions