Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/orc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2022-11-08 18:35:53 +0300
committerTim-Philipp Müller <tim@centricular.com>2022-11-08 18:42:31 +0300
commite1999863a5c87cdc23d507433b2df3607d0652a2 (patch)
tree306604e2abac4c22d942bd9779e687fdb28fb400
parent8a9a634d0160c82f1e8f85ae955b3057260c1029 (diff)
testsuite: fix compiler warning about unused variable
Happens on gst-macos-12.3 with --werror with clang 13.1.6 "Apple clang version 13.1.6 (clang-1316.0.21.2)": ../testsuite/memcpy_speed.c:25:23: error: variable 'sum' set but not used
-rw-r--r--testsuite/memcpy_speed.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/testsuite/memcpy_speed.c b/testsuite/memcpy_speed.c
index 9f4f247..a3089da 100644
--- a/testsuite/memcpy_speed.c
+++ b/testsuite/memcpy_speed.c
@@ -19,7 +19,7 @@ int hot_src = TRUE;
int hot_dest = TRUE;
int flush_cache = FALSE;
-void
+int
touch (unsigned char *ptr, int n)
{
static unsigned int sum;
@@ -27,6 +27,9 @@ touch (unsigned char *ptr, int n)
for(i=0;i<n;i++){
sum += ptr[i];
}
+ // Return it so compiler doesn't complain about it being only
+ // ever being written to but never read.
+ return sum;
}
int