mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-22 23:48:36 -07:00
contrib/plugins/cflow: fix warning
contrib/plugins/cflow.c: In function ‘plugin_exit’:
contrib/plugins/cflow.c:167:19: error: declaration of ‘n’ shadows a previous local [-Werror=shadow=local]
167 | NodeData *n = l->data;
| ^
contrib/plugins/cflow.c:139:9: note: shadowed declaration is here
139 | int n = 0;
| ^
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20241023212812.1376972-2-pierrick.bouvier@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
parent
daaf51001a
commit
6d630d84ca
1 changed files with 3 additions and 3 deletions
|
|
@ -136,7 +136,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
|
||||||
g_autoptr(GString) result = g_string_new("collected ");
|
g_autoptr(GString) result = g_string_new("collected ");
|
||||||
GList *data;
|
GList *data;
|
||||||
GCompareFunc sort = &hottest;
|
GCompareFunc sort = &hottest;
|
||||||
int n = 0;
|
int i = 0;
|
||||||
|
|
||||||
g_mutex_lock(&node_lock);
|
g_mutex_lock(&node_lock);
|
||||||
g_string_append_printf(result, "%d control flow nodes in the hash table\n",
|
g_string_append_printf(result, "%d control flow nodes in the hash table\n",
|
||||||
|
|
@ -162,8 +162,8 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
|
||||||
data = g_list_sort(data, sort);
|
data = g_list_sort(data, sort);
|
||||||
|
|
||||||
for (GList *l = data;
|
for (GList *l = data;
|
||||||
l != NULL && n < topn;
|
l != NULL && i < topn;
|
||||||
l = l->next, n++) {
|
l = l->next, i++) {
|
||||||
NodeData *n = l->data;
|
NodeData *n = l->data;
|
||||||
const char *type = n->mid_count ? "sync fault" : "branch";
|
const char *type = n->mid_count ? "sync fault" : "branch";
|
||||||
g_string_append_printf(result, " addr: 0x%"PRIx64 " %s: %s (%s)\n",
|
g_string_append_printf(result, " addr: 0x%"PRIx64 " %s: %s (%s)\n",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue