summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Luc Brouillet <jeanluc@google.com>2015-05-19 14:12:43 -0700
committerJean-Luc Brouillet <jeanluc@google.com>2015-05-20 13:44:44 -0700
commit2089cddba3e6e6bb7643ed670ee038dce0b8db6e (patch)
tree32e15820faa67ca7a02c8cf4c3e68f3a945b2ea6
parentc705223e0e5dff3bbd10f82c216784316f3c3398 (diff)
downloadrs-2089cddba3e6e6bb7643ed670ee038dce0b8db6e.tar.gz
Fix warnings in RenderScript sources.
An upcoming CL fixes a bug where many warning were disabled. This fixes the warnings (that are turned into errors in most of our builds) before the CL lands. Also, adds long & unsigned long testing for a few tests. Change-Id: Id6826e968db2d06ef9910fe775309d1c3872cdc5
-rw-r--r--java/tests/Balls/src/com/example/android/rs/balls/balls.rs2
-rw-r--r--java/tests/ComputeBenchmark/src/com/example/android/rs/computebench/compute_benchmark.rs23
-rw-r--r--java/tests/ImageProcessing/src/com/android/rs/image/bwfilter.rs2
-rw-r--r--java/tests/ImageProcessing/src/com/android/rs/image/threshold.rs5
-rw-r--r--java/tests/ImageProcessing/src/com/android/rs/image/vibrance.rs7
-rw-r--r--java/tests/ImageProcessing2/src/com/android/rs/image/vibrance.rs1
-rw-r--r--java/tests/ImageProcessing_jb/src/com/android/rs/image/bwfilter.rs2
-rw-r--r--java/tests/ImageProcessing_jb/src/com/android/rs/image/threshold.rs5
-rw-r--r--java/tests/ImageProcessing_jb/src/com/android/rs/image/vibrance.rs7
-rw-r--r--java/tests/RSTest_CompatLib/src/com/android/rs/test/element.rs9
-rw-r--r--java/tests/RSTest_CompatLib/src/com/android/rs/test/fp_mad.rs6
-rw-r--r--java/tests/RSTest_CompatLib/src/com/android/rs/test/math_agree.rs17
-rw-r--r--java/tests/RSTest_CompatLib/src/com/android/rs/test/rstypes.rs9
-rw-r--r--java/tests/RSTest_CompatLib/src/com/android/rs/test/shared.rsh25
-rw-r--r--java/tests/RsTest/src/com/android/rs/test/element.rs8
-rw-r--r--java/tests/RsTest/src/com/android/rs/test/fp_mad.rs8
-rw-r--r--java/tests/RsTest/src/com/android/rs/test/math.rs3
-rw-r--r--java/tests/RsTest/src/com/android/rs/test/math_agree.rs7
-rw-r--r--java/tests/RsTest/src/com/android/rs/test/rstypes.rs14
-rw-r--r--java/tests/RsTest/src/com/android/rs/test/shared.rsh25
-rw-r--r--java/tests/RsTest_11/src/com/android/rs/test/fp_mad.rs8
-rw-r--r--java/tests/RsTest_11/src/com/android/rs/test/rstypes.rs18
-rw-r--r--java/tests/RsTest_11/src/com/android/rs/test/shared.rsh5
-rw-r--r--java/tests/RsTest_14/src/com/android/rs/test/fp_mad.rs8
-rw-r--r--java/tests/RsTest_14/src/com/android/rs/test/rstypes.rs20
-rw-r--r--java/tests/RsTest_14/src/com/android/rs/test/shared.rsh5
-rw-r--r--java/tests/RsTest_16/src/com/android/rs/test/fp_mad.rs8
-rw-r--r--java/tests/RsTest_16/src/com/android/rs/test/rstypes.rs18
-rw-r--r--java/tests/RsTest_16/src/com/android/rs/test/shared.rsh5
-rw-r--r--java/tests/ScriptGroupTest/src/com/android/rs/sgtest/vibrance_f.rs1
-rw-r--r--java/tests/VrDemo/src/com/example/android/rs/vr/engine/bugdroid.rs2
-rw-r--r--java/tests/VrDemo/src/com/example/android/rs/vr/engine/mandelbulb.rs6
-rw-r--r--java/tests/VrDemo/src/com/example/android/rs/vr/engine/vr.rs5
33 files changed, 142 insertions, 152 deletions
diff --git a/java/tests/Balls/src/com/example/android/rs/balls/balls.rs b/java/tests/Balls/src/com/example/android/rs/balls/balls.rs
index 077916db..bb51db65 100644
--- a/java/tests/Balls/src/com/example/android/rs/balls/balls.rs
+++ b/java/tests/Balls/src/com/example/android/rs/balls/balls.rs
@@ -46,7 +46,7 @@ int root() {
int2 gridDims = (int2){ rsAllocationGetDimX(gGrid),
rsAllocationGetDimY(gGrid) };
- rs_allocation aNull; // Empty rs_allocation, since we don't have an input.
+ rs_allocation aNull = {0}; // Empty rs_allocation, since we don't have an input.
rs_allocation aout = rsGetAllocation(balls);
int32_t dimX = rsAllocationGetDimX(aout);
diff --git a/java/tests/ComputeBenchmark/src/com/example/android/rs/computebench/compute_benchmark.rs b/java/tests/ComputeBenchmark/src/com/example/android/rs/computebench/compute_benchmark.rs
index 2ee56ec9..fb8baaae 100644
--- a/java/tests/ComputeBenchmark/src/com/example/android/rs/computebench/compute_benchmark.rs
+++ b/java/tests/ComputeBenchmark/src/com/example/android/rs/computebench/compute_benchmark.rs
@@ -60,13 +60,22 @@ static volatile long4 prefix##_l_4 = 1; \
static volatile ulong prefix##_ul_1 = 1; \
static volatile ulong2 prefix##_ul_2 = 1; \
static volatile ulong3 prefix##_ul_3 = 1; \
-static volatile ulong4 prefix##_ul_4 = 1; \
+static volatile ulong4 prefix##_ul_4 = 1;
DECL_VAR_SET(res)
DECL_VAR_SET(src1)
DECL_VAR_SET(src2)
-DECL_VAR_SET(src3)
+static volatile float src3_f_1 = 1; \
+static volatile float2 src3_f_2 = 1; \
+static volatile float3 src3_f_3 = 1; \
+static volatile float4 src3_f_4 = 1; \
+static volatile char src3_c_1 = 1; \
+static volatile uchar src3_uc_1 = 1; \
+static volatile short src3_s_1 = 1; \
+static volatile ushort src3_us_1 = 1; \
+static volatile int src3_i_1 = 1; \
+static volatile uint src3_ui_1 = 1; \
// Testing macros
@@ -95,6 +104,8 @@ DECL_VAR_SET(src3)
BENCH_BASIC_OP_TYPE(op, us) \
BENCH_BASIC_OP_TYPE(op, i) \
BENCH_BASIC_OP_TYPE(op, ui) \
+ BENCH_BASIC_OP_TYPE(op, l) \
+ BENCH_BASIC_OP_TYPE(op, ul) \
RUN_BENCH(res_l_1 = src1_l_1 op src2_l_1, "l1 " #op " l1") \
RUN_BENCH(res_ul_1 = src1_ul_1 op src2_ul_1, "ul1 " #op " ul1")
@@ -116,6 +127,8 @@ DECL_VAR_SET(src3)
BENCH_CVT(to, us, type); \
BENCH_CVT(to, i, type); \
BENCH_CVT(to, ui, type); \
+ BENCH_CVT(to, l, type); \
+ BENCH_CVT(to, ul, type); \
BENCH_CVT(to, f, type); \
#define BENCH_XN_FUNC_YN(typeout, fnc, typein) \
@@ -266,7 +279,6 @@ DECL_VAR_SET(src3)
// Testing functions
static void bench_basic_operators() {
- int i = 0;
BENCH_BASIC_OP(+);
BENCH_BASIC_OP(-);
BENCH_BASIC_OP(*);
@@ -283,6 +295,8 @@ static void bench_convert() {
BENCH_CVT_MATRIX(us, ushort);
BENCH_CVT_MATRIX(i, int);
BENCH_CVT_MATRIX(ui, uint);
+ BENCH_CVT_MATRIX(l, long);
+ BENCH_CVT_MATRIX(ul, ulong);
BENCH_CVT_MATRIX(f, float);
}
@@ -291,7 +305,7 @@ static void bench_int_math() {
BENCH_IN_FUNC_IN(clz);
BENCH_IN_FUNC_IN_IN(min);
BENCH_IN_FUNC_IN_IN(max);
- BENCH_I_FUNC_I_I_I(rsClamp);
+ BENCH_I_FUNC_I_I_I(clamp);
}
static void bench_fp_math() {
@@ -404,4 +418,3 @@ void bench() {
bench_fp_math();
bench_approx_math();
}
-
diff --git a/java/tests/ImageProcessing/src/com/android/rs/image/bwfilter.rs b/java/tests/ImageProcessing/src/com/android/rs/image/bwfilter.rs
index e2116209..23f64f59 100644
--- a/java/tests/ImageProcessing/src/com/android/rs/image/bwfilter.rs
+++ b/java/tests/ImageProcessing/src/com/android/rs/image/bwfilter.rs
@@ -48,5 +48,5 @@ void bwFilterKernel(const uchar4 *in, uchar4 *out) {
localMax = fmax(g,b);
localMax = fmax(r,localMax);
avg = (localMin+localMax) * 0.5f;
- out->r = out->g = out->b = rsClamp(avg, 0, 255);
+ out->r = out->g = out->b = clamp((int) avg, 0, 255);
}
diff --git a/java/tests/ImageProcessing/src/com/android/rs/image/threshold.rs b/java/tests/ImageProcessing/src/com/android/rs/image/threshold.rs
index 40d4fa2d..1309df59 100644
--- a/java/tests/ImageProcessing/src/com/android/rs/image/threshold.rs
+++ b/java/tests/ImageProcessing/src/com/android/rs/image/threshold.rs
@@ -85,7 +85,7 @@ uchar4 RS_KERNEL vert(uint32_t x, uint32_t y) {
}
} else {
for (int r = -radius; r <= radius; r ++) {
- int validH = rsClamp((int)y + r, (int)0, (int)(height - 1));
+ int validH = clamp((int)y + r, (int)0, (int)(height - 1));
float4 i = rsGetElementAt_float4(ScratchPixel2, x, validH);
blurredPixel += i.xyz * gaussian[gi++];
}
@@ -107,7 +107,7 @@ float4 RS_KERNEL horz(uint32_t x, uint32_t y) {
} else {
for (int r = -radius; r <= radius; r ++) {
// Stepping left and right away from the pixel
- int validX = rsClamp((int)x + r, (int)0, (int)(width - 1));
+ int validX = clamp((int)x + r, (int)0, (int)(width - 1));
float4 i = rsGetElementAt_float4(ScratchPixel1, validX, y);
blurredPixel += i * gaussian[gi++];
}
@@ -115,4 +115,3 @@ float4 RS_KERNEL horz(uint32_t x, uint32_t y) {
return blurredPixel;
}
-
diff --git a/java/tests/ImageProcessing/src/com/android/rs/image/vibrance.rs b/java/tests/ImageProcessing/src/com/android/rs/image/vibrance.rs
index 865c77ef..acd9cf9a 100644
--- a/java/tests/ImageProcessing/src/com/android/rs/image/vibrance.rs
+++ b/java/tests/ImageProcessing/src/com/android/rs/image/vibrance.rs
@@ -35,7 +35,6 @@ uchar4 RS_KERNEL vibranceKernel(uchar4 in) {
float Rt = Rf * MS;
float Gt = Gf * MS;
float Bt = Bf * MS;
- int t = (r + g) >> 1;
float R = r;
float G = g;
@@ -46,9 +45,9 @@ uchar4 RS_KERNEL vibranceKernel(uchar4 in) {
float Bc = R * Rt + G * Gt + B * (Bt + S);
uchar4 o;
- o.r = rsClamp(Rc, 0, 255);
- o.g = rsClamp(Gc, 0, 255);
- o.b = rsClamp(Bc, 0, 255);
+ o.r = clamp((int) Rc, 0, 255);
+ o.g = clamp((int) Gc, 0, 255);
+ o.b = clamp((int) Bc, 0, 255);
o.a = 0xff;
return o;
}
diff --git a/java/tests/ImageProcessing2/src/com/android/rs/image/vibrance.rs b/java/tests/ImageProcessing2/src/com/android/rs/image/vibrance.rs
index 865c77ef..7a492c08 100644
--- a/java/tests/ImageProcessing2/src/com/android/rs/image/vibrance.rs
+++ b/java/tests/ImageProcessing2/src/com/android/rs/image/vibrance.rs
@@ -35,7 +35,6 @@ uchar4 RS_KERNEL vibranceKernel(uchar4 in) {
float Rt = Rf * MS;
float Gt = Gf * MS;
float Bt = Bf * MS;
- int t = (r + g) >> 1;
float R = r;
float G = g;
diff --git a/java/tests/ImageProcessing_jb/src/com/android/rs/image/bwfilter.rs b/java/tests/ImageProcessing_jb/src/com/android/rs/image/bwfilter.rs
index e2116209..23f64f59 100644
--- a/java/tests/ImageProcessing_jb/src/com/android/rs/image/bwfilter.rs
+++ b/java/tests/ImageProcessing_jb/src/com/android/rs/image/bwfilter.rs
@@ -48,5 +48,5 @@ void bwFilterKernel(const uchar4 *in, uchar4 *out) {
localMax = fmax(g,b);
localMax = fmax(r,localMax);
avg = (localMin+localMax) * 0.5f;
- out->r = out->g = out->b = rsClamp(avg, 0, 255);
+ out->r = out->g = out->b = clamp((int) avg, 0, 255);
}
diff --git a/java/tests/ImageProcessing_jb/src/com/android/rs/image/threshold.rs b/java/tests/ImageProcessing_jb/src/com/android/rs/image/threshold.rs
index 40d4fa2d..1309df59 100644
--- a/java/tests/ImageProcessing_jb/src/com/android/rs/image/threshold.rs
+++ b/java/tests/ImageProcessing_jb/src/com/android/rs/image/threshold.rs
@@ -85,7 +85,7 @@ uchar4 RS_KERNEL vert(uint32_t x, uint32_t y) {
}
} else {
for (int r = -radius; r <= radius; r ++) {
- int validH = rsClamp((int)y + r, (int)0, (int)(height - 1));
+ int validH = clamp((int)y + r, (int)0, (int)(height - 1));
float4 i = rsGetElementAt_float4(ScratchPixel2, x, validH);
blurredPixel += i.xyz * gaussian[gi++];
}
@@ -107,7 +107,7 @@ float4 RS_KERNEL horz(uint32_t x, uint32_t y) {
} else {
for (int r = -radius; r <= radius; r ++) {
// Stepping left and right away from the pixel
- int validX = rsClamp((int)x + r, (int)0, (int)(width - 1));
+ int validX = clamp((int)x + r, (int)0, (int)(width - 1));
float4 i = rsGetElementAt_float4(ScratchPixel1, validX, y);
blurredPixel += i * gaussian[gi++];
}
@@ -115,4 +115,3 @@ float4 RS_KERNEL horz(uint32_t x, uint32_t y) {
return blurredPixel;
}
-
diff --git a/java/tests/ImageProcessing_jb/src/com/android/rs/image/vibrance.rs b/java/tests/ImageProcessing_jb/src/com/android/rs/image/vibrance.rs
index 865c77ef..acd9cf9a 100644
--- a/java/tests/ImageProcessing_jb/src/com/android/rs/image/vibrance.rs
+++ b/java/tests/ImageProcessing_jb/src/com/android/rs/image/vibrance.rs
@@ -35,7 +35,6 @@ uchar4 RS_KERNEL vibranceKernel(uchar4 in) {
float Rt = Rf * MS;
float Gt = Gf * MS;
float Bt = Bf * MS;
- int t = (r + g) >> 1;
float R = r;
float G = g;
@@ -46,9 +45,9 @@ uchar4 RS_KERNEL vibranceKernel(uchar4 in) {
float Bc = R * Rt + G * Gt + B * (Bt + S);
uchar4 o;
- o.r = rsClamp(Rc, 0, 255);
- o.g = rsClamp(Gc, 0, 255);
- o.b = rsClamp(Bc, 0, 255);
+ o.r = clamp((int) Rc, 0, 255);
+ o.g = clamp((int) Gc, 0, 255);
+ o.b = clamp((int) Bc, 0, 255);
o.a = 0xff;
return o;
}
diff --git a/java/tests/RSTest_CompatLib/src/com/android/rs/test/element.rs b/java/tests/RSTest_CompatLib/src/com/android/rs/test/element.rs
index 1f247753..c7a7a87f 100644
--- a/java/tests/RSTest_CompatLib/src/com/android/rs/test/element.rs
+++ b/java/tests/RSTest_CompatLib/src/com/android/rs/test/element.rs
@@ -57,14 +57,6 @@ static uint32_t subElemArraySizes[] = {
1,
};
-static void resetStruct() {
- uint8_t *bytePtr = (uint8_t*)complexStruct;
- uint32_t sizeOfStruct = sizeof(*complexStruct);
- for(uint32_t i = 0; i < sizeOfStruct; i ++) {
- bytePtr[i] = 0;
- }
-}
-
static bool equals(const char *name0, const char * name1, uint32_t len) {
for (uint32_t i = 0; i < len; i ++) {
if (name0[i] != name1[i]) {
@@ -153,4 +145,3 @@ void element_test() {
rsSendToClientBlocking(RS_MSG_TEST_PASSED);
}
}
-
diff --git a/java/tests/RSTest_CompatLib/src/com/android/rs/test/fp_mad.rs b/java/tests/RSTest_CompatLib/src/com/android/rs/test/fp_mad.rs
index b6f2b2a6..3e8889ed 100644
--- a/java/tests/RSTest_CompatLib/src/com/android/rs/test/fp_mad.rs
+++ b/java/tests/RSTest_CompatLib/src/com/android/rs/test/fp_mad.rs
@@ -8,7 +8,6 @@ static float4 data_f4[1025];
static void test_mad4(uint32_t index) {
start();
- float total = 0;
// Do ~1 billion ops
for (int ct=0; ct < 1000 * (1000 / 80); ct++) {
for (int i=0; i < (1000); i++) {
@@ -32,7 +31,6 @@ static void test_mad4(uint32_t index) {
static void test_mad(uint32_t index) {
start();
- float total = 0;
// Do ~1 billion ops
for (int ct=0; ct < 1000 * (1000 / 20); ct++) {
for (int i=0; i < (1000); i++) {
@@ -56,7 +54,6 @@ static void test_mad(uint32_t index) {
static void test_norm(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10; ct++) {
for (int i=0; i < (1000); i++) {
@@ -71,7 +68,6 @@ static void test_norm(uint32_t index) {
static void test_sincos4(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10 / 4; ct++) {
for (int i=0; i < (1000); i++) {
@@ -86,7 +82,6 @@ static void test_sincos4(uint32_t index) {
static void test_sincos(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10; ct++) {
for (int i=0; i < (1000); i++) {
@@ -127,7 +122,6 @@ static void test_clamp(uint32_t index) {
static void test_clamp4(uint32_t index) {
start();
- float total = 0;
// Do ~100 M ops
for (int ct=0; ct < 1000 * 100 /4; ct++) {
for (int i=0; i < (1000); i++) {
diff --git a/java/tests/RSTest_CompatLib/src/com/android/rs/test/math_agree.rs b/java/tests/RSTest_CompatLib/src/com/android/rs/test/math_agree.rs
index 5bfbb2bf..80f73bef 100644
--- a/java/tests/RSTest_CompatLib/src/com/android/rs/test/math_agree.rs
+++ b/java/tests/RSTest_CompatLib/src/com/android/rs/test/math_agree.rs
@@ -345,16 +345,10 @@ TEST_US_US_ALL(func) \
TEST_SI_SI_ALL(func) \
TEST_UI_UI_ALL(func)
-// TODO: add long types to ALL macro
-#if 0
-TEST_SL_SL_ALL(func) \
-TEST_UL_UL_ALL(func)
-#endif
-
#define DECLARE_TEMP_SET(type, abbrev) \
-volatile type temp_##abbrev##1; \
-volatile type##2 temp_##abbrev##2; \
-volatile type##3 temp_##abbrev##3; \
+volatile type temp_##abbrev##1; \
+volatile type##2 temp_##abbrev##2; \
+volatile type##3 temp_##abbrev##3; \
volatile type##4 temp_##abbrev##4;
#define DECLARE_ALL_TEMP_SETS() \
@@ -364,9 +358,7 @@ DECLARE_TEMP_SET(uchar, uc); \
DECLARE_TEMP_SET(short, ss); \
DECLARE_TEMP_SET(ushort, us); \
DECLARE_TEMP_SET(int, si); \
-DECLARE_TEMP_SET(uint, ui); \
-DECLARE_TEMP_SET(long, sl); \
-DECLARE_TEMP_SET(ulong, ul);
+DECLARE_TEMP_SET(uint, ui);
static bool test_math_agree() {
bool failed = false;
@@ -406,4 +398,3 @@ void math_agree_test() {
rsSendToClientBlocking(RS_MSG_TEST_PASSED);
}
}
-
diff --git a/java/tests/RSTest_CompatLib/src/com/android/rs/test/rstypes.rs b/java/tests/RSTest_CompatLib/src/com/android/rs/test/rstypes.rs
index bec124dd..afada817 100644
--- a/java/tests/RSTest_CompatLib/src/com/android/rs/test/rstypes.rs
+++ b/java/tests/RSTest_CompatLib/src/com/android/rs/test/rstypes.rs
@@ -22,6 +22,9 @@ static bool basic_test(uint32_t index) {
rs_matrix4x4 matrix4x4TestLocal;
rs_matrix3x3 matrix3x3TestLocal;
rs_matrix2x2 matrix2x2TestLocal;
+ (void) matrix4x4TestLocal;
+ (void) matrix3x3TestLocal;
+ (void) matrix2x2TestLocal;
// This test focuses primarily on compilation-time, not run-time.
rs_element elementTestLocal;
@@ -29,8 +32,14 @@ static bool basic_test(uint32_t index) {
rs_allocation allocationTestLocal;
rs_sampler samplerTestLocal;
rs_script scriptTestLocal;
+ (void) elementTestLocal;
+ (void) typeTestLocal;
+ (void) allocationTestLocal;
+ (void) samplerTestLocal;
+ (void) scriptTestLocal;
struct my_struct structTest;
+ (void) structTest;
//allocationTestLocal = allocationTest;
diff --git a/java/tests/RSTest_CompatLib/src/com/android/rs/test/shared.rsh b/java/tests/RSTest_CompatLib/src/com/android/rs/test/shared.rsh
index b05a354b..04974afb 100644
--- a/java/tests/RSTest_CompatLib/src/com/android/rs/test/shared.rsh
+++ b/java/tests/RSTest_CompatLib/src/com/android/rs/test/shared.rsh
@@ -12,11 +12,11 @@ typedef struct TestResult_s {
static int64_t g_time;
-static void start(void) {
+static inline void start(void) {
g_time = rsUptimeMillis();
}
-static float end(uint32_t idx) {
+static inline float end(uint32_t idx) {
int64_t t = rsUptimeMillis() - g_time;
//g_results[idx].time = t;
//rsDebug("test time", (int)t);
@@ -35,42 +35,42 @@ do { \
static const int iposinf = 0x7f800000;
static const int ineginf = 0xff800000;
-static const float posinf() {
+static inline const float posinf() {
float f = *((float*)&iposinf);
return f;
}
-static const float neginf() {
+static inline const float neginf() {
float f = *((float*)&ineginf);
return f;
}
-static bool isposinf(float f) {
+static inline bool isposinf(float f) {
int i = *((int*)(void*)&f);
return (i == iposinf);
}
-static bool isneginf(float f) {
+static inline bool isneginf(float f) {
int i = *((int*)(void*)&f);
return (i == ineginf);
}
-static bool isnan(float f) {
+static inline bool isnan(float f) {
int i = *((int*)(void*)&f);
return (((i & 0x7f800000) == 0x7f800000) && (i & 0x007fffff));
}
-static bool isposzero(float f) {
+static inline bool isposzero(float f) {
int i = *((int*)(void*)&f);
return (i == 0x00000000);
}
-static bool isnegzero(float f) {
+static inline bool isnegzero(float f) {
int i = *((int*)(void*)&f);
return (i == 0x80000000);
}
-static bool iszero(float f) {
+static inline bool iszero(float f) {
return isposzero(f) || isnegzero(f);
}
@@ -84,13 +84,13 @@ static bool iszero(float f) {
/* Calculate the difference in ULPs between the two values. (Return zero on
perfect equality.) */
-static int float_dist(float f1, float f2) {
+static inline int float_dist(float f1, float f2) {
return *((int *)(&f1)) - *((int *)(&f2));
}
/* Check if two floats are essentially equal. Will fail with some values
due to design. (Validate using FLT_EPSILON or similar if necessary.) */
-static bool float_almost_equal(float f1, float f2) {
+static inline bool float_almost_equal(float f1, float f2) {
int *i1 = (int*)(&f1);
int *i2 = (int*)(&f2);
@@ -111,4 +111,3 @@ static bool float_almost_equal(float f1, float f2) {
/* These constants must match those in UnitTest.java */
static const int RS_MSG_TEST_PASSED = 100;
static const int RS_MSG_TEST_FAILED = 101;
-
diff --git a/java/tests/RsTest/src/com/android/rs/test/element.rs b/java/tests/RsTest/src/com/android/rs/test/element.rs
index 419ce074..95b29a31 100644
--- a/java/tests/RsTest/src/com/android/rs/test/element.rs
+++ b/java/tests/RsTest/src/com/android/rs/test/element.rs
@@ -57,14 +57,6 @@ static uint32_t subElemArraySizes[] = {
1,
};
-static void resetStruct() {
- uint8_t *bytePtr = (uint8_t*)complexStruct;
- uint32_t sizeOfStruct = sizeof(*complexStruct);
- for(uint32_t i = 0; i < sizeOfStruct; i ++) {
- bytePtr[i] = 0;
- }
-}
-
static bool equals(const char *name0, const char * name1, uint32_t len) {
for (uint32_t i = 0; i < len; i ++) {
if (name0[i] != name1[i]) {
diff --git a/java/tests/RsTest/src/com/android/rs/test/fp_mad.rs b/java/tests/RsTest/src/com/android/rs/test/fp_mad.rs
index b6f2b2a6..62ef3ecf 100644
--- a/java/tests/RsTest/src/com/android/rs/test/fp_mad.rs
+++ b/java/tests/RsTest/src/com/android/rs/test/fp_mad.rs
@@ -8,7 +8,6 @@ static float4 data_f4[1025];
static void test_mad4(uint32_t index) {
start();
- float total = 0;
// Do ~1 billion ops
for (int ct=0; ct < 1000 * (1000 / 80); ct++) {
for (int i=0; i < (1000); i++) {
@@ -32,7 +31,6 @@ static void test_mad4(uint32_t index) {
static void test_mad(uint32_t index) {
start();
- float total = 0;
// Do ~1 billion ops
for (int ct=0; ct < 1000 * (1000 / 20); ct++) {
for (int i=0; i < (1000); i++) {
@@ -56,7 +54,6 @@ static void test_mad(uint32_t index) {
static void test_norm(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10; ct++) {
for (int i=0; i < (1000); i++) {
@@ -71,7 +68,6 @@ static void test_norm(uint32_t index) {
static void test_sincos4(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10 / 4; ct++) {
for (int i=0; i < (1000); i++) {
@@ -86,7 +82,6 @@ static void test_sincos4(uint32_t index) {
static void test_sincos(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10; ct++) {
for (int i=0; i < (1000); i++) {
@@ -127,7 +122,6 @@ static void test_clamp(uint32_t index) {
static void test_clamp4(uint32_t index) {
start();
- float total = 0;
// Do ~100 M ops
for (int ct=0; ct < 1000 * 100 /4; ct++) {
for (int i=0; i < (1000); i++) {
@@ -170,5 +164,3 @@ void fp_mad_test(uint32_t index, int test_num) {
rsDebug("fp_mad_test PASSED", 0);
rsSendToClientBlocking(RS_MSG_TEST_PASSED);
}
-
-
diff --git a/java/tests/RsTest/src/com/android/rs/test/math.rs b/java/tests/RsTest/src/com/android/rs/test/math.rs
index 2c0521bf..f3eac553 100644
--- a/java/tests/RsTest/src/com/android/rs/test/math.rs
+++ b/java/tests/RsTest/src/com/android/rs/test/math.rs
@@ -355,7 +355,7 @@ static bool test_int_math(uint32_t index) {
TEST_IN_FUNC_IN(clz);
TEST_IN_FUNC_IN_IN(min);
TEST_IN_FUNC_IN_IN(max);
- TEST_I_FUNC_I_I_I(rsClamp);
+ TEST_I_FUNC_I_I_I(clamp);
float time = end(index);
@@ -442,4 +442,3 @@ void math_test(uint32_t index, int test_num) {
rsSendToClientBlocking(RS_MSG_TEST_PASSED);
}
}
-
diff --git a/java/tests/RsTest/src/com/android/rs/test/math_agree.rs b/java/tests/RsTest/src/com/android/rs/test/math_agree.rs
index 5bfbb2bf..489cc277 100644
--- a/java/tests/RsTest/src/com/android/rs/test/math_agree.rs
+++ b/java/tests/RsTest/src/com/android/rs/test/math_agree.rs
@@ -343,13 +343,9 @@ TEST_UC_UC_ALL(func) \
TEST_SS_SS_ALL(func) \
TEST_US_US_ALL(func) \
TEST_SI_SI_ALL(func) \
-TEST_UI_UI_ALL(func)
-
-// TODO: add long types to ALL macro
-#if 0
+TEST_UI_UI_ALL(func) \
TEST_SL_SL_ALL(func) \
TEST_UL_UL_ALL(func)
-#endif
#define DECLARE_TEMP_SET(type, abbrev) \
volatile type temp_##abbrev##1; \
@@ -406,4 +402,3 @@ void math_agree_test() {
rsSendToClientBlocking(RS_MSG_TEST_PASSED);
}
}
-
diff --git a/java/tests/RsTest/src/com/android/rs/test/rstypes.rs b/java/tests/RsTest/src/com/android/rs/test/rstypes.rs
index bec124dd..088fe508 100644
--- a/java/tests/RsTest/src/com/android/rs/test/rstypes.rs
+++ b/java/tests/RsTest/src/com/android/rs/test/rstypes.rs
@@ -22,6 +22,9 @@ static bool basic_test(uint32_t index) {
rs_matrix4x4 matrix4x4TestLocal;
rs_matrix3x3 matrix3x3TestLocal;
rs_matrix2x2 matrix2x2TestLocal;
+ (void) matrix4x4TestLocal;
+ (void) matrix3x3TestLocal;
+ (void) matrix2x2TestLocal;
// This test focuses primarily on compilation-time, not run-time.
rs_element elementTestLocal;
@@ -29,12 +32,14 @@ static bool basic_test(uint32_t index) {
rs_allocation allocationTestLocal;
rs_sampler samplerTestLocal;
rs_script scriptTestLocal;
+ (void) elementTestLocal;
+ (void) typeTestLocal;
+ (void) allocationTestLocal;
+ (void) samplerTestLocal;
+ (void) scriptTestLocal;
struct my_struct structTest;
-
- //allocationTestLocal = allocationTest;
-
- //allocationTest = allocationTestLocal;
+ (void) structTest;
/*for (int i = 0; i < 4; i++) {
fontTestLocalArray[i] = fontTestLocal;
@@ -58,4 +63,3 @@ void test_rstypes(uint32_t index, int test_num) {
rsDebug("rstypes_test PASSED", 0);
}
}
-
diff --git a/java/tests/RsTest/src/com/android/rs/test/shared.rsh b/java/tests/RsTest/src/com/android/rs/test/shared.rsh
index 0281383b..de7135cc 100644
--- a/java/tests/RsTest/src/com/android/rs/test/shared.rsh
+++ b/java/tests/RsTest/src/com/android/rs/test/shared.rsh
@@ -12,11 +12,11 @@ typedef struct TestResult_s {
static int64_t g_time;
-static void start(void) {
+static inline void start(void) {
g_time = rsUptimeMillis();
}
-static float end(uint32_t idx) {
+static inline float end(uint32_t idx) {
int64_t t = rsUptimeMillis() - g_time;
//g_results[idx].time = t;
//rsDebug("test time", (int)t);
@@ -38,42 +38,42 @@ do { \
static const int iposinf = 0x7f800000;
static const int ineginf = 0xff800000;
-static const float posinf() {
+static inline const float posinf() {
float f = *((float*)&iposinf);
return f;
}
-static const float neginf() {
+static inline const float neginf() {
float f = *((float*)&ineginf);
return f;
}
-static bool isposinf(float f) {
+static inline bool isposinf(float f) {
int i = *((int*)(void*)&f);
return (i == iposinf);
}
-static bool isneginf(float f) {
+static inline bool isneginf(float f) {
int i = *((int*)(void*)&f);
return (i == ineginf);
}
-static bool isnan(float f) {
+static inline bool isnan(float f) {
int i = *((int*)(void*)&f);
return (((i & 0x7f800000) == 0x7f800000) && (i & 0x007fffff));
}
-static bool isposzero(float f) {
+static inline bool isposzero(float f) {
int i = *((int*)(void*)&f);
return (i == 0x00000000);
}
-static bool isnegzero(float f) {
+static inline bool isnegzero(float f) {
int i = *((int*)(void*)&f);
return (i == 0x80000000);
}
-static bool iszero(float f) {
+static inline bool iszero(float f) {
return isposzero(f) || isnegzero(f);
}
@@ -87,13 +87,13 @@ static bool iszero(float f) {
/* Calculate the difference in ULPs between the two values. (Return zero on
perfect equality.) */
-static int float_dist(float f1, float f2) {
+static inline int float_dist(float f1, float f2) {
return *((int *)(&f1)) - *((int *)(&f2));
}
/* Check if two floats are essentially equal. Will fail with some values
due to design. (Validate using FLT_EPSILON or similar if necessary.) */
-static bool float_almost_equal(float f1, float f2) {
+static inline bool float_almost_equal(float f1, float f2) {
int *i1 = (int*)(&f1);
int *i2 = (int*)(&f2);
@@ -114,4 +114,3 @@ static bool float_almost_equal(float f1, float f2) {
/* These constants must match those in UnitTest.java */
static const int RS_MSG_TEST_PASSED = 100;
static const int RS_MSG_TEST_FAILED = 101;
-
diff --git a/java/tests/RsTest_11/src/com/android/rs/test/fp_mad.rs b/java/tests/RsTest_11/src/com/android/rs/test/fp_mad.rs
index b6f2b2a6..62ef3ecf 100644
--- a/java/tests/RsTest_11/src/com/android/rs/test/fp_mad.rs
+++ b/java/tests/RsTest_11/src/com/android/rs/test/fp_mad.rs
@@ -8,7 +8,6 @@ static float4 data_f4[1025];
static void test_mad4(uint32_t index) {
start();
- float total = 0;
// Do ~1 billion ops
for (int ct=0; ct < 1000 * (1000 / 80); ct++) {
for (int i=0; i < (1000); i++) {
@@ -32,7 +31,6 @@ static void test_mad4(uint32_t index) {
static void test_mad(uint32_t index) {
start();
- float total = 0;
// Do ~1 billion ops
for (int ct=0; ct < 1000 * (1000 / 20); ct++) {
for (int i=0; i < (1000); i++) {
@@ -56,7 +54,6 @@ static void test_mad(uint32_t index) {
static void test_norm(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10; ct++) {
for (int i=0; i < (1000); i++) {
@@ -71,7 +68,6 @@ static void test_norm(uint32_t index) {
static void test_sincos4(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10 / 4; ct++) {
for (int i=0; i < (1000); i++) {
@@ -86,7 +82,6 @@ static void test_sincos4(uint32_t index) {
static void test_sincos(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10; ct++) {
for (int i=0; i < (1000); i++) {
@@ -127,7 +122,6 @@ static void test_clamp(uint32_t index) {
static void test_clamp4(uint32_t index) {
start();
- float total = 0;
// Do ~100 M ops
for (int ct=0; ct < 1000 * 100 /4; ct++) {
for (int i=0; i < (1000); i++) {
@@ -170,5 +164,3 @@ void fp_mad_test(uint32_t index, int test_num) {
rsDebug("fp_mad_test PASSED", 0);
rsSendToClientBlocking(RS_MSG_TEST_PASSED);
}
-
-
diff --git a/java/tests/RsTest_11/src/com/android/rs/test/rstypes.rs b/java/tests/RsTest_11/src/com/android/rs/test/rstypes.rs
index f3bf2448..afda39f8 100644
--- a/java/tests/RsTest_11/src/com/android/rs/test/rstypes.rs
+++ b/java/tests/RsTest_11/src/com/android/rs/test/rstypes.rs
@@ -28,6 +28,9 @@ static bool basic_test(uint32_t index) {
rs_matrix4x4 matrix4x4TestLocal;
rs_matrix3x3 matrix3x3TestLocal;
rs_matrix2x2 matrix2x2TestLocal;
+ (void) matrix4x4TestLocal;
+ (void) matrix3x3TestLocal;
+ (void) matrix2x2TestLocal;
// This test focuses primarily on compilation-time, not run-time.
rs_element elementTestLocal;
@@ -41,12 +44,26 @@ static bool basic_test(uint32_t index) {
rs_program_raster program_rasterTestLocal;
rs_program_store program_storeTestLocal;
rs_font fontTestLocal;
+ (void) elementTestLocal;
+ (void) typeTestLocal;
+ (void) allocationTestLocal;
+ (void) samplerTestLocal;
+ (void) scriptTestLocal;
+ (void) meshTestLocal;
+ (void) program_fragmentTestLocal;
+ (void) program_vertexTestLocal;
+ (void) program_rasterTestLocal;
+ (void) program_storeTestLocal;
+ (void) fontTestLocal;
rs_font fontTestLocalArray[4];
+ (void) fontTestLocalArray;
rs_font fontTestLocalPreInit = fontTest;
+ (void) fontTestLocalPreInit;
struct my_struct structTest;
+ (void) structTest;
rsSetObject(&fontTestLocal, fontTest);
//allocationTestLocal = allocationTest;
@@ -76,4 +93,3 @@ void test_rstypes(uint32_t index, int test_num) {
rsDebug("rstypes_test PASSED", 0);
}
}
-
diff --git a/java/tests/RsTest_11/src/com/android/rs/test/shared.rsh b/java/tests/RsTest_11/src/com/android/rs/test/shared.rsh
index 6d34481c..b548e120 100644
--- a/java/tests/RsTest_11/src/com/android/rs/test/shared.rsh
+++ b/java/tests/RsTest_11/src/com/android/rs/test/shared.rsh
@@ -12,11 +12,11 @@ typedef struct TestResult_s {
static int64_t g_time;
-static void start(void) {
+static inline void start(void) {
g_time = rsUptimeMillis();
}
-static float end(uint32_t idx) {
+static inline float end(uint32_t idx) {
int64_t t = rsUptimeMillis() - g_time;
//g_results[idx].time = t;
//rsDebug("test time", (int)t);
@@ -35,4 +35,3 @@ do { \
/* These constants must match those in UnitTest.java */
static const int RS_MSG_TEST_PASSED = 100;
static const int RS_MSG_TEST_FAILED = 101;
-
diff --git a/java/tests/RsTest_14/src/com/android/rs/test/fp_mad.rs b/java/tests/RsTest_14/src/com/android/rs/test/fp_mad.rs
index b6f2b2a6..62ef3ecf 100644
--- a/java/tests/RsTest_14/src/com/android/rs/test/fp_mad.rs
+++ b/java/tests/RsTest_14/src/com/android/rs/test/fp_mad.rs
@@ -8,7 +8,6 @@ static float4 data_f4[1025];
static void test_mad4(uint32_t index) {
start();
- float total = 0;
// Do ~1 billion ops
for (int ct=0; ct < 1000 * (1000 / 80); ct++) {
for (int i=0; i < (1000); i++) {
@@ -32,7 +31,6 @@ static void test_mad4(uint32_t index) {
static void test_mad(uint32_t index) {
start();
- float total = 0;
// Do ~1 billion ops
for (int ct=0; ct < 1000 * (1000 / 20); ct++) {
for (int i=0; i < (1000); i++) {
@@ -56,7 +54,6 @@ static void test_mad(uint32_t index) {
static void test_norm(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10; ct++) {
for (int i=0; i < (1000); i++) {
@@ -71,7 +68,6 @@ static void test_norm(uint32_t index) {
static void test_sincos4(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10 / 4; ct++) {
for (int i=0; i < (1000); i++) {
@@ -86,7 +82,6 @@ static void test_sincos4(uint32_t index) {
static void test_sincos(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10; ct++) {
for (int i=0; i < (1000); i++) {
@@ -127,7 +122,6 @@ static void test_clamp(uint32_t index) {
static void test_clamp4(uint32_t index) {
start();
- float total = 0;
// Do ~100 M ops
for (int ct=0; ct < 1000 * 100 /4; ct++) {
for (int i=0; i < (1000); i++) {
@@ -170,5 +164,3 @@ void fp_mad_test(uint32_t index, int test_num) {
rsDebug("fp_mad_test PASSED", 0);
rsSendToClientBlocking(RS_MSG_TEST_PASSED);
}
-
-
diff --git a/java/tests/RsTest_14/src/com/android/rs/test/rstypes.rs b/java/tests/RsTest_14/src/com/android/rs/test/rstypes.rs
index 22d9c138..8577604d 100644
--- a/java/tests/RsTest_14/src/com/android/rs/test/rstypes.rs
+++ b/java/tests/RsTest_14/src/com/android/rs/test/rstypes.rs
@@ -28,6 +28,9 @@ static bool basic_test(uint32_t index) {
rs_matrix4x4 matrix4x4TestLocal;
rs_matrix3x3 matrix3x3TestLocal;
rs_matrix2x2 matrix2x2TestLocal;
+ (void) matrix4x4TestLocal;
+ (void) matrix3x3TestLocal;
+ (void) matrix2x2TestLocal;
// This test focuses primarily on compilation-time, not run-time.
rs_element elementTestLocal;
@@ -41,18 +44,30 @@ static bool basic_test(uint32_t index) {
rs_program_raster program_rasterTestLocal;
rs_program_store program_storeTestLocal;
rs_font fontTestLocal;
+ (void) elementTestLocal;
+ (void) typeTestLocal;
+ (void) allocationTestLocal;
+ (void) samplerTestLocal;
+ (void) scriptTestLocal;
+ (void) meshTestLocal;
+ (void) program_fragmentTestLocal;
+ (void) program_vertexTestLocal;
+ (void) program_rasterTestLocal;
+ (void) program_storeTestLocal;
+ (void) fontTestLocal;
rs_font fontTestLocalArray[4];
+ (void) fontTestLocalArray;
rs_font fontTestLocalPreInit = fontTest;
+ (void) fontTestLocalPreInit;
struct my_struct structTest;
+ (void) structTest;
fontTestLocal = fontTest;
- //allocationTestLocal = allocationTest;
fontTest = fontTestLocal;
- //allocationTest = allocationTestLocal;
/*for (int i = 0; i < 4; i++) {
fontTestLocalArray[i] = fontTestLocal;
@@ -76,4 +91,3 @@ void test_rstypes(uint32_t index, int test_num) {
rsDebug("rstypes_test PASSED", 0);
}
}
-
diff --git a/java/tests/RsTest_14/src/com/android/rs/test/shared.rsh b/java/tests/RsTest_14/src/com/android/rs/test/shared.rsh
index 4a7151ff..40f1062c 100644
--- a/java/tests/RsTest_14/src/com/android/rs/test/shared.rsh
+++ b/java/tests/RsTest_14/src/com/android/rs/test/shared.rsh
@@ -12,11 +12,11 @@ typedef struct TestResult_s {
static int64_t g_time;
-static void start(void) {
+static inline void start(void) {
g_time = rsUptimeMillis();
}
-static float end(uint32_t idx) {
+static inline float end(uint32_t idx) {
int64_t t = rsUptimeMillis() - g_time;
//g_results[idx].time = t;
//rsDebug("test time", (int)t);
@@ -35,4 +35,3 @@ do { \
/* These constants must match those in UnitTest.java */
static const int RS_MSG_TEST_PASSED = 100;
static const int RS_MSG_TEST_FAILED = 101;
-
diff --git a/java/tests/RsTest_16/src/com/android/rs/test/fp_mad.rs b/java/tests/RsTest_16/src/com/android/rs/test/fp_mad.rs
index b6f2b2a6..62ef3ecf 100644
--- a/java/tests/RsTest_16/src/com/android/rs/test/fp_mad.rs
+++ b/java/tests/RsTest_16/src/com/android/rs/test/fp_mad.rs
@@ -8,7 +8,6 @@ static float4 data_f4[1025];
static void test_mad4(uint32_t index) {
start();
- float total = 0;
// Do ~1 billion ops
for (int ct=0; ct < 1000 * (1000 / 80); ct++) {
for (int i=0; i < (1000); i++) {
@@ -32,7 +31,6 @@ static void test_mad4(uint32_t index) {
static void test_mad(uint32_t index) {
start();
- float total = 0;
// Do ~1 billion ops
for (int ct=0; ct < 1000 * (1000 / 20); ct++) {
for (int i=0; i < (1000); i++) {
@@ -56,7 +54,6 @@ static void test_mad(uint32_t index) {
static void test_norm(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10; ct++) {
for (int i=0; i < (1000); i++) {
@@ -71,7 +68,6 @@ static void test_norm(uint32_t index) {
static void test_sincos4(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10 / 4; ct++) {
for (int i=0; i < (1000); i++) {
@@ -86,7 +82,6 @@ static void test_sincos4(uint32_t index) {
static void test_sincos(uint32_t index) {
start();
- float total = 0;
// Do ~10 M ops
for (int ct=0; ct < 1000 * 10; ct++) {
for (int i=0; i < (1000); i++) {
@@ -127,7 +122,6 @@ static void test_clamp(uint32_t index) {
static void test_clamp4(uint32_t index) {
start();
- float total = 0;
// Do ~100 M ops
for (int ct=0; ct < 1000 * 100 /4; ct++) {
for (int i=0; i < (1000); i++) {
@@ -170,5 +164,3 @@ void fp_mad_test(uint32_t index, int test_num) {
rsDebug("fp_mad_test PASSED", 0);
rsSendToClientBlocking(RS_MSG_TEST_PASSED);
}
-
-
diff --git a/java/tests/RsTest_16/src/com/android/rs/test/rstypes.rs b/java/tests/RsTest_16/src/com/android/rs/test/rstypes.rs
index 22d9c138..a517189f 100644
--- a/java/tests/RsTest_16/src/com/android/rs/test/rstypes.rs
+++ b/java/tests/RsTest_16/src/com/android/rs/test/rstypes.rs
@@ -28,6 +28,9 @@ static bool basic_test(uint32_t index) {
rs_matrix4x4 matrix4x4TestLocal;
rs_matrix3x3 matrix3x3TestLocal;
rs_matrix2x2 matrix2x2TestLocal;
+ (void) matrix4x4TestLocal;
+ (void) matrix3x3TestLocal;
+ (void) matrix2x2TestLocal;
// This test focuses primarily on compilation-time, not run-time.
rs_element elementTestLocal;
@@ -41,12 +44,26 @@ static bool basic_test(uint32_t index) {
rs_program_raster program_rasterTestLocal;
rs_program_store program_storeTestLocal;
rs_font fontTestLocal;
+ rsClearObject(&elementTestLocal);
+ rsClearObject(&typeTestLocal);
+ rsClearObject(&allocationTestLocal);
+ rsClearObject(&samplerTestLocal);
+ rsClearObject(&scriptTestLocal);
+ rsClearObject(&meshTestLocal);
+ rsClearObject(&program_fragmentTestLocal);
+ rsClearObject(&program_vertexTestLocal);
+ rsClearObject(&program_rasterTestLocal);
+ rsClearObject(&program_storeTestLocal);
+ rsClearObject(&fontTestLocal);
rs_font fontTestLocalArray[4];
+ (void) fontTestLocalArray;
rs_font fontTestLocalPreInit = fontTest;
+ (void) fontTestLocalPreInit;
struct my_struct structTest;
+ (void) structTest;
fontTestLocal = fontTest;
//allocationTestLocal = allocationTest;
@@ -76,4 +93,3 @@ void test_rstypes(uint32_t index, int test_num) {
rsDebug("rstypes_test PASSED", 0);
}
}
-
diff --git a/java/tests/RsTest_16/src/com/android/rs/test/shared.rsh b/java/tests/RsTest_16/src/com/android/rs/test/shared.rsh
index b5057d06..17222f30 100644
--- a/java/tests/RsTest_16/src/com/android/rs/test/shared.rsh
+++ b/java/tests/RsTest_16/src/com/android/rs/test/shared.rsh
@@ -12,11 +12,11 @@ typedef struct TestResult_s {
static int64_t g_time;
-static void start(void) {
+static inline void start(void) {
g_time = rsUptimeMillis();
}
-static float end(uint32_t idx) {
+static inline float end(uint32_t idx) {
int64_t t = rsUptimeMillis() - g_time;
//g_results[idx].time = t;
//rsDebug("test time", (int)t);
@@ -35,4 +35,3 @@ do { \
/* These constants must match those in UnitTest.java */
static const int RS_MSG_TEST_PASSED = 100;
static const int RS_MSG_TEST_FAILED = 101;
-
diff --git a/java/tests/ScriptGroupTest/src/com/android/rs/sgtest/vibrance_f.rs b/java/tests/ScriptGroupTest/src/com/android/rs/sgtest/vibrance_f.rs
index 663652cc..d13ef0d4 100644
--- a/java/tests/ScriptGroupTest/src/com/android/rs/sgtest/vibrance_f.rs
+++ b/java/tests/ScriptGroupTest/src/com/android/rs/sgtest/vibrance_f.rs
@@ -35,7 +35,6 @@ float4 RS_KERNEL vibranceKernel(float4 in) {
float Rt = Rf * MS;
float Gt = Gf * MS;
float Bt = Bf * MS;
- int t = (r + g) >> 1;
float R = r;
float G = g;
diff --git a/java/tests/VrDemo/src/com/example/android/rs/vr/engine/bugdroid.rs b/java/tests/VrDemo/src/com/example/android/rs/vr/engine/bugdroid.rs
index 4cdfc121..1f72f2e6 100644
--- a/java/tests/VrDemo/src/com/example/android/rs/vr/engine/bugdroid.rs
+++ b/java/tests/VrDemo/src/com/example/android/rs/vr/engine/bugdroid.rs
@@ -92,11 +92,13 @@ static float distanceDisk(float3 center, float radius, float3 normal,
return tmp1;
}
+/* Unused function:
static short disk(float3 center, float circleRadius, float3 normal, float rad,
short max, float3 img) {
return (short) (max
* sigmoid(distanceDisk(center, circleRadius, normal, img) - rad));
}
+*/
static short cogDisk(float3 center, float circleRadius, float3 normal,
float rad, short max, float3 img) {
diff --git a/java/tests/VrDemo/src/com/example/android/rs/vr/engine/mandelbulb.rs b/java/tests/VrDemo/src/com/example/android/rs/vr/engine/mandelbulb.rs
index 23c1bc64..52bf75ca 100644
--- a/java/tests/VrDemo/src/com/example/android/rs/vr/engine/mandelbulb.rs
+++ b/java/tests/VrDemo/src/com/example/android/rs/vr/engine/mandelbulb.rs
@@ -22,6 +22,7 @@ int size;
int z;
rs_allocation volume;
+/* Unused function:
static float3 nylander(float3 p, int n) {
float3 out;
float r = length(p);
@@ -33,6 +34,7 @@ static float3 nylander(float3 p, int n) {
out.z = cos(n * theta);
return out * rn;
}
+*/
/**
* 8 x faster than the above for n = 3
@@ -48,10 +50,6 @@ static float3 nylander3(float3 p) {
return out;
}
-static float vsize(float3 p) {
- return sqrt(p.x * p.x + p.y * p.y + p.z * p.z);
-}
-
short __attribute__((kernel)) mandelbulb(uint32_t x, uint32_t y) {
int size2 = size / 2;
if (z < size2) {
diff --git a/java/tests/VrDemo/src/com/example/android/rs/vr/engine/vr.rs b/java/tests/VrDemo/src/com/example/android/rs/vr/engine/vr.rs
index 2b51eeee..e3004cc4 100644
--- a/java/tests/VrDemo/src/com/example/android/rs/vr/engine/vr.rs
+++ b/java/tests/VrDemo/src/com/example/android/rs/vr/engine/vr.rs
@@ -104,7 +104,6 @@ uchar4 __attribute__ ((kernel)) draw_z_buffer(float2 in, uint32_t x, uint32_t y)
float zstart = zsuface;
float zend = in.y - 2.f;//0.5f;
float zlen = zend - zstart;
- float step_dist = length(dz);
if (zstart == FLOAT_MAX || zlen < 0) {
return out;
@@ -124,7 +123,7 @@ uchar4 __attribute__ ((kernel)) draw_z_buffer(float2 in, uint32_t x, uint32_t y)
int intensity = (((short) pix) & 0xFFFF);
// intensity = clamp(intensity,0,400);
uchar4 color = rsGetElementAt_uchar4(color_map, intensity * 2);
- int op = rsGetElementAt_uchar(opacity, intensity);
+ // int op = rsGetElementAt_uchar(opacity, intensity);
out.r = color.r;
out.g = color.g;
@@ -167,7 +166,7 @@ uchar4 __attribute__ ((kernel)) draw_z_buffer(float2 in, uint32_t x, uint32_t y)
float4 fcolor = convert_float4(color);;
float ambient = mat.x * (1/255.f);
- float specular = mat.y * (1/255.f);
+ // float specular = mat.y * (1/255.f);
float diffuse = mat.z * (1/255.f);
float lop = (ambient + diffuse * dot_prod) * light * opf;
light -= opf;