kwiberg 0703856b53 Add SafeClamp(), which accepts args of different types
Specifically, just like SafeMin() and SafeMax() it handles all
combinations of integer and all
combinations of floating-point arguments by picking a
result type that is guaranteed to be able to hold the result.

This CL also replaces a bunch of std::min + std:max call pairs with
calls to SafeClamp()---the ones that could easily be found by grep
because "min" and "max" were on the same line. :-)

BUG=webrtc:7459

Review-Url: https://codereview.webrtc.org/2808513003
Cr-Commit-Position: refs/heads/master@{#18542}
2017-06-12 18:40:47 +00:00
..
2015-04-02 10:31:00 +00:00
2016-12-14 23:03:11 +00:00
2016-12-14 23:03:11 +00:00
2015-12-28 22:07:05 +00:00
2015-12-28 22:07:05 +00:00
2015-04-01 22:25:29 +00:00
2016-08-16 13:38:23 +00:00
2017-03-27 11:37:14 +00:00
2016-07-01 10:45:29 +00:00
2016-02-02 16:34:16 +00:00
2017-04-11 05:44:07 +00:00
2017-05-13 05:52:51 +00:00
2017-03-15 11:36:29 +00:00
2017-03-15 11:36:29 +00:00
2017-04-10 13:56:58 +00:00
2016-10-03 07:30:08 +00:00