diff options
author | bigbear <ns@bigbear.dk> | 2024-02-08 02:55:50 +0100 |
---|---|---|
committer | bigbear <ns@bigbear.dk> | 2024-02-08 19:52:53 +0100 |
commit | 3c387015ab71e9a0f4ec375e194a499019272c60 (patch) | |
tree | 85c59f20fb82d21d5f732137f16194383a364e69 | |
parent | 3d25cd5ae8241b687b970f8c1861451636a8f6ea (diff) |
FIX GCC Compatibility
-rw-r--r-- | deps/sysobj_early/src/util_edid.c | 11 | ||||
-rw-r--r-- | deps/sysobj_early/src/util_ids.c | 4 | ||||
-rw-r--r-- | hardinfo2/pci_util.c | 8 | ||||
-rw-r--r-- | hardinfo2/usb_util.c | 10 | ||||
-rw-r--r-- | modules/devices/monitors.c | 3 |
5 files changed, 23 insertions, 13 deletions
diff --git a/deps/sysobj_early/src/util_edid.c b/deps/sysobj_early/src/util_edid.c index 4b2c515d..06c5534e 100644 --- a/deps/sysobj_early/src/util_edid.c +++ b/deps/sysobj_early/src/util_edid.c @@ -323,8 +323,10 @@ static void did_block_decode(DisplayIDBlock *blk) { uint32_t a = blk->addy.offset; /* start of block, includes header */ uint8_t *u8 = DPTR(blk->addy); int b = h; - edid_ven ven = {}; - edid_output out = {}; + edid_ven ven;// = {}; + edid_output out;// = {}; + memset(&ven,0,sizeof(edid_ven)); + memset(&out,0,sizeof(edid_output)); if (blk) { switch(blk->type) { case 0: /* Product ID (1.x) */ @@ -443,7 +445,8 @@ static edid_output edid_output_from_svd(uint8_t index) { if (index >= 128 && index <= 192) index &= 0x7f; /* "native" flag for 0-64 */ for(i = 0; i < (int)G_N_ELEMENTS(cea_standard_timings); i++) { if (cea_standard_timings[i].index == index) { - edid_output out = {}; + edid_output out;// = {}; + memset(&out,0,sizeof(edid_output)); out.horiz_pixels = cea_standard_timings[i].horiz_active; out.vert_lines = cea_standard_timings[i].vert_active; if (strchr(cea_standard_timings[i].short_name, 'i')) @@ -1153,7 +1156,7 @@ char *edid_cea_audio_describe(struct edid_sad *sad) { sad->format, _(edid_cea_audio_type(sad->format)) ); gchar *ret = NULL; - gchar *tmp[3] = {}; + gchar *tmp[3] = {NULL,NULL,NULL}; #define appfreq(b, f) if (sad->freq_bits & (1 << b)) tmp[0] = appf(tmp[0], ", ", "%d", f); #define appdepth(b, d) if (sad->depth_bits & (1 << b)) tmp[1] = appf(tmp[1], ", ", "%d%s", d, _("-bit")); appfreq(0, 32); diff --git a/deps/sysobj_early/src/util_ids.c b/deps/sysobj_early/src/util_ids.c index b24dba59..197b1ed3 100644 --- a/deps/sysobj_early/src/util_ids.c +++ b/deps/sysobj_early/src/util_ids.c @@ -91,7 +91,7 @@ static void ids_query_result_set_str(ids_query_result *ret, int tabs, gchar *p) long scan_ids_file(const gchar *file, const gchar *qpath, ids_query_result *result, long start_offset) { gchar **qparts = NULL; gchar buff[IDS_LOOKUP_BUFF_SIZE] = ""; - ids_query_result ret = {}; + ids_query_result ret;// = {}; gchar *p = NULL; FILE *fd; @@ -100,6 +100,8 @@ long scan_ids_file(const gchar *file, const gchar *qpath, ids_query_result *resu int qpartlen[IDS_LOOKUP_MAX_DEPTH]; long last_root_fpos = -1, fpos, line = -1; + memset(&ret,0,sizeof(ids_query_result)); + if (!qpath) return -1; diff --git a/hardinfo2/pci_util.c b/hardinfo2/pci_util.c index 7dbc909d..f0c5059a 100644 --- a/hardinfo2/pci_util.c +++ b/hardinfo2/pci_util.c @@ -74,9 +74,9 @@ const gchar *find_pci_ids_file() { char *pci_lookup_ids_vendor_str(uint32_t id) { gchar *ret = NULL; - ids_query_result result = {}; + ids_query_result result;// = {}; gchar *qpath; - + memset(&result,0,sizeof(ids_query_result)); if (!find_pci_ids_file()) return FALSE; @@ -92,9 +92,9 @@ char *pci_lookup_ids_vendor_str(uint32_t id) { static gboolean pci_lookup_ids(pcid *d) { gboolean ret = FALSE; - ids_query_result result = {}; + ids_query_result result;// = {}; gchar *qpath; - + memset(&result,0,sizeof(ids_query_result)); if (!find_pci_ids_file()) return FALSE; diff --git a/hardinfo2/usb_util.c b/hardinfo2/usb_util.c index d9f943b1..744f084f 100644 --- a/hardinfo2/usb_util.c +++ b/hardinfo2/usb_util.c @@ -273,7 +273,9 @@ static gboolean usb_get_device_lsusb(int bus, int dev, usbd *s) { static gboolean usb_get_interface_sysfs(int conf, int number, const char* devpath, usbi *intf){ gchar *ifpath, *drvpath, *tmp; - ids_query_result result = {}; + ids_query_result result;// = {}; + + memset(&result,0,sizeof(ids_query_result)); ifpath = g_strdup_printf("%s:%d.%d", devpath, conf, number); if (!g_file_test(ifpath, G_FILE_TEST_EXISTS)){ @@ -335,9 +337,10 @@ static void find_usb_ids_file() { void usb_lookup_ids_vendor_product_str(gint vendor_id, gint product_id, gchar **vendor_str, gchar **product_str) { - ids_query_result result = {}; + ids_query_result result;// = {}; gchar *qpath; + memset(&result,0,sizeof(ids_query_result)); if (!usb_ids_file) find_usb_ids_file(); if (!usb_ids_file) @@ -356,9 +359,10 @@ static gboolean usb_get_device_sysfs(int bus, int dev, const char* sysfspath, us usbi *intf; gboolean ok; int i, if_count = 0, conf = 0, ver; - ids_query_result result = {}; + ids_query_result result;// = {}; gchar *qpath; + memset(&result,0,sizeof(ids_query_result)); if (sysfspath == NULL) return FALSE; diff --git a/modules/devices/monitors.c b/modules/devices/monitors.c index 38f3c9e6..02fb1d67 100644 --- a/modules/devices/monitors.c +++ b/modules/devices/monitors.c @@ -111,8 +111,9 @@ gchar *monitor_vendor_str(monitor *m, gboolean include_value, gboolean link_name if (!m || !m->e) return NULL; edid_ven ven = m->e->ven; gchar v[20] = "", t[4] = ""; - ids_query_result result = {}; + ids_query_result result;// = {}; + memset(&result,0,sizeof(ids_query_result)); if (ven.type == VEN_TYPE_PNP) { strcpy(v, ven.pnp); strcpy(t, "PNP"); |