Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: include/core/SkMath.h

Issue 1271533002: Make SkIsPow2 templated (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: don't rename Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkMath.h
diff --git a/include/core/SkMath.h b/include/core/SkMath.h
index d9517dd6a228f4bdce4a581385a34633dc05c5e5..d1d0e360d47fe62737aec675c9b8865e97f19734 100644
--- a/include/core/SkMath.h
+++ b/include/core/SkMath.h
@@ -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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698