aboutsummaryrefslogtreecommitdiff
path: root/modules/benchmark
diff options
context:
space:
mode:
authorhwspeedy <ns@bigbear.dk>2024-05-24 10:20:25 +0200
committerhwspeedy <ns@bigbear.dk>2024-05-24 10:20:25 +0200
commita8ccc2aa89c78108566c67b9e853797ea451f9c8 (patch)
tree9499a58b04a6baf1ab4a0741f7a31d3ddbc0fbc8 /modules/benchmark
parent25c366a8074af72c0811a960b947302bed036669 (diff)
FIX GCC Warnings, added more checking to gcc flags
Diffstat (limited to 'modules/benchmark')
-rw-r--r--modules/benchmark/bench_results.c1
-rw-r--r--modules/benchmark/bench_util.c2
-rw-r--r--modules/benchmark/blowfish2.c4
-rw-r--r--modules/benchmark/fft.c5
-rw-r--r--modules/benchmark/fftbench.c2
-rw-r--r--modules/benchmark/guibench.c1
-rw-r--r--modules/benchmark/iperf3.c3
-rw-r--r--modules/benchmark/raytrace.c2
-rw-r--r--modules/benchmark/sha1.c6
-rw-r--r--modules/benchmark/sysbench.c12
-rw-r--r--modules/benchmark/zlib.c5
11 files changed, 17 insertions, 26 deletions
diff --git a/modules/benchmark/bench_results.c b/modules/benchmark/bench_results.c
index e99e8b6e..0b2f182f 100644
--- a/modules/benchmark/bench_results.c
+++ b/modules/benchmark/bench_results.c
@@ -418,7 +418,6 @@ bench_result *bench_result_benchmarkjson(const gchar *bench_name,
{
JsonObject *machine;
bench_result *b;
- gchar *p;
if (json_node_get_node_type(node) != JSON_NODE_OBJECT)
return NULL;
diff --git a/modules/benchmark/bench_util.c b/modules/benchmark/bench_util.c
index d9e5bc55..1942f625 100644
--- a/modules/benchmark/bench_util.c
+++ b/modules/benchmark/bench_util.c
@@ -54,5 +54,5 @@ char *md5_digest_str(const char *data, unsigned int len) {
MD5Init(&ctx);
MD5Update(&ctx, (guchar *)data, len);
MD5Final(digest, &ctx);
- return digest_to_str(digest, 16);
+ return digest_to_str((char *)digest, 16);
}
diff --git a/modules/benchmark/blowfish2.c b/modules/benchmark/blowfish2.c
index 7426bef9..b60dd52c 100644
--- a/modules/benchmark/blowfish2.c
+++ b/modules/benchmark/blowfish2.c
@@ -30,7 +30,7 @@
static gpointer bfish_exec(const void *in_data, gint thread_number)
{
- unsigned char key[] = BLOW_KEY;
+ char key[] = BLOW_KEY;
unsigned char *data = NULL;
unsigned long data_len = BENCH_DATA_SIZE, i = 0;
BLOWFISH_CTX ctx;
@@ -38,7 +38,7 @@ static gpointer bfish_exec(const void *in_data, gint thread_number)
data = malloc(BENCH_DATA_SIZE);
memcpy(data, in_data, BENCH_DATA_SIZE);
- Blowfish_Init(&ctx, key, strlen(key));
+ Blowfish_Init(&ctx, (guchar *)key, strlen(key));
for(i = 0; i < data_len; i += 8) {
Blowfish_Encrypt(&ctx, (unsigned long*)&data[i], (unsigned long*)&data[i+4]);
}
diff --git a/modules/benchmark/fft.c b/modules/benchmark/fft.c
index df643fe2..65ef5c30 100644
--- a/modules/benchmark/fft.c
+++ b/modules/benchmark/fft.c
@@ -27,9 +27,7 @@
static gpointer fft_for(void *in_data, gint thread_number)
{
- unsigned int i;
FFTBench **benches = (FFTBench **)in_data;
- FFTBench *fftbench = (FFTBench *)(benches[thread_number]);
fft_bench_run(benches[thread_number]);
@@ -42,8 +40,7 @@ benchmark_fft(void)
int cpu_procs, cpu_cores, cpu_threads, cpu_nodes;
bench_value r = EMPTY_BENCH_VALUE;
- int n_cores, i;
- gchar *temp;
+ int i;
FFTBench **benches=NULL;
shell_view_set_enabled(FALSE);
diff --git a/modules/benchmark/fftbench.c b/modules/benchmark/fftbench.c
index a531e276..bfd42b98 100644
--- a/modules/benchmark/fftbench.c
+++ b/modules/benchmark/fftbench.c
@@ -61,7 +61,7 @@ static double random_double()
static const int N = 100;
static const int NM1 = 99; // N - 1
-static const int NP1 = 101; // N + 1
+//static const int NP1 = 101; // N + 1
static void lup_decompose(FFTBench *fftbench)
{
diff --git a/modules/benchmark/guibench.c b/modules/benchmark/guibench.c
index 54b10493..dc43b8fe 100644
--- a/modules/benchmark/guibench.c
+++ b/modules/benchmark/guibench.c
@@ -129,7 +129,6 @@ gboolean on_draw (GtkWidget *widget, GdkEventExpose *event, gpointer data) {
double guibench(double *frameTime, int *frameCount)
{
GtkWindow * window;
- cairo_t *cr;
//Get DarkMode state from system
g_object_get(gtk_settings_get_default(), "gtk-application-prefer-dark-theme", &darkmode, NULL);
diff --git a/modules/benchmark/iperf3.c b/modules/benchmark/iperf3.c
index 43e40627..43b98df4 100644
--- a/modules/benchmark/iperf3.c
+++ b/modules/benchmark/iperf3.c
@@ -32,7 +32,7 @@ static int iperf3_version() {
if (spawned) {
ret = 0;
p = out;
- while(next_nl = strchr(p, '\n')) {
+ while((next_nl = strchr(p, '\n'))) {
*next_nl = 0;
/* version */
mc = sscanf(p, "iperf %d.%d", &v1, &v2);
@@ -75,7 +75,6 @@ static double _get_double(JsonParser *j, const char* path) {
static bench_value iperf3_client() {
bench_value ret = EMPTY_BENCH_VALUE;
- int v1 = 0, v2 = 0, v3 = 0, mc = 0;
gboolean spawned;
gchar *out, *err;
GError *e = NULL;
diff --git a/modules/benchmark/raytrace.c b/modules/benchmark/raytrace.c
index bddc3232..b991722e 100644
--- a/modules/benchmark/raytrace.c
+++ b/modules/benchmark/raytrace.c
@@ -26,8 +26,6 @@ void fbench(); /* fbench.c */
static gpointer parallel_raytrace(void *in_data, gint thread_number)
{
- unsigned int i;
-
fbench();
return NULL;
diff --git a/modules/benchmark/sha1.c b/modules/benchmark/sha1.c
index 8cbf0f6a..1ea0b1c1 100644
--- a/modules/benchmark/sha1.c
+++ b/modules/benchmark/sha1.c
@@ -234,9 +234,9 @@ void SHA1Final(guchar digest[20], SHA1_CTX * context)
/* Wipe variables */
i = j = 0;
memset(context->buffer, 0, 64);
- memset(context->state, 0, 20);
- memset(context->count, 0, 8);
- memset(&finalcount, 0, 8);
+ memset(context->state, 0, 20*sizeof(guint32));
+ memset(context->count, 0, 2*sizeof(guint32));
+ memset(&finalcount, 0, sizeof(finalcount));
#ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */
SHA1Transform(context->state, context->buffer);
#endif
diff --git a/modules/benchmark/sysbench.c b/modules/benchmark/sysbench.c
index 5c45831d..a8e9a6ca 100644
--- a/modules/benchmark/sysbench.c
+++ b/modules/benchmark/sysbench.c
@@ -48,7 +48,7 @@ int sysbench_version() {
if (spawned) {
ret = 0;
p = out;
- while(next_nl = strchr(p, '\n')) {
+ while((next_nl = strchr(p, '\n'))) {
*next_nl = 0;
/* version */
mc = sscanf(p, "sysbench %d.%d.%d", &v1, &v2, &v3);
@@ -100,7 +100,7 @@ static gboolean sysbench_run(struct sysbench_ctx *ctx, int expecting_version) {
g_free(cmd_line);
if (spawned) {
p = out;
- while(next_nl = strchr(p, '\n')) {
+ while((next_nl = strchr(p, '\n'))) {
*next_nl = 0;
if (strstr(p, "Usage:")) {
@@ -118,7 +118,7 @@ static gboolean sysbench_run(struct sysbench_ctx *ctx, int expecting_version) {
}
/* total_time */
- if (pp = strstr(p, "total time:")) {
+ if ((pp = strstr(p, "total time:"))) {
pp = strchr(pp, ':') + 1;
ctx->r.elapsed_time = strtof(pp, NULL);
}
@@ -126,7 +126,7 @@ static gboolean sysbench_run(struct sysbench_ctx *ctx, int expecting_version) {
/* result */
if (SEQ(ctx->test, "memory") ) {
// 57894.30 MiB transferred (5787.59 MiB/sec)
- if (pp = strstr(p, " transferred (")) {
+ if ((pp = strstr(p, " transferred ("))) {
pp = strchr(pp, '(') + 1;
ctx->r.result = strtof(pp, NULL);
}
@@ -139,7 +139,7 @@ static gboolean sysbench_run(struct sysbench_ctx *ctx, int expecting_version) {
// total number of events: 873
/* should already have "total time:" */
- if (pp = strstr(p, " total number of events:")) {
+ if ((pp = strstr(p, " total number of events:"))) {
pp = strchr(pp, ':') + 1;
ctx->r.result = strtof(pp, NULL);
ctx->r.result /= ctx->r.elapsed_time;
@@ -147,7 +147,7 @@ static gboolean sysbench_run(struct sysbench_ctx *ctx, int expecting_version) {
}
if (ctx->r.revision >= 1000000) {
// events per second: 1674.97
- if (pp = strstr(p, " events per second:")) {
+ if ((pp = strstr(p, " events per second:"))) {
pp = strchr(pp, ':') + 1;
ctx->r.result = strtof(pp, NULL);
}
diff --git a/modules/benchmark/zlib.c b/modules/benchmark/zlib.c
index 2045969f..3f2c1291 100644
--- a/modules/benchmark/zlib.c
+++ b/modules/benchmark/zlib.c
@@ -35,15 +35,14 @@
static unsigned int zlib_errors = 0;
static gpointer zlib_for(void *in_data, gint thread_number) {
- char *compressed;
+ guchar *compressed;
uLong bound = compressBound(BENCH_DATA_SIZE);
- unsigned int i;
compressed = malloc(bound);
if (!compressed)
return NULL;
- char uncompressed[BENCH_DATA_SIZE];
+ guchar uncompressed[BENCH_DATA_SIZE];
uLong compressedBound = bound;
uLong destBound = sizeof(uncompressed);