CppCheck : The scope of the variable can be reduced
Bonjour,
CppCheck me renvoi une erreur de style sur les lignes
Code:
1 2
| gchar **coup_eclate;
gchar *tmp_coup; |
message d'erreur : The scope of the variable 'coup_eclate' can be reduced.
The scope of the variable 'tmp_coup' can be reduced.
voici le code de la fonction :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| static gint SQLite_queries_load_next_play(void *data, gint argc,
gchar **argv, gchar **azColName)
{
Senreg *enreg=(Senreg*)data;
gchar **coup_eclate;
gchar *tmp_coup;
if ((gint)g_ascii_strtod(argv[4], NULL)==enreg->corres_partie)
{
tmp_coup=g_strdup(argv[1]);
coup_eclate=g_strsplit(g_strcanon(tmp_coup,"0123456789",' ')," ",0);
enreg->start=(gint)g_ascii_strtod(coup_eclate[0], NULL);
enreg->end=(gint)g_ascii_strtod(coup_eclate[1], NULL);
g_strfreev(coup_eclate);
g_free(tmp_coup);
}
return 0;
} |
Est-ce que vous avez une idée pour corrigé cela ?
Merci par avance pour votre aide.