aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkChecksum.h
diff options
context:
space:
mode:
authorGravatar rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-23 18:09:54 +0000
committerGravatar rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-23 18:09:54 +0000
commitfbfcd5602128ec010c82cb733c9cdc0a3254f9f3 (patch)
treed8b4815d15946c32ee9d254e932411e93be942bb /include/core/SkChecksum.h
parent2abed834789bb64c7da740df4c47efc142b7311a (diff)
Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part I of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6485054 git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkChecksum.h')
-rw-r--r--include/core/SkChecksum.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/core/SkChecksum.h b/include/core/SkChecksum.h
index e66df54aaf..e5cc3d101f 100644
--- a/include/core/SkChecksum.h
+++ b/include/core/SkChecksum.h
@@ -21,11 +21,11 @@ private:
ROTL = sizeof(uintptr_t) * 8 - ROTR,
HALFBITS = sizeof(uintptr_t) * 4
};
-
+
static inline uintptr_t Mash(uintptr_t total, uintptr_t value) {
return ((total >> ROTR) | (total << ROTL)) ^ value;
}
-
+
public:
/**
* Compute a 32-bit checksum for a given data block
@@ -37,7 +37,7 @@ public:
*/
static uint32_t Compute(const uint32_t* data, size_t size) {
SkASSERT(SkIsAlign4(size));
-
+
/*
* We want to let the compiler use 32bit or 64bit addressing and math
* so we use uintptr_t as our magic type. This makes the code a little
@@ -46,7 +46,7 @@ public:
*/
uintptr_t result = 0;
const uintptr_t* ptr = reinterpret_cast<const uintptr_t*>(data);
-
+
/*
* count the number of quad element chunks. This takes into account
* if we're on a 32bit or 64bit arch, since we use sizeof(uintptr_t)
@@ -60,13 +60,13 @@ public:
result = Mash(result, *ptr++);
}
size &= ((sizeof(uintptr_t) << 2) - 1);
-
+
data = reinterpret_cast<const uint32_t*>(ptr);
const uint32_t* stop = data + (size >> 2);
while (data < stop) {
result = Mash(result, *data++);
}
-
+
/*
* smash us down to 32bits if we were 64. Note that when uintptr_t is
* 32bits, this code-path should go away, but I still got a warning