mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 06:33:41 +02:00
Avoid setting unused variables (-Wself-assign)
Setting a variable and then assigning it to itself avoids -Wunused-but-set-variable but this specific trick is now caught by -Wself-assign. Instead, actually use the value or don't bother assigning it at all: gdbusauth.c: call g_data_input_stream_read_byte() in void context gdbusauthmechanismsha1.c: value is actually used gdbusmessage.c: use consistent preprocessor-token protection gthreadedresolver.c: skip over bytes in data blob httpd.c: do something useful with the value https://bugzilla.gnome.org/show_bug.cgi?id=745723
This commit is contained in:
committed by
Philip Withnall
parent
5d9ccf162e
commit
190f64a0fb
@@ -537,7 +537,6 @@ g_resolver_records_from_res_query (const gchar *rrname,
|
||||
gchar namebuf[1024];
|
||||
guchar *end, *p;
|
||||
guint16 type, qclass, rdlength;
|
||||
guint32 ttl;
|
||||
HEADER *header;
|
||||
GList *records;
|
||||
GVariant *record;
|
||||
@@ -587,8 +586,7 @@ g_resolver_records_from_res_query (const gchar *rrname,
|
||||
p += dn_expand (answer, end, p, namebuf, sizeof (namebuf));
|
||||
GETSHORT (type, p);
|
||||
GETSHORT (qclass, p);
|
||||
GETLONG (ttl, p);
|
||||
ttl = ttl; /* To avoid -Wunused-but-set-variable */
|
||||
p += 4; /* ignore the ttl (type=long) value */
|
||||
GETSHORT (rdlength, p);
|
||||
|
||||
if (type != rrtype || qclass != C_IN)
|
||||
|
Reference in New Issue
Block a user