11/*
2- * Copyright (C) 2009 The Android Open Source Project
2+ * Copyright (C) 2009-2012 The Android Open Source Project
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -71,11 +71,11 @@ void Allocation::read(void *data) {
7171}
7272
7373void Allocation::data (Context *rsc, uint32_t xoff, uint32_t lod,
74- uint32_t count, const void *data, uint32_t sizeBytes) {
75- const uint32_t eSize = mHal .state .type ->getElementSizeBytes ();
74+ uint32_t count, const void *data, size_t sizeBytes) {
75+ const size_t eSize = mHal .state .type ->getElementSizeBytes ();
7676
7777 if ((count * eSize) != sizeBytes) {
78- ALOGE (" Allocation::subData called with mismatched size expected %i , got %i " ,
78+ ALOGE (" Allocation::subData called with mismatched size expected %zu , got %zu " ,
7979 (count * eSize), sizeBytes);
8080 mHal .state .type ->dumpLOGV (" type info" );
8181 return ;
@@ -86,14 +86,14 @@ void Allocation::data(Context *rsc, uint32_t xoff, uint32_t lod,
8686}
8787
8888void Allocation::data (Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
89- uint32_t w, uint32_t h, const void *data, uint32_t sizeBytes) {
90- const uint32_t eSize = mHal .state .elementSizeBytes ;
91- const uint32_t lineSize = eSize * w;
89+ uint32_t w, uint32_t h, const void *data, size_t sizeBytes) {
90+ const size_t eSize = mHal .state .elementSizeBytes ;
91+ const size_t lineSize = eSize * w;
9292
9393 // ALOGE("data2d %p, %i %i %i %i %i %i %p %i", this, xoff, yoff, lod, face, w, h, data, sizeBytes);
9494
9595 if ((lineSize * h) != sizeBytes) {
96- ALOGE (" Allocation size mismatch, expected %i , got %i " , (lineSize * h), sizeBytes);
96+ ALOGE (" Allocation size mismatch, expected %zu , got %zu " , (lineSize * h), sizeBytes);
9797 rsAssert (!" Allocation::subData called with mismatched size" );
9898 return ;
9999 }
@@ -104,12 +104,12 @@ void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod,
104104
105105void Allocation::data (Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff,
106106 uint32_t lod, RsAllocationCubemapFace face,
107- uint32_t w, uint32_t h, uint32_t d, const void *data, uint32_t sizeBytes) {
107+ uint32_t w, uint32_t h, uint32_t d, const void *data, size_t sizeBytes) {
108108}
109109
110110void Allocation::elementData (Context *rsc, uint32_t x, const void *data,
111- uint32_t cIdx, uint32_t sizeBytes) {
112- uint32_t eSize = mHal .state .elementSizeBytes ;
111+ uint32_t cIdx, size_t sizeBytes) {
112+ size_t eSize = mHal .state .elementSizeBytes ;
113113
114114 if (cIdx >= mHal .state .type ->getElement ()->getFieldCount ()) {
115115 ALOGE (" Error Allocation::subElementData component %i out of range." , cIdx);
@@ -125,7 +125,7 @@ void Allocation::elementData(Context *rsc, uint32_t x, const void *data,
125125
126126 const Element * e = mHal .state .type ->getElement ()->getField (cIdx);
127127 if (sizeBytes != e->getSizeBytes ()) {
128- ALOGE (" Error Allocation::subElementData data size %i does not match field size %zu." , sizeBytes, e->getSizeBytes ());
128+ ALOGE (" Error Allocation::subElementData data size %zu does not match field size %zu." , sizeBytes, e->getSizeBytes ());
129129 rsc->setError (RS_ERROR_BAD_VALUE, " subElementData bad size." );
130130 return ;
131131 }
@@ -135,8 +135,8 @@ void Allocation::elementData(Context *rsc, uint32_t x, const void *data,
135135}
136136
137137void Allocation::elementData (Context *rsc, uint32_t x, uint32_t y,
138- const void *data, uint32_t cIdx, uint32_t sizeBytes) {
139- uint32_t eSize = mHal .state .elementSizeBytes ;
138+ const void *data, uint32_t cIdx, size_t sizeBytes) {
139+ size_t eSize = mHal .state .elementSizeBytes ;
140140
141141 if (x >= mHal .state .dimensionX ) {
142142 ALOGE (" Error Allocation::subElementData X offset %i out of range." , x);
@@ -159,7 +159,7 @@ void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y,
159159 const Element * e = mHal .state .type ->getElement ()->getField (cIdx);
160160
161161 if (sizeBytes != e->getSizeBytes ()) {
162- ALOGE (" Error Allocation::subElementData data size %i does not match field size %zu." , sizeBytes, e->getSizeBytes ());
162+ ALOGE (" Error Allocation::subElementData data size %zu does not match field size %zu." , sizeBytes, e->getSizeBytes ());
163163 rsc->setError (RS_ERROR_BAD_VALUE, " subElementData bad size." );
164164 return ;
165165 }
@@ -249,7 +249,7 @@ void Allocation::writePackedData(const Type *type,
249249 delete[] sizeUnpadded;
250250}
251251
252- void Allocation::unpackVec3Allocation (const void *data, uint32_t dataSize) {
252+ void Allocation::unpackVec3Allocation (const void *data, size_t dataSize) {
253253 const uint8_t *src = (const uint8_t *)data;
254254 uint8_t *dst = (uint8_t *)getPtr ();
255255
@@ -519,13 +519,13 @@ void rsi_Allocation1DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t
519519}
520520
521521void rsi_Allocation2DElementData (Context *rsc, RsAllocation va, uint32_t x, uint32_t y, uint32_t lod, RsAllocationCubemapFace face,
522- const void *data, size_t eoff, uint32_t sizeBytes ) { // TODO: this seems wrong, eoff and sizeBytes may be swapped
522+ const void *data, size_t sizeBytes, size_t eoff ) {
523523 Allocation *a = static_cast <Allocation *>(va);
524524 a->elementData (rsc, x, y, data, eoff, sizeBytes);
525525}
526526
527527void rsi_Allocation1DElementData (Context *rsc, RsAllocation va, uint32_t x, uint32_t lod,
528- const void *data, size_t eoff, uint32_t sizeBytes ) { // TODO: this seems wrong, eoff and sizeBytes may be swapped
528+ const void *data, size_t sizeBytes, size_t eoff ) {
529529 Allocation *a = static_cast <Allocation *>(va);
530530 a->elementData (rsc, x, data, eoff, sizeBytes);
531531}
0 commit comments