Make SkIsPow2 templated
authorbsalomon <bsalomon@google.com>
Fri, 31 Jul 2015 15:22:17 +0000 (08:22 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 31 Jul 2015 15:22:17 +0000 (08:22 -0700)
Review URL: https://codereview.chromium.org/1271533002

include/core/SkMath.h

index d9517dd..d1d0e36 100644 (file)
@@ -150,7 +150,7 @@ static inline int SkNextLog2(uint32_t value) {
  *  Returns true if value is a power of 2. Does not explicitly check for
  *  value <= 0.
  */
-static inline bool SkIsPow2(int value) {
+template <typename T> inline bool SkIsPow2(T value) {
     return (value & (value - 1)) == 0;
 }