summaryrefslogtreecommitdiff
path: root/cpu_ref/rsCpuScript.cpp
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-06-25 00:01:23 -0700
committerStephen Hines <srhines@google.com>2014-06-25 00:01:23 -0700
commitac8d146a41f18afad5314ac8af440d6aedbe20bf (patch)
treec2744c21c48b464ab70ee919ae32b0a6946f64a1 /cpu_ref/rsCpuScript.cpp
parentb31d9c956cc78b721e35bf74c96c7284e453f30f (diff)
Switch the dimensions array to use uint32_t instead of size_t.
size_t isn't safe, since we pack/unpack the array as a 32-bit int array, but that is the wrong type for 64-bit. Switching to uint32_t is better, since we only support 1 dimension today, and won't need many more than that even for complex cases in the future. Change-Id: Ie0dda264a9398b0e385e0f9ee0a91cda08325dbc
Diffstat (limited to 'cpu_ref/rsCpuScript.cpp')
-rw-r--r--cpu_ref/rsCpuScript.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpu_ref/rsCpuScript.cpp b/cpu_ref/rsCpuScript.cpp
index 29b1bf8a..81e70f0d 100644
--- a/cpu_ref/rsCpuScript.cpp
+++ b/cpu_ref/rsCpuScript.cpp
@@ -992,7 +992,7 @@ void RsdCpuScriptImpl::getGlobalVar(uint32_t slot, void *data, size_t dataLength
void RsdCpuScriptImpl::setGlobalVarWithElemDims(uint32_t slot, const void *data, size_t dataLength,
const Element *elem,
- const size_t *dims, size_t dimLength) {
+ const uint32_t *dims, size_t dimLength) {
#ifndef RS_COMPATIBILITY_LIB
int32_t *destPtr = reinterpret_cast<int32_t *>(
@@ -1015,14 +1015,14 @@ void RsdCpuScriptImpl::setGlobalVarWithElemDims(uint32_t slot, const void *data,
// First do the increment loop.
size_t stride = elem->getSizeBytes();
const char *cVal = reinterpret_cast<const char *>(data);
- for (size_t i = 0; i < dims[0]; i++) {
+ for (uint32_t i = 0; i < dims[0]; i++) {
elem->incRefs(cVal);
cVal += stride;
}
// Decrement loop comes after (to prevent race conditions).
char *oldVal = reinterpret_cast<char *>(destPtr);
- for (size_t i = 0; i < dims[0]; i++) {
+ for (uint32_t i = 0; i < dims[0]; i++) {
elem->decRefs(oldVal);
oldVal += stride;
}