use std::max, std::min instead of macro, fix compile warning.
Merge pull request #155 from sunyc/master

use std::max, std::min instead of macro, fix compile warning.