From 4b77461f6643447a5b4cb0e133c8eaf8dd1cef72 Mon Sep 17 00:00:00 2001 From: hwspeedy Date: Fri, 24 May 2024 12:27:18 +0200 Subject: FIX GCC warnings arch/GCC version related --- modules/benchmark.c | 8 ++++---- modules/devices.c | 10 +++++----- modules/devices/arm/processor.c | 5 ++--- modules/devices/riscv/processor.c | 1 - modules/devices/riscv/riscv_data.c | 2 +- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/modules/benchmark.c b/modules/benchmark.c index 441dc1ac..54e0086a 100644 --- a/modules/benchmark.c +++ b/modules/benchmark.c @@ -48,8 +48,8 @@ static gchar *benchmark_include_results(bench_value result, char *bench_value_to_str(bench_value r) { - gboolean has_rev = r.revision >= 0; - gboolean has_extra = r.extra && *r.extra != 0; + gboolean has_rev = (r.revision >= 0); + gboolean has_extra = (*r.extra != 0); char *ret = g_strdup_printf("%lf; %lf; %d", r.result, r.elapsed_time, r.threads_used); if (has_rev || has_extra) @@ -597,13 +597,13 @@ do_benchmark_handler(GIOChannel *source, GIOCondition condition, gpointer data) if (status != G_IO_STATUS_NORMAL) { DEBUG("error while reading benchmark result"); r.result = -1.0f; - if(bench_dialog && &bench_dialog->r) bench_dialog->r = r; + if(bench_dialog) bench_dialog->r = r; gtk_dialog_response(GTK_DIALOG(bench_dialog->dialog),100); return FALSE; } if(result) r = bench_value_from_str(result); - if(result && bench_dialog && &bench_dialog->r) bench_dialog->r = r; + if(result && bench_dialog) bench_dialog->r = r; g_free(result); gtk_dialog_response(GTK_DIALOG(bench_dialog->dialog),GTK_RESPONSE_NONE); diff --git a/modules/devices.c b/modules/devices.c index 8bf24d46..38fce948 100644 --- a/modules/devices.c +++ b/modules/devices.c @@ -408,15 +408,15 @@ gchar *get_processor_max_frequency(void) gchar *get_motherboard(void) { - gchar *board_name, *board_vendor, *board_version; - gchar *product_name, *product_vendor, *product_version; + gchar *board_vendor; + +#if defined(ARCH_x86) || defined(ARCH_x86_64) + gchar *board_name, *board_version; gchar *board_part = NULL, *product_part = NULL; const gchar *tmp; + gchar *product_name, *product_vendor, *product_version; int b = 0, p = 0; - gchar *ret; - -#if defined(ARCH_x86) || defined(ARCH_x86_64) scan_dmi(FALSE); board_name = dmi_get_str("baseboard-product-name"); diff --git a/modules/devices/arm/processor.c b/modules/devices/arm/processor.c index 9446108d..23e54934 100644 --- a/modules/devices/arm/processor.c +++ b/modules/devices/arm/processor.c @@ -229,7 +229,6 @@ static gint cmp_cpufreq_data(cpufreq_data *a, cpufreq_data *b) { } static gint cmp_cpufreq_data_ignore_affected(cpufreq_data *a, cpufreq_data *b) { - gint i = 0; cmp_clocks_test(cpukhz_max); cmp_clocks_test(cpukhz_min); return 0; @@ -239,10 +238,10 @@ gchar *clocks_summary(GSList * processors) { gchar *ret = g_strdup_printf("[%s]\n", _("Clocks")); GSList *all_clocks = NULL, *uniq_clocks = NULL; - GSList *tmp, *l; + GSList *l; Processor *p; cpufreq_data *c, *cur = NULL; - gint cur_count = 0, i = 0; + gint cur_count = 0; /* create list of all clock references */ for (l = processors; l; l = l->next) { diff --git a/modules/devices/riscv/processor.c b/modules/devices/riscv/processor.c index cd8da4c7..ee7f48c7 100644 --- a/modules/devices/riscv/processor.c +++ b/modules/devices/riscv/processor.c @@ -33,7 +33,6 @@ processor_scan(void) FILE *cpuinfo; gchar buffer[128]; gchar *rep_pname = NULL; - gchar *tmpfreq_str = NULL; GSList *pi = NULL; cpuinfo = fopen(PROC_CPUINFO, "r"); diff --git a/modules/devices/riscv/riscv_data.c b/modules/devices/riscv/riscv_data.c index 526067d3..5af20103 100644 --- a/modules/devices/riscv/riscv_data.c +++ b/modules/devices/riscv/riscv_data.c @@ -174,7 +174,7 @@ static int riscv_isa_next(const char *isap, char *flag) { #define FSTR_SIZE 1024 #define RV_CHECK_FOR(e) ( strncasecmp(ps, e, 2) == 0 ) -#define ADD_EXT_FLAG(ext) el = strlen(ext); strncpy(pd, ext, el); strncpy(pd + el, " ", 1); pd += el + 1; +#define ADD_EXT_FLAG(ext) el = strlen(ext); strncpy(pd, ext, el); pd[el]=' '; pd[el+1]=0; pd += el + 1; char *riscv_isa_to_flags(const char *isa) { char *flags = NULL, *ps = (char*)isa, *pd = NULL; char flag_buf[64] = ""; -- cgit v1.2.3