aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/benchmark.c4
-rw-r--r--modules/benchmark/bench_results.c6
-rw-r--r--modules/benchmark/guibench.c4
-rw-r--r--modules/benchmark/nqueens.c20
-rw-r--r--modules/computer.c3
-rw-r--r--modules/computer/modules.c3
-rw-r--r--modules/devices.c6
-rw-r--r--modules/devices/printers.c2
-rw-r--r--modules/devices/spd-decode.c2
9 files changed, 31 insertions, 19 deletions
diff --git a/modules/benchmark.c b/modules/benchmark.c
index 018e30fe..0dd883dc 100644
--- a/modules/benchmark.c
+++ b/modules/benchmark.c
@@ -923,15 +923,17 @@ void hi_module_init(void)
.name = N_("Send benchmark results"),
.file_name = "benchmark.json",
.generate_contents_for_upload = get_benchmark_results,
+ .optional = FALSE,
},
{
.name = N_("Receive benchmark results"),
.file_name = "benchmark.json",
+ .optional = FALSE,
},
};
- sync_manager_add_entry(&se[0]);
sync_manager_add_entry(&se[1]);
+ sync_manager_add_entry(&se[0]);
guint i;
for (i = 0; i < G_N_ELEMENTS(entries) - 1 /* account for NULL */; i++)
diff --git a/modules/benchmark/bench_results.c b/modules/benchmark/bench_results.c
index 18ed0739..e0557fc2 100644
--- a/modules/benchmark/bench_results.c
+++ b/modules/benchmark/bench_results.c
@@ -354,8 +354,10 @@ static void append_cpu_config(JsonObject *object,
static gchar *get_cpu_config(JsonObject *machine)
{
- JsonObject *cpu_config_map =
- json_object_get_object_member(machine, "CpuConfigMap");
+ JsonObject *cpu_config_map=NULL;
+
+ if(json_object_has_member(machine, "CpuConfigMap"))
+ cpu_config_map=json_object_get_object_member(machine, "CpuConfigMap");
if (!cpu_config_map)
return json_get_string_dup(machine, "CpuConfig");
diff --git a/modules/benchmark/guibench.c b/modules/benchmark/guibench.c
index 2b4f3b11..e0f8351e 100644
--- a/modules/benchmark/guibench.c
+++ b/modules/benchmark/guibench.c
@@ -68,7 +68,7 @@ static gchar *phrase = NULL;
static gboolean keypress_event(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
{
const int magic[] = { 0x1b, 0x33, 0x3a, 0x35, 0x51 };
- const int states[] = { 0xff52, 0xff52, 0xff54, 0xff54,
+ const unsigned int states[] = { 0xff52, 0xff52, 0xff54, 0xff54,
0xff51, 0xff53, 0xff51, 0xff53,
0x62, 0x61 };
static int state = 0;
@@ -80,7 +80,7 @@ static gboolean keypress_event(GtkWidget *widget, GdkEventKey *event, gpointer u
}
if (state == G_N_ELEMENTS(states)) {
- int i;
+ unsigned int i;
for (i = 0; i < G_N_ELEMENTS(magic); i++) {
phrase[i + 6] = magic[i] ^ (states[i] & (states[i] >> 8));
diff --git a/modules/benchmark/nqueens.c b/modules/benchmark/nqueens.c
index 6aad7638..bda9f884 100644
--- a/modules/benchmark/nqueens.c
+++ b/modules/benchmark/nqueens.c
@@ -10,13 +10,12 @@
#include "benchmark.h"
/* if anything changes in this block, increment revision */
-#define BENCH_REVISION 2
-#define QUEENS 6
+#define BENCH_REVISION 3
+#define QUEENS 9
#define CRUNCH_TIME 5
-int row[QUEENS];
-bool safe(int x, int y) {
+bool safe(int x, int y,int *row) {
int i;
for (i = 1; i <= y; i++)
if (row[y - i] == x || row[y - i] == x - i || row[y - i] == x + i)
@@ -24,13 +23,13 @@ bool safe(int x, int y) {
return true;
}
-int nqueens(int y) {
+int nqueens(int y,int *row) {
int x;
for (x = 0; x < QUEENS; x++) {
- if (safe((row[y - 1] = x), y - 1)) {
- if (y < QUEENS) {
- nqueens(y + 1);
+ if (safe((row[y - 1] = x), y - 1, row)) {
+ if (y <= QUEENS) {
+ nqueens(y + 1, row);
} else {
break;
}
@@ -42,7 +41,8 @@ int nqueens(int y) {
static gpointer nqueens_for(void *data, gint thread_number)
{
- nqueens(0);
+ int row[QUEENS+1];
+ nqueens(1,row);
return NULL;
}
@@ -58,7 +58,7 @@ benchmark_nqueens(void)
r = benchmark_crunch_for(CRUNCH_TIME, 0, nqueens_for, NULL);
r.revision = BENCH_REVISION;
- snprintf(r.extra, 255, "q:%d", QUEENS);
+ snprintf(r.extra, 255, "q:%d", QUEENS-1);
r.result /= 25;
diff --git a/modules/computer.c b/modules/computer.c
index fff8ba36..68629f2e 100644
--- a/modules/computer.c
+++ b/modules/computer.c
@@ -639,7 +639,8 @@ gchar *callback_security(void)
info_add_group(
info, _("Health"),
- info_field_update(_("Available entropy in /dev/random"), 1000, .tag = g_strdup("entropy") ),
+ //info_field_update(_("Available entropy in /dev/random"), 1000, .tag = g_strdup("entropy") ),
+ info_field(_("Available entropy in /dev/random"), computer_get_entropy_avail() ),
info_field_last());
info_add_group(
diff --git a/modules/computer/modules.c b/modules/computer/modules.c
index 14028362..4c0c54ea 100644
--- a/modules/computer/modules.c
+++ b/modules/computer/modules.c
@@ -167,11 +167,12 @@ void kernel_module_icon_init(void)
static SyncEntry sync_entry = {
.name = N_("Update kernel module icon table"),
.file_name = "kernel-module-icons.json",
+ .optional = TRUE,
};
sync_manager_add_entry(&sync_entry);
icon_json = g_build_filename(g_get_user_config_dir(),
- "hardinfo", "kernel-module-icons.json",
+ "hardinfo2", "kernel-module-icons.json",
NULL);
module_icons = g_hash_table_new(g_str_hash, g_str_equal);
diff --git a/modules/devices.c b/modules/devices.c
index dd51b482..7e9eef6d 100644
--- a/modules/devices.c
+++ b/modules/devices.c
@@ -840,28 +840,34 @@ void hi_module_init(void)
{
.name = N_("Update PCI ID listing"),
.file_name = "pci.ids",
+ .optional = TRUE,
},
{
.name = N_("Update USB ID listing"),
.file_name = "usb.ids",
+ .optional = TRUE,
},
{
.name = N_("Update EDID vendor codes"),
.file_name = "edid.ids",
+ .optional = TRUE,
},
{
.name = N_("Update IEEE OUI vendor codes"),
.file_name = "ieee_oui.ids",
+ .optional = TRUE,
},
{
.name = N_("Update SD card manufacturer information"),
.file_name = "sdcard.ids",
+ .optional = TRUE,
},
#ifdef ARCH_x86
#if JSON_CHECK_VERSION(0,20,0)
{
.name = N_("Update CPU flags database"),
.file_name = "cpuflags.json",
+ .optional = TRUE,
},
#endif
#endif
diff --git a/modules/devices/printers.c b/modules/devices/printers.c
index d880e691..0ed9dcda 100644
--- a/modules/devices/printers.c
+++ b/modules/devices/printers.c
@@ -43,7 +43,7 @@ struct _CUPSDest {
static int (*cups_dests_get) (CUPSDest **dests) = NULL;
static int (*cups_dests_free) (int num_dests, CUPSDest *dests) = NULL;
static void (*cups_set_server)(const char *server) = NULL;
-volatile static gboolean cups_init = FALSE;
+static volatile gboolean cups_init = FALSE;
GModule *cups;
diff --git a/modules/devices/spd-decode.c b/modules/devices/spd-decode.c
index 511504b2..cf4c89d7 100644
--- a/modules/devices/spd-decode.c
+++ b/modules/devices/spd-decode.c
@@ -1160,7 +1160,7 @@ static GSList *decode_dimms2(GSList *eeprom_list, const gchar *driver, gboolean
}
if (s) {
- strncpy(s->dev, g_basename(spd_path), 31);
+ strncpy(s->dev, g_path_get_basename(spd_path), 31);
s->spd_driver = driver;
s->spd_size = spd_size;
s->type = ram_type;