Skip to content

Commit

Permalink
qobject: braces {} are necessary for all arms of this statement
Browse files Browse the repository at this point in the history
Add braces {} for arms of if/for statement

Signed-off-by: Zhang Han <zhanghan64@huawei.com>
Message-Id: <20201228071129.24563-5-zhanghan64@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
  • Loading branch information
Zhang Han authored and Markus Armbruster committed Feb 4, 2021
1 parent f3d71c6 commit 1841f01
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qobject/qdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ static unsigned int tdb_hash(const char *name)
unsigned i; /* Used to cycle through random values. */

/* Set the initial value from the key size. */
for (value = 0x238F13AF * strlen(name), i = 0; name[i]; i++)
for (value = 0x238F13AF * strlen(name), i = 0; name[i]; i++) {
value = (value + (((const unsigned char *)name)[i] << (i * 5 % 24)));
}

return (1103515243 * value + 12345);
}
Expand Down Expand Up @@ -93,8 +94,9 @@ static QDictEntry *qdict_find(const QDict *qdict,
QDictEntry *entry;

QLIST_FOREACH(entry, &qdict->table[bucket], next)
if (!strcmp(entry->key, key))
if (!strcmp(entry->key, key)) {
return entry;
}

return NULL;
}
Expand Down

0 comments on commit 1841f01

Please sign in to comment.