Initialise GError's
This commit is contained in:
parent
46083b1e7d
commit
5225c6117b
|
@ -103,7 +103,7 @@ writer_acronym_cb (const GMatchInfo *info, GString *res,
|
||||||
static gpointer
|
static gpointer
|
||||||
worker_writer (WorkerData *data)
|
worker_writer (WorkerData *data)
|
||||||
{
|
{
|
||||||
GError *error;
|
GError *error = NULL;
|
||||||
GMatchInfo *match_info;
|
GMatchInfo *match_info;
|
||||||
while (stardict_iterator_get_offset (data->iterator) != data->end_entry)
|
while (stardict_iterator_get_offset (data->iterator) != data->end_entry)
|
||||||
{
|
{
|
||||||
|
@ -167,7 +167,7 @@ get_void_entry (gchar *cmdline[])
|
||||||
gchar *output;
|
gchar *output;
|
||||||
gint exit_status;
|
gint exit_status;
|
||||||
|
|
||||||
GError *error;
|
GError *error = NULL;
|
||||||
if (!g_spawn_sync (NULL, cmdline, NULL,
|
if (!g_spawn_sync (NULL, cmdline, NULL,
|
||||||
G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL,
|
G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL,
|
||||||
&output, NULL, &exit_status, &error))
|
&output, NULL, &exit_status, &error))
|
||||||
|
@ -190,7 +190,7 @@ static gpointer
|
||||||
worker (WorkerData *data)
|
worker (WorkerData *data)
|
||||||
{
|
{
|
||||||
/* Spawn eSpeak */
|
/* Spawn eSpeak */
|
||||||
GError *error;
|
GError *error = NULL;
|
||||||
gint child_in, child_out;
|
gint child_in, child_out;
|
||||||
if (!g_spawn_async_with_pipes (NULL, data->cmdline, NULL,
|
if (!g_spawn_async_with_pipes (NULL, data->cmdline, NULL,
|
||||||
G_SPAWN_SEARCH_PATH, NULL, NULL,
|
G_SPAWN_SEARCH_PATH, NULL, NULL,
|
||||||
|
|
|
@ -288,7 +288,7 @@ app_reload_view (Application *self)
|
||||||
static void
|
static void
|
||||||
app_init (Application *self, const gchar *filename)
|
app_init (Application *self, const gchar *filename)
|
||||||
{
|
{
|
||||||
GError *error;
|
GError *error = NULL;
|
||||||
self->dict = stardict_dict_new (filename, &error);
|
self->dict = stardict_dict_new (filename, &error);
|
||||||
if (!self->dict)
|
if (!self->dict)
|
||||||
{
|
{
|
||||||
|
|
|
@ -178,7 +178,7 @@ generate_dictionary_data (gsize length)
|
||||||
static Dictionary *
|
static Dictionary *
|
||||||
dictionary_create (void)
|
dictionary_create (void)
|
||||||
{
|
{
|
||||||
GError *error;
|
GError *error = NULL;
|
||||||
gchar *tmp_dir_path = g_dir_make_tmp ("stardict-test-XXXXXX", &error);
|
gchar *tmp_dir_path = g_dir_make_tmp ("stardict-test-XXXXXX", &error);
|
||||||
if (!tmp_dir_path)
|
if (!tmp_dir_path)
|
||||||
g_error ("Failed to create a directory for the test dictionary: %s",
|
g_error ("Failed to create a directory for the test dictionary: %s",
|
||||||
|
@ -234,7 +234,7 @@ dictionary_create (void)
|
||||||
static void
|
static void
|
||||||
dictionary_destroy (Dictionary *dict)
|
dictionary_destroy (Dictionary *dict)
|
||||||
{
|
{
|
||||||
GError *error;
|
GError *error = NULL;
|
||||||
if (!remove_recursive (dict->tmp_dir, &error))
|
if (!remove_recursive (dict->tmp_dir, &error))
|
||||||
g_error ("Failed to delete the temporary directory: %s",
|
g_error ("Failed to delete the temporary directory: %s",
|
||||||
error->message);
|
error->message);
|
||||||
|
|
Loading…
Reference in New Issue