aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorbigbear <ns@bigbear.dk>2024-02-08 02:57:20 +0100
committerbigbear <ns@bigbear.dk>2024-02-08 19:52:53 +0100
commit08e01f35f747bfe30a40ea99cbcd63ad7fb94e7e (patch)
treea727faeb3ffb38d523b0700a63e6e537d295a152 /modules
parent4c249cfdc742d162fdb384fba61236cada3d9f29 (diff)
FIX GCC Warnings
Diffstat (limited to 'modules')
-rw-r--r--modules/benchmark.c4
-rw-r--r--modules/benchmark/cryptohash.c4
-rw-r--r--modules/computer.c4
-rw-r--r--modules/devices.c6
-rw-r--r--modules/devices/battery.c2
-rw-r--r--modules/devices/dmi.c5
-rw-r--r--modules/devices/inputdevices.c2
-rw-r--r--modules/devices/pci.c2
-rw-r--r--modules/devices/printers.c4
-rw-r--r--modules/devices/resources.c2
-rw-r--r--modules/devices/x86/processor.c2
-rw-r--r--modules/network/net.c2
12 files changed, 20 insertions, 19 deletions
diff --git a/modules/benchmark.c b/modules/benchmark.c
index 78dd32bb..6fe8adb4 100644
--- a/modules/benchmark.c
+++ b/modules/benchmark.c
@@ -755,7 +755,7 @@ static gchar *get_benchmark_results(gsize *len)
JsonNode *root;
bench_machine *this_machine;
gchar *out;
- gint i;
+ guint i;
for (i = 0; i < G_N_ELEMENTS(entries); i++) {
if (!entries[i].name || !entries[i].scan_callback)
@@ -905,7 +905,7 @@ void hi_module_init(void)
sync_manager_add_entry(&se[0]);
sync_manager_add_entry(&se[1]);
- int i;
+ guint i;
for (i = 0; i < G_N_ELEMENTS(entries) - 1 /* account for NULL */; i++)
bench_results[i] = (bench_value)EMPTY_BENCH_VALUE;
}
diff --git a/modules/benchmark/cryptohash.c b/modules/benchmark/cryptohash.c
index add7ca03..32fcfd57 100644
--- a/modules/benchmark/cryptohash.c
+++ b/modules/benchmark/cryptohash.c
@@ -29,7 +29,7 @@
/* 5000*65536/(1024*1024) = 312.5 -- old version used 312.0 so results
* don't exactly compare. */
-void inline md5_step(char *data, glong srclen)
+inline void md5_step(char *data, glong srclen)
{
struct MD5Context ctx;
guchar checksum[16];
@@ -39,7 +39,7 @@ void inline md5_step(char *data, glong srclen)
MD5Final(checksum, &ctx);
}
-void inline sha1_step(char *data, glong srclen)
+inline void sha1_step(char *data, glong srclen)
{
SHA1_CTX ctx;
guchar checksum[20];
diff --git a/modules/computer.c b/modules/computer.c
index cfa6bb3c..fff8ba36 100644
--- a/modules/computer.c
+++ b/modules/computer.c
@@ -254,7 +254,7 @@ void scan_dev(gboolean reload)
{
SCAN_START();
- int i;
+ guint i;
struct {
gchar *compiler_name;
gchar *version_command;
@@ -465,7 +465,7 @@ gchar *computer_get_virtualization(void)
"/var/log/dmesg",
NULL
};
- const static struct {
+ static const struct {
gchar *str;
gchar *vmtype;
} vm_types[] = {
diff --git a/modules/devices.c b/modules/devices.c
index 440e614a..574896ee 100644
--- a/modules/devices.c
+++ b/modules/devices.c
@@ -286,7 +286,7 @@ gchar *get_storage_devices_simple(void)
return "";
}
- int i, fi;
+ guint i, fi;
struct InfoGroup *group;
struct InfoField *field;
gchar *storage_devs = NULL, *tmp;
@@ -863,7 +863,7 @@ void hi_module_init(void)
},
#endif
};
- gint i;
+ guint i;
for (i = 0; i < G_N_ELEMENTS(entries); i++)
sync_manager_add_entry(&entries[i]);
@@ -889,7 +889,7 @@ void hi_module_deinit(void)
const ModuleAbout *hi_module_get_about(void)
{
- const static ModuleAbout ma = {
+ static const ModuleAbout ma = {
.author = "L. A. F. Pereira",
.description = N_("Gathers information about hardware devices"),
.version = VERSION,
diff --git a/modules/devices/battery.c b/modules/devices/battery.c
index 3424fa9d..e356c14a 100644
--- a/modules/devices/battery.c
+++ b/modules/devices/battery.c
@@ -57,7 +57,7 @@ __scan_battery_apcupsd(void)
GHashTable *ups_data;
FILE *apcaccess;
char buffer[512], *apcaccess_path;
- int i;
+ guint i;
apcaccess_path = find_program("apcaccess");
if (apcaccess_path && (apcaccess = popen(apcaccess_path, "r"))) {
diff --git a/modules/devices/dmi.c b/modules/devices/dmi.c
index 263d6944..64de77d9 100644
--- a/modules/devices/dmi.c
+++ b/modules/devices/dmi.c
@@ -72,7 +72,7 @@ gboolean dmi_get_info(void)
const gchar *group = NULL;
DMIInfo *info;
gboolean dmi_succeeded = FALSE;
- gint i;
+ guint i;
gchar *value;
const gchar *vendor;
@@ -102,7 +102,8 @@ gboolean dmi_get_info(void)
state = (getuid() == 0) ? 0 : 1;
break;
case -1:
- state = 2;
+ state = 2;
+ break;
case 1:
value = dmi_get_str_abs(info->id_str);
break;
diff --git a/modules/devices/inputdevices.c b/modules/devices/inputdevices.c
index 54828b79..301641d4 100644
--- a/modules/devices/inputdevices.c
+++ b/modules/devices/inputdevices.c
@@ -113,7 +113,7 @@ __scan_input_devices(void)
usb_lookup_ids_vendor_product_str(vendor, product, &vendor_str, &product_str);
}
- if (bus >= 0 && bus < sizeof(bus_types) / sizeof(gchar*)) {
+ if (bus >= 0 && (guint)bus < sizeof(bus_types) / sizeof(gchar*)) {
bus_str = bus_types[bus];
}
diff --git a/modules/devices/pci.c b/modules/devices/pci.c
index c7114672..859fa339 100644
--- a/modules/devices/pci.c
+++ b/modules/devices/pci.c
@@ -45,7 +45,7 @@ static const struct {
static const gchar *find_icon_for_class(uint32_t class)
{
- int i;
+ guint i;
for (i = 0; i < G_N_ELEMENTS(class2icon); i++) {
if (class2icon[i].class <= 0xff) {
diff --git a/modules/devices/printers.c b/modules/devices/printers.c
index e849e1dc..fb9389ac 100644
--- a/modules/devices/printers.c
+++ b/modules/devices/printers.c
@@ -181,7 +181,7 @@ const struct {
void
scan_printers_do(void)
{
- int num_dests, i, j;
+ guint num_dests, j, i;
CUPSDest *dests;
gchar *prn_id, *prn_moreinfo;
@@ -209,7 +209,7 @@ scan_printers_do(void)
options = g_hash_table_new(g_str_hash, g_str_equal);
- for (j = 0; j < dests[i].num_options; j++) {
+ for (j = 0; (int)j < dests[i].num_options; j++) {
g_hash_table_insert(options,
g_strdup(dests[i].options[j].name),
g_strdup(dests[i].options[j].value));
diff --git a/modules/devices/resources.c b/modules/devices/resources.c
index 1436192d..c9d1ccb5 100644
--- a/modules/devices/resources.c
+++ b/modules/devices/resources.c
@@ -72,7 +72,7 @@ void scan_device_resources(gboolean reload)
SCAN_START();
FILE *io;
gchar buffer[256];
- gint i;
+ guint i;
gint zero_to_zero_addr = 0;
struct {
diff --git a/modules/devices/x86/processor.c b/modules/devices/x86/processor.c
index 62d32135..518786b5 100644
--- a/modules/devices/x86/processor.c
+++ b/modules/devices/x86/processor.c
@@ -685,7 +685,7 @@ gchar *processor_describe(GSList * processors) {
gchar *dmi_socket_info() {
gchar *ret;
dmi_type dt = 4;
- int i;
+ guint i;
dmi_handle_list *hl = dmidecode_handles(&dt);
if (!hl) {
diff --git a/modules/network/net.c b/modules/network/net.c
index 535461e4..9a5cb5f1 100644
--- a/modules/network/net.c
+++ b/modules/network/net.c
@@ -146,7 +146,7 @@ void get_wireless_info(int fd, NetInfo *netinfo)
if (ioctl(fd, SIOCGIWMODE, &wi_req) < 0) {
netinfo->wi_mode = 0;
} else {
- if (wi_req.u.mode >= 0 && wi_req.u.mode < 6) {
+ if (wi_req.u.mode < 6) {
netinfo->wi_mode = wi_req.u.mode;
} else {
netinfo->wi_mode = 6;