From: Zhang Han Date: Mon, 28 Dec 2020 07:11:29 +0000 (+0800) Subject: qobject: braces {} are necessary for all arms of this statement X-Git-Tag: v6.0.0-rc0~109^2~4 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1841f0112c4d8a0a561462eed25fc4357fe40afc;p=users%2Fdwmw2%2Fqemu.git qobject: braces {} are necessary for all arms of this statement Add braces {} for arms of if/for statement Signed-off-by: Zhang Han Message-Id: <20201228071129.24563-5-zhanghan64@huawei.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- diff --git a/qobject/qdict.c b/qobject/qdict.c index 6c15ed14c1..0216ca7ac1 100644 --- a/qobject/qdict.c +++ b/qobject/qdict.c @@ -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); } @@ -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; }