aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hardinfo/hardinfo.c2
-rw-r--r--hardinfo/util.c2
-rw-r--r--includes/hardinfo.h2
-rw-r--r--includes/shell.h2
-rw-r--r--modules/benchmark.c17
-rw-r--r--modules/computer.c15
-rw-r--r--modules/devices.c17
-rw-r--r--modules/network.c16
-rw-r--r--shell/callbacks.c2
9 files changed, 37 insertions, 38 deletions
diff --git a/hardinfo/hardinfo.c b/hardinfo/hardinfo.c
index 76527364..6d1bf8ce 100644
--- a/hardinfo/hardinfo.c
+++ b/hardinfo/hardinfo.c
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
for (modules = modules_load_all(); modules;
modules = modules->next) {
ShellModule *module = (ShellModule *) modules->data;
- ModuleAbout *ma = module_get_about(module);
+ const ModuleAbout *ma = module_get_about(module);
gchar *name = g_path_get_basename(g_module_name(module->dll));
g_print("%-20s %-15s %-12s\n", name, module->name, ma->version);
diff --git a/hardinfo/util.c b/hardinfo/util.c
index 89c3ffd4..d8c77e78 100644
--- a/hardinfo/util.c
+++ b/hardinfo/util.c
@@ -849,7 +849,7 @@ static void module_entry_free(gpointer data, gpointer user_data)
}
#endif
-ModuleAbout *module_get_about(ShellModule * module)
+const ModuleAbout *module_get_about(ShellModule * module)
{
if (module->aboutfunc) {
return module->aboutfunc();
diff --git a/includes/hardinfo.h b/includes/hardinfo.h
index 010af922..34586549 100644
--- a/includes/hardinfo.h
+++ b/includes/hardinfo.h
@@ -134,7 +134,7 @@ GSList *modules_get_list(void);
GSList *modules_load_selected(void);
GSList *modules_load_all(void);
void module_unload_all(void);
-ModuleAbout *module_get_about(ShellModule *module);
+const ModuleAbout *module_get_about(ShellModule *module);
gchar *seconds_to_string(unsigned int seconds);
gchar *h_strdup_cprintf(const gchar *format, gchar *source, ...);
diff --git a/includes/shell.h b/includes/shell.h
index 927a9adf..3f0ef47e 100644
--- a/includes/shell.h
+++ b/includes/shell.h
@@ -139,7 +139,7 @@ struct _ShellModule {
GdkPixbuf *icon;
GModule *dll;
- gpointer (*aboutfunc) ();
+ gconstpointer (*aboutfunc)(void);
gchar *(*summaryfunc) ();
void (*deinit) ();
diff --git a/modules/benchmark.c b/modules/benchmark.c
index 068b466c..0d337ec1 100644
--- a/modules/benchmark.c
+++ b/modules/benchmark.c
@@ -649,15 +649,16 @@ guchar hi_module_get_weight(void) { return 240; }
ModuleEntry *hi_module_get_entries(void) { return entries; }
-ModuleAbout *hi_module_get_about(void)
+const ModuleAbout *hi_module_get_about(void)
{
- static ModuleAbout ma[] = {
- {.author = "Leandro A. F. Pereira",
- .description = N_("Perform tasks and compare with other systems"),
- .version = VERSION,
- .license = "GNU GPL version 2"}};
-
- return ma;
+ static const ModuleAbout ma = {
+ .author = "Leandro A. F. Pereira",
+ .description = N_("Perform tasks and compare with other systems"),
+ .version = VERSION,
+ .license = "GNU GPL version 2",
+ };
+
+ return &ma;
}
static gchar *get_benchmark_results()
diff --git a/modules/computer.c b/modules/computer.c
index 49a1511f..925822a9 100644
--- a/modules/computer.c
+++ b/modules/computer.c
@@ -1069,17 +1069,16 @@ void hi_module_init(void)
init_memory_labels();
}
-ModuleAbout *hi_module_get_about(void)
+const ModuleAbout *hi_module_get_about(void)
{
- static ModuleAbout ma[] = {
- {
- .author = "Leandro A. F. Pereira",
- .description = N_("Gathers high-level computer information"),
- .version = VERSION,
- .license = "GNU GPL version 2"}
+ static const ModuleAbout ma = {
+ .author = "Leandro A. F. Pereira",
+ .description = N_("Gathers high-level computer information"),
+ .version = VERSION,
+ .license = "GNU GPL version 2",
};
- return ma;
+ return &ma;
}
static const gchar *hinote_kmod() {
diff --git a/modules/devices.c b/modules/devices.c
index a90cbc0a..fef8b559 100644
--- a/modules/devices.c
+++ b/modules/devices.c
@@ -867,17 +867,16 @@ void hi_module_deinit(void)
g_module_close(cups);
}
-ModuleAbout *hi_module_get_about(void)
-{
- static ModuleAbout ma[] = {
- {
- .author = "Leandro A. F. Pereira",
- .description = N_("Gathers information about hardware devices"),
- .version = VERSION,
- .license = "GNU GPL version 2"}
+const ModuleAbout *hi_module_get_about(void)
+{
+ const static ModuleAbout ma = {
+ .author = "Leandro A. F. Pereira",
+ .description = N_("Gathers information about hardware devices"),
+ .version = VERSION,
+ .license = "GNU GPL version 2",
};
- return ma;
+ return &ma;
}
gchar **hi_module_get_dependencies(void)
diff --git a/modules/network.c b/modules/network.c
index a40db80e..300cc041 100644
--- a/modules/network.c
+++ b/modules/network.c
@@ -433,15 +433,15 @@ void hi_module_deinit(void)
g_free(__connections);
}
-ModuleAbout *hi_module_get_about(void)
+const ModuleAbout *hi_module_get_about(void)
{
- static ModuleAbout ma[] = {
- {
- .author = "Leandro A. F. Pereira",
- .description = N_("Gathers information about this computer's network connection"),
- .version = VERSION,
- .license = "GNU GPL version 2"}
+ static const ModuleAbout ma = {
+ .author = "Leandro A. F. Pereira",
+ .description =
+ N_("Gathers information about this computer's network connection"),
+ .version = VERSION,
+ .license = "GNU GPL version 2",
};
- return ma;
+ return &ma;
}
diff --git a/shell/callbacks.c b/shell/callbacks.c
index bbcc4617..38d51c33 100644
--- a/shell/callbacks.c
+++ b/shell/callbacks.c
@@ -95,7 +95,7 @@ void cb_about_module(GtkAction * action)
{
Shell *shell = shell_get_main_shell();
GSList *modules = shell->tree->modules;
- ModuleAbout *ma;
+ const ModuleAbout *ma;
gchar *name;
g_object_get(G_OBJECT(action), "tooltip", &name, NULL);