mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
gtk.c: squelch uninitialised-variable warning.
Apparently some compilers can't work out that new_window() will always write to its error-message parameter if it returns failure, so they complain at the call site that 'error' might be used uninitialised. Fix by explicitly initialising it. (To NULL, which really _shouldn't_ stop the compiler from warning, because surely that's just as bad if it reaches the following printf!) Also, while I'm at it, move it into the block where it's used, so it doesn't look as if it might pervade the whole of main().
This commit is contained in:
2
gtk.c
2
gtk.c
@ -3578,7 +3578,6 @@ static void list_presets_from_menu(struct preset_menu *menu)
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *pname = argv[0];
|
char *pname = argv[0];
|
||||||
char *error;
|
|
||||||
int ngenerate = 0, px = 1, py = 1;
|
int ngenerate = 0, px = 1, py = 1;
|
||||||
bool print = false;
|
bool print = false;
|
||||||
bool time_generation = false, test_solve = false, list_presets = false;
|
bool time_generation = false, test_solve = false, list_presets = false;
|
||||||
@ -3991,6 +3990,7 @@ int main(int argc, char **argv)
|
|||||||
} else {
|
} else {
|
||||||
frontend *fe;
|
frontend *fe;
|
||||||
bool headless = screenshot_file != NULL;
|
bool headless = screenshot_file != NULL;
|
||||||
|
char *error = NULL;
|
||||||
|
|
||||||
if (!headless)
|
if (!headless)
|
||||||
gtk_init(&argc, &argv);
|
gtk_init(&argc, &argv);
|
||||||
|
Reference in New Issue
Block a user