From: Christian Persch Date: Mon, 16 Jun 2008 16:53:58 +0000 (+0000) Subject: Use g_set_error_literal where appropriate. Patch from bug #535947. X-Git-Tag: GLIB_2_17_3~76 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9c17697b56501d11b4c653432cc9e290347aa03e;p=platform%2Fupstream%2Fglib.git Use g_set_error_literal where appropriate. Patch from bug #535947. svn path=/trunk/; revision=7051 --- diff --git a/ChangeLog b/ChangeLog index e44f4f7..9d62e97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 2008-06-16 Christian Persch + * glib/gbookmarkfile.c + * glib/gconvert.c + * glib/gfileutils.c + * glib/giochannel.c + * glib/giounix.c + * glib/giowin32.c + * glib/gkeyfile.c + * glib/gregex.c + * glib/gshell.c + * glib/gspawn-win32.c + * glib/gutf8.c: Use g_set_error_literal where appropriate. Patch from + bug #535947. + +2008-06-16 Christian Persch + * docs/reference/glib/glib-sections.txt: * glib/gerror.c: * glib/gerror.h: diff --git a/gio/ChangeLog b/gio/ChangeLog index 0a273de..9b212df 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,27 @@ +2008-06-16 Christian Persch + + * gio/gappinfo.c + * gio/gbufferedinputstream.c + * gio/gcancellable.c + * gio/gdatainputstream.c + * gio/gdesktopappinfo.c + * gio/gfile.c + * gio/gfileenumerator.c + * gio/gfileinputstream.c + * gio/gfileoutputstream.c + * gio/ginputstream.c + * gio/glocaldirectorymonitor.c + * gio/glocalfile.c + * gio/glocalfileenumerator.c + * gio/glocalfileinfo.c + * gio/glocalfilemonitor.c + * gio/glocalfileoutputstream.c + * gio/gmemoryinputstream.c + * gio/gmemoryoutputstream.c + * gio/goutputstream.c + * gio/gwin32appinfo.c: Use g_set_error_literal where appropriate. Patch from + bug #535947. + 2008-06-16 Tor Lillqvist Bug 538362 - Get Win32 icons back in the file chooser diff --git a/gio/gappinfo.c b/gio/gappinfo.c index 90cb2c5..f9c7ea5 100644 --- a/gio/gappinfo.c +++ b/gio/gappinfo.c @@ -271,7 +271,8 @@ g_app_info_set_as_default_for_extension (GAppInfo *appinfo, if (iface->set_as_default_for_extension) return (* iface->set_as_default_for_extension) (appinfo, extension, error); - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "g_app_info_set_as_default_for_extension not supported yet"); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + "g_app_info_set_as_default_for_extension not supported yet"); return FALSE; } @@ -302,9 +303,9 @@ g_app_info_add_supports_type (GAppInfo *appinfo, if (iface->add_supports_type) return (* iface->add_supports_type) (appinfo, content_type, error); - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - "g_app_info_add_supports_type not supported yet"); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + "g_app_info_add_supports_type not supported yet"); return FALSE; } @@ -360,9 +361,9 @@ g_app_info_remove_supports_type (GAppInfo *appinfo, if (iface->remove_supports_type) return (* iface->remove_supports_type) (appinfo, content_type, error); - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - "g_app_info_remove_supports_type not supported yet"); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + "g_app_info_remove_supports_type not supported yet"); return FALSE; } diff --git a/gio/gbufferedinputstream.c b/gio/gbufferedinputstream.c index 28860e0..230203b 100644 --- a/gio/gbufferedinputstream.c +++ b/gio/gbufferedinputstream.c @@ -865,8 +865,8 @@ g_buffered_input_stream_read_byte (GBufferedInputStream *stream, if (g_input_stream_is_closed (input_stream)) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED, - _("Stream is already closed")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_CLOSED, + _("Stream is already closed")); return -1; } diff --git a/gio/gcancellable.c b/gio/gcancellable.c index 9177e43..b8da35a 100644 --- a/gio/gcancellable.c +++ b/gio/gcancellable.c @@ -289,10 +289,10 @@ g_cancellable_set_error_if_cancelled (GCancellable *cancellable, { if (g_cancellable_is_cancelled (cancellable)) { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_CANCELLED, - _("Operation was cancelled")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_CANCELLED, + _("Operation was cancelled")); return TRUE; } diff --git a/gio/gdatainputstream.c b/gio/gdatainputstream.c index 9d3abef..27863d7 100644 --- a/gio/gdatainputstream.c +++ b/gio/gdatainputstream.c @@ -305,8 +305,8 @@ read_data (GDataInputStream *stream, return FALSE; if (res == 0) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - _("Unexpected early end-of-stream")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, + _("Unexpected early end-of-stream")); return FALSE; } } diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 64e91ee..b9753de 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -584,8 +584,8 @@ expand_application_parameters (GDesktopAppInfo *info, if (info->exec == NULL) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - _("Desktop file didn't specify Exec field")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, + _("Desktop file didn't specify Exec field")); return FALSE; } @@ -878,8 +878,8 @@ g_desktop_app_info_launch_uris (GAppInfo *appinfo, if (info->terminal && !prepend_terminal_to_vector (&argc, &argv)) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - _("Unable to find terminal required for application")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, + _("Unable to find terminal required for application")); goto out; } diff --git a/gio/gfile.c b/gio/gfile.c index 21e672e..6609e27 100644 --- a/gio/gfile.c +++ b/gio/gfile.c @@ -806,9 +806,9 @@ g_file_enumerate_children (GFile *file, if (iface->enumerate_children == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return NULL; } @@ -1034,9 +1034,9 @@ g_file_query_info (GFile *file, if (iface->query_info == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return NULL; } @@ -1167,9 +1167,9 @@ g_file_query_filesystem_info (GFile *file, if (iface->query_filesystem_info == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return NULL; } @@ -1285,7 +1285,7 @@ g_file_find_enclosing_mount (GFile *file, if (iface->find_enclosing_mount == NULL) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, /* Translators: This is an error message when trying to find the * enclosing (user visible) mount of a file, but none exists. */ _("Containing mount does not exist")); @@ -1398,9 +1398,9 @@ g_file_read (GFile *file, if (iface->read_fn == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return NULL; } @@ -1451,9 +1451,9 @@ g_file_append_to (GFile *file, if (iface->append_to == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return NULL; } @@ -1507,9 +1507,9 @@ g_file_create (GFile *file, if (iface->create == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return NULL; } @@ -1589,9 +1589,9 @@ g_file_replace (GFile *file, if (iface->replace == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return NULL; } @@ -1929,8 +1929,8 @@ copy_symlink (GFile *destination, if (file_type == G_FILE_TYPE_DIRECTORY) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_IS_DIRECTORY, - _("Can't copy over directory")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_IS_DIRECTORY, + _("Can't copy over directory")); return FALSE; } } @@ -1989,16 +1989,16 @@ open_source_for_copy (GFile *source, { if (file_type == G_FILE_TYPE_DIRECTORY) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_MERGE, - _("Can't copy directory over directory")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_WOULD_MERGE, + _("Can't copy directory over directory")); return NULL; } /* continue to would_recurse error */ } else { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_EXISTS, - _("Target file exists")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_EXISTS, + _("Target file exists")); return NULL; } } @@ -2015,8 +2015,8 @@ open_source_for_copy (GFile *source, g_error_free (my_error); } - g_set_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_RECURSE, - _("Can't recursively copy directory")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_WOULD_RECURSE, + _("Can't recursively copy directory")); return NULL; } @@ -2646,9 +2646,9 @@ g_file_move (GFile *source, if (flags & G_FILE_COPY_NO_FALLBACK_FOR_MOVE) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return FALSE; } @@ -2697,9 +2697,9 @@ g_file_make_directory (GFile *file, if (iface->make_directory == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return FALSE; } @@ -2815,9 +2815,9 @@ g_file_make_symbolic_link (GFile *file, if (*symlink_value == '\0') { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_INVALID_ARGUMENT, - _("Invalid symlink value given")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Invalid symlink value given")); return FALSE; } @@ -2825,9 +2825,9 @@ g_file_make_symbolic_link (GFile *file, if (iface->make_symbolic_link == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return FALSE; } @@ -2865,9 +2865,9 @@ g_file_delete (GFile *file, if (iface->delete_file == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return FALSE; } @@ -2908,9 +2908,9 @@ g_file_trash (GFile *file, if (iface->trash == NULL) { - g_set_error (error, - G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Trash not supported")); + g_set_error_literal (error, + G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Trash not supported")); return FALSE; } @@ -3189,9 +3189,9 @@ g_file_set_attribute (GFile *file, if (iface->set_attribute == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return FALSE; } @@ -3837,9 +3837,9 @@ g_file_monitor_directory (GFile *file, if (iface->monitor_dir == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Operation not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported")); return NULL; } @@ -4999,9 +4999,9 @@ g_file_query_default_handler (GFile *file, if (appinfo != NULL) return appinfo; - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("No application is registered as handling this file")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("No application is registered as handling this file")); return NULL; } diff --git a/gio/gfileenumerator.c b/gio/gfileenumerator.c index 4dc51e6..24f5a8d 100644 --- a/gio/gfileenumerator.c +++ b/gio/gfileenumerator.c @@ -198,15 +198,15 @@ g_file_enumerator_next_file (GFileEnumerator *enumerator, if (enumerator->priv->closed) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED, - _("Enumerator is closed")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_CLOSED, + _("Enumerator is closed")); return NULL; } if (enumerator->priv->pending) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_PENDING, - _("File enumerator has outstanding operation")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PENDING, + _("File enumerator has outstanding operation")); return NULL; } @@ -264,8 +264,8 @@ g_file_enumerator_close (GFileEnumerator *enumerator, if (enumerator->priv->pending) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_PENDING, - _("File enumerator has outstanding operation")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PENDING, + _("File enumerator has outstanding operation")); return FALSE; } diff --git a/gio/gfileinputstream.c b/gio/gfileinputstream.c index d38dafe..9f4d0ca 100644 --- a/gio/gfileinputstream.c +++ b/gio/gfileinputstream.c @@ -150,8 +150,8 @@ g_file_input_stream_query_info (GFileInputStream *stream, if (class->query_info) info = class->query_info (stream, attributes, cancellable, error); else - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Stream doesn't support query_info")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Stream doesn't support query_info")); if (cancellable) g_cancellable_pop_current (cancellable); @@ -332,8 +332,8 @@ g_file_input_stream_seek (GFileInputStream *stream, if (!class->seek) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Seek not supported on stream")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Seek not supported on stream")); return FALSE; } @@ -376,8 +376,8 @@ g_file_input_stream_seekable_truncate (GSeekable *seekable, GCancellable *cancellable, GError **error) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Truncate not allowed on input stream")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Truncate not allowed on input stream")); return FALSE; } @@ -417,8 +417,8 @@ query_info_async_thread (GSimpleAsyncResult *res, if (class->query_info) info = class->query_info (G_FILE_INPUT_STREAM (object), data->attributes, cancellable, &error); else - g_set_error (&error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Stream doesn't support query_info")); + g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Stream doesn't support query_info")); if (info == NULL) { diff --git a/gio/gfileoutputstream.c b/gio/gfileoutputstream.c index cae8052..94ab923 100644 --- a/gio/gfileoutputstream.c +++ b/gio/gfileoutputstream.c @@ -164,8 +164,8 @@ g_file_output_stream_query_info (GFileOutputStream *stream, if (class->query_info) info = class->query_info (stream, attributes, cancellable, error); else - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Stream doesn't support query_info")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Stream doesn't support query_info")); if (cancellable) g_cancellable_pop_current (cancellable); @@ -377,8 +377,8 @@ g_file_output_stream_seek (GFileOutputStream *stream, if (!class->seek) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Seek not supported on stream")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Seek not supported on stream")); return FALSE; } @@ -453,8 +453,8 @@ g_file_output_stream_truncate (GFileOutputStream *stream, if (!class->truncate_fn) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Truncate not supported on stream")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Truncate not supported on stream")); return FALSE; } @@ -519,8 +519,8 @@ query_info_async_thread (GSimpleAsyncResult *res, if (class->query_info) info = class->query_info (G_FILE_OUTPUT_STREAM (object), data->attributes, cancellable, &error); else - g_set_error (&error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Stream doesn't support query_info")); + g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Stream doesn't support query_info")); if (info == NULL) { diff --git a/gio/ginputstream.c b/gio/ginputstream.c index 9a4518f..3811614 100644 --- a/gio/ginputstream.c +++ b/gio/ginputstream.c @@ -189,8 +189,8 @@ g_input_stream_read (GInputStream *stream, if (class->read_fn == NULL) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Input stream doesn't implement read")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Input stream doesn't implement read")); return -1; } @@ -888,14 +888,14 @@ g_input_stream_set_pending (GInputStream *stream, GError **error) if (stream->priv->closed) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED, - _("Stream is already closed")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_CLOSED, + _("Stream is already closed")); return FALSE; } if (stream->priv->pending) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_PENDING, + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PENDING, /* Translators: This is an error you get if there is already an * operation running against this stream when you try to start * one */ diff --git a/gio/glocaldirectorymonitor.c b/gio/glocaldirectorymonitor.c index 35c9c1f..03a9d64 100644 --- a/gio/glocaldirectorymonitor.c +++ b/gio/glocaldirectorymonitor.c @@ -266,7 +266,8 @@ _g_local_directory_monitor_new (const char *dirname, if (type != G_TYPE_INVALID) monitor = G_FILE_MONITOR (g_object_new (type, "dirname", dirname, NULL)); else - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Unable to find default local directory monitor type")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, + _("Unable to find default local directory monitor type")); /* This is non-null on first pass here. Unref the class now. * This is to avoid unloading the module and then loading it diff --git a/gio/glocalfile.c b/gio/glocalfile.c index 946ddac..d13b9e9 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -1054,7 +1054,7 @@ g_local_file_find_enclosing_mount (GFile *file, if (g_lstat (local->filename, &buf) != 0) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, /* Translators: This is an error message when trying to * find the enclosing (user visible) mount of a file, but * none exists. */ @@ -1065,7 +1065,7 @@ g_local_file_find_enclosing_mount (GFile *file, mountpoint = find_mountpoint_for (local->filename, buf.st_dev); if (mountpoint == NULL) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, /* Translators: This is an error message when trying to * find the enclosing (user visible) mount of a file, but * none exists. */ @@ -1078,7 +1078,7 @@ g_local_file_find_enclosing_mount (GFile *file, if (mount) return mount; - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, /* Translators: This is an error message when trying to find * the enclosing (user visible) mount of a file, but none * exists. */ @@ -1100,9 +1100,9 @@ g_local_file_set_display_name (GFile *file, parent = g_file_get_parent (file); if (parent == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_FAILED, - _("Can't rename root directory")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Can't rename root directory")); return NULL; } @@ -1118,9 +1118,9 @@ g_local_file_set_display_name (GFile *file, if (!(g_lstat (new_local->filename, &statbuf) == -1 && errno == ENOENT)) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_EXISTS, - _("Can't rename file, filename already exist")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_EXISTS, + _("Can't rename file, filename already exist")); return NULL; } @@ -1131,9 +1131,9 @@ g_local_file_set_display_name (GFile *file, if (errsv == EINVAL) /* We can't get a rename file into itself error herer, so this must be an invalid filename, on e.g. FAT */ - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_INVALID_FILENAME, - _("Invalid filename")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_INVALID_FILENAME, + _("Invalid filename")); else g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv), @@ -1264,9 +1264,9 @@ g_local_file_read (GFile *file, if (fstat(fd, &buf) == 0 && S_ISDIR (buf.st_mode)) { close (fd); - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_IS_DIRECTORY, - _("Can't open directory")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_IS_DIRECTORY, + _("Can't open directory")); return NULL; } @@ -1732,9 +1732,9 @@ g_local_file_trash (GFile *file, topdir = find_topdir_for (local->filename); if (topdir == NULL) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Unable to find toplevel directory for trash")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Unable to find toplevel directory for trash")); return FALSE; } @@ -1811,9 +1811,9 @@ g_local_file_trash (GFile *file, if (trashdir == NULL) { g_free (topdir); - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Unable to find or create trash directory")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Unable to find or create trash directory")); return FALSE; } } @@ -1831,9 +1831,9 @@ g_local_file_trash (GFile *file, g_free (topdir); g_free (infodir); g_free (filesdir); - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Unable to find or create trash directory")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Unable to find or create trash directory")); return FALSE; } @@ -1995,9 +1995,9 @@ g_local_file_make_directory (GFile *file, if (errsv == EINVAL) /* This must be an invalid filename, on e.g. FAT */ - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_INVALID_FILENAME, - _("Invalid filename")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_INVALID_FILENAME, + _("Invalid filename")); else g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv), @@ -2024,9 +2024,9 @@ g_local_file_make_symbolic_link (GFile *file, if (errsv == EINVAL) /* This must be an invalid filename, on e.g. FAT */ - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_INVALID_FILENAME, - _("Invalid filename")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_INVALID_FILENAME, + _("Invalid filename")); else g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv), @@ -2036,7 +2036,7 @@ g_local_file_make_symbolic_link (GFile *file, } return TRUE; #else - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Symlinks not supported"); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Symlinks not supported"); return FALSE; #endif } @@ -2052,7 +2052,7 @@ g_local_file_copy (GFile *source, GError **error) { /* Fall back to default copy */ - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Copy not supported"); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Copy not supported"); return FALSE; } @@ -2076,7 +2076,7 @@ g_local_file_move (GFile *source, !G_IS_LOCAL_FILE (destination)) { /* Fall back to default move */ - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Move not supported"); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Move not supported"); return FALSE; } @@ -2110,24 +2110,24 @@ g_local_file_move (GFile *source, if (S_ISDIR (statbuf.st_mode)) { if (source_is_dir) - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_WOULD_MERGE, - _("Can't move directory over directory")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_WOULD_MERGE, + _("Can't move directory over directory")); else - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_IS_DIRECTORY, - _("Can't copy over directory")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_IS_DIRECTORY, + _("Can't copy over directory")); return FALSE; } } else { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_EXISTS, - _("Target file exists")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_EXISTS, + _("Target file exists")); return FALSE; } } @@ -2137,10 +2137,10 @@ g_local_file_move (GFile *source, backup_name = g_strconcat (local_destination->filename, "~", NULL); if (g_rename (local_destination->filename, backup_name) == -1) { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_CANT_CREATE_BACKUP, - _("Backup file creation failed")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_CANT_CREATE_BACKUP, + _("Backup file creation failed")); g_free (backup_name); return FALSE; } @@ -2171,16 +2171,16 @@ g_local_file_move (GFile *source, if (errsv == EXDEV) /* This will cause the fallback code to run */ - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Move between mounts not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Move between mounts not supported")); else if (errsv == EINVAL) /* This must be an invalid filename, on e.g. FAT, or we're trying to move the file into itself... We return invalid filename for both... */ - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_INVALID_FILENAME, - _("Invalid filename")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_INVALID_FILENAME, + _("Invalid filename")); else g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv), diff --git a/gio/glocalfileenumerator.c b/gio/glocalfileenumerator.c index 48d8990..5afdc10 100644 --- a/gio/glocalfileenumerator.c +++ b/gio/glocalfileenumerator.c @@ -180,9 +180,9 @@ convert_file_to_io_error (GError **error, } } - g_set_error (error, G_IO_ERROR, - new_code, - "%s", file_error->message); + g_set_error_literal (error, G_IO_ERROR, + new_code, + file_error->message); } #endif @@ -223,9 +223,9 @@ _g_local_file_enumerator_new (GLocalFile *file, { errsv = errno; - g_set_error (error, G_IO_ERROR, - g_io_error_from_errno (errsv), - "%s", g_strerror (errsv)); + g_set_error_literal (error, G_IO_ERROR, + g_io_error_from_errno (errsv), + g_strerror (errsv)); g_free (filename); return NULL; } diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c index fb94f81..d71deb1 100644 --- a/gio/glocalfileinfo.c +++ b/gio/glocalfileinfo.c @@ -712,22 +712,22 @@ set_xattr (char *filename, if (attr_value == NULL) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, - _("Attribute value must be non-NULL")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + _("Attribute value must be non-NULL")); return FALSE; } if (attr_value->type != G_FILE_ATTRIBUTE_TYPE_STRING) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, - _("Invalid attribute type (string expected)")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + _("Invalid attribute type (string expected)")); return FALSE; } if (!name_is_valid (escaped_attribute)) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, - _("Invalid extended attribute name")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + _("Invalid extended attribute name")); return FALSE; } @@ -1739,8 +1739,8 @@ get_uint32 (const GFileAttributeValue *value, { if (value->type != G_FILE_ATTRIBUTE_TYPE_UINT32) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, - _("Invalid attribute type (uint32 expected)")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + _("Invalid attribute type (uint32 expected)")); return FALSE; } @@ -1757,8 +1757,8 @@ get_uint64 (const GFileAttributeValue *value, { if (value->type != G_FILE_ATTRIBUTE_TYPE_UINT64) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, - _("Invalid attribute type (uint64 expected)")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + _("Invalid attribute type (uint64 expected)")); return FALSE; } @@ -1776,8 +1776,8 @@ get_byte_string (const GFileAttributeValue *value, { if (value->type != G_FILE_ATTRIBUTE_TYPE_BYTE_STRING) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, - _("Invalid attribute type (byte string expected)")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + _("Invalid attribute type (byte string expected)")); return FALSE; } @@ -1876,8 +1876,8 @@ set_symlink (char *filename, if (val == NULL) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, - _("symlink must be non-NULL")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + _("symlink must be non-NULL")); return FALSE; } @@ -1894,9 +1894,9 @@ set_symlink (char *filename, if (!S_ISLNK (statbuf.st_mode)) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SYMBOLIC_LINK, - _("Error setting symlink: file is not a symlink")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SYMBOLIC_LINK, + _("Error setting symlink: file is not a symlink")); return FALSE; } diff --git a/gio/glocalfilemonitor.c b/gio/glocalfilemonitor.c index 9e1d841..b233b8e 100644 --- a/gio/glocalfilemonitor.c +++ b/gio/glocalfilemonitor.c @@ -193,7 +193,8 @@ _g_local_file_monitor_new (const char *pathname, if (type != G_TYPE_INVALID) monitor = G_FILE_MONITOR (g_object_new (type, "filename", pathname, NULL)); else - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Unable to find default local file monitor type")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, + _("Unable to find default local file monitor type")); /* This is non-null on first pass here. Unref the class now. * This is to avoid unloading the module and then loading it diff --git a/gio/glocalfileoutputstream.c b/gio/glocalfileoutputstream.c index 0cc7d26..d6919da 100644 --- a/gio/glocalfileoutputstream.c +++ b/gio/glocalfileoutputstream.c @@ -466,9 +466,9 @@ _g_local_file_output_stream_create (const char *filename, if (errsv == EINVAL) /* This must be an invalid filename, on e.g. FAT */ - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_INVALID_FILENAME, - _("Invalid filename")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_INVALID_FILENAME, + _("Invalid filename")); else { char *display_name = g_filename_display_name (filename); @@ -511,9 +511,9 @@ _g_local_file_output_stream_append (const char *filename, if (errsv == EINVAL) /* This must be an invalid filename, on e.g. FAT */ - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_INVALID_FILENAME, - _("Invalid filename")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_INVALID_FILENAME, + _("Invalid filename")); else { char *display_name = g_filename_display_name (filename); @@ -672,15 +672,15 @@ handle_overwrite_open (const char *filename, if (!S_ISREG (original_stat.st_mode)) { if (S_ISDIR (original_stat.st_mode)) - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_IS_DIRECTORY, - _("Target file is a directory")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_IS_DIRECTORY, + _("Target file is a directory")); else - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_NOT_REGULAR_FILE, - _("Target file is not a regular file")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_NOT_REGULAR_FILE, + _("Target file is not a regular file")); goto err_out; } @@ -689,10 +689,10 @@ handle_overwrite_open (const char *filename, current_etag = _g_local_file_info_create_etag (&original_stat); if (strcmp (etag, current_etag) != 0) { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_WRONG_ETAG, - _("The file was externally modified")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_WRONG_ETAG, + _("The file was externally modified")); g_free (current_etag); goto err_out; } @@ -770,10 +770,10 @@ handle_overwrite_open (const char *filename, if (g_unlink (backup_filename) == -1 && errno != ENOENT) { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_CANT_CREATE_BACKUP, - _("Backup file creation failed")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_CANT_CREATE_BACKUP, + _("Backup file creation failed")); g_free (backup_filename); goto err_out; } @@ -784,10 +784,10 @@ handle_overwrite_open (const char *filename, if (bfd == -1) { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_CANT_CREATE_BACKUP, - _("Backup file creation failed")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_CANT_CREATE_BACKUP, + _("Backup file creation failed")); g_free (backup_filename); goto err_out; } @@ -799,10 +799,10 @@ handle_overwrite_open (const char *filename, #if defined(HAVE_FCHOWN) && defined(HAVE_FCHMOD) if (fstat (bfd, &tmp_statbuf) != 0) { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_CANT_CREATE_BACKUP, - _("Backup file creation failed")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_CANT_CREATE_BACKUP, + _("Backup file creation failed")); g_unlink (backup_filename); g_free (backup_filename); goto err_out; @@ -815,10 +815,10 @@ handle_overwrite_open (const char *filename, (original_stat.st_mode & 0707) | ((original_stat.st_mode & 07) << 3)) != 0) { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_CANT_CREATE_BACKUP, - _("Backup file creation failed")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_CANT_CREATE_BACKUP, + _("Backup file creation failed")); g_unlink (backup_filename); close (bfd); g_free (backup_filename); @@ -829,10 +829,10 @@ handle_overwrite_open (const char *filename, if (!copy_file_data (fd, bfd, NULL)) { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_CANT_CREATE_BACKUP, - _("Backup file creation failed")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_CANT_CREATE_BACKUP, + _("Backup file creation failed")); g_unlink (backup_filename); close (bfd); g_free (backup_filename); @@ -919,9 +919,9 @@ _g_local_file_output_stream_replace (const char *filename, if (errsv == EINVAL) /* This must be an invalid filename, on e.g. FAT */ - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_INVALID_FILENAME, - _("Invalid filename")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_INVALID_FILENAME, + _("Invalid filename")); else { char *display_name = g_filename_display_name (filename); diff --git a/gio/gmemoryinputstream.c b/gio/gmemoryinputstream.c index 3121db6..b39f4a7 100644 --- a/gio/gmemoryinputstream.c +++ b/gio/gmemoryinputstream.c @@ -480,20 +480,20 @@ g_memory_input_stream_seek (GSeekable *seekable, break; default: - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_INVALID_ARGUMENT, - _("Invalid GSeekType supplied")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Invalid GSeekType supplied")); return FALSE; } if (absolute < 0 || absolute > priv->len) { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_INVALID_ARGUMENT, - _("Invalid seek request")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Invalid seek request")); return FALSE; } @@ -514,10 +514,10 @@ g_memory_input_stream_truncate (GSeekable *seekable, GCancellable *cancellable, GError **error) { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Cannot truncate GMemoryInputStream")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Cannot truncate GMemoryInputStream")); return FALSE; } diff --git a/gio/gmemoryoutputstream.c b/gio/gmemoryoutputstream.c index ca3d186..e383546 100644 --- a/gio/gmemoryoutputstream.c +++ b/gio/gmemoryoutputstream.c @@ -281,10 +281,10 @@ array_check_boundary (GMemoryOutputStream *stream, { if (size > G_MAXUINT) { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - _("Reached maximum data array limit")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + _("Reached maximum data array limit")); return FALSE; } @@ -316,10 +316,10 @@ array_resize (GMemoryOutputStream *ostream, priv->pos < priv->len) return TRUE; /* Short write */ - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_NO_SPACE, - _("Memory output stream not resizable")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_NO_SPACE, + _("Memory output stream not resizable")); return FALSE; } @@ -332,10 +332,10 @@ array_resize (GMemoryOutputStream *ostream, priv->pos < priv->len) return TRUE; /* Short write */ - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_NO_SPACE, - _("Failed to resize memory output stream")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_NO_SPACE, + _("Failed to resize memory output stream")); return FALSE; } @@ -538,20 +538,20 @@ g_memory_output_stream_seek (GSeekable *seekable, break; default: - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_INVALID_ARGUMENT, - _("Invalid GSeekType supplied")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Invalid GSeekType supplied")); return FALSE; } if (absolute < 0) { - g_set_error (error, - G_IO_ERROR, - G_IO_ERROR_INVALID_ARGUMENT, - _("Invalid seek request")); + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Invalid seek request")); return FALSE; } diff --git a/gio/goutputstream.c b/gio/goutputstream.c index 051c0e8..b68593a 100644 --- a/gio/goutputstream.c +++ b/gio/goutputstream.c @@ -196,8 +196,8 @@ g_output_stream_write (GOutputStream *stream, if (class->write_fn == NULL) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Output stream doesn't implement write")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Output stream doesn't implement write")); return -1; } @@ -357,8 +357,8 @@ g_output_stream_splice (GOutputStream *stream, if (g_input_stream_is_closed (source)) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED, - _("Source stream is already closed")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_CLOSED, + _("Source stream is already closed")); return -1; } @@ -397,8 +397,8 @@ g_output_stream_real_splice (GOutputStream *stream, bytes_copied = 0; if (class->write_fn == NULL) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - _("Output stream doesn't implement write")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Output stream doesn't implement write")); res = FALSE; goto notsupported; } @@ -1070,18 +1070,18 @@ g_output_stream_set_pending (GOutputStream *stream, if (stream->priv->closed) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED, - _("Stream is already closed")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_CLOSED, + _("Stream is already closed")); return FALSE; } if (stream->priv->pending) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_PENDING, - /* Translators: This is an error you get if there is - * already an operation running against this stream when - * you try to start one */ - _("Stream has outstanding operation")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PENDING, + /* Translators: This is an error you get if there is + * already an operation running against this stream when + * you try to start one */ + _("Stream has outstanding operation")); return FALSE; } diff --git a/gio/gwin32appinfo.c b/gio/gwin32appinfo.c index a01022f..0a244bf 100644 --- a/gio/gwin32appinfo.c +++ b/gio/gwin32appinfo.c @@ -273,7 +273,7 @@ g_win32_app_info_launch (GAppInfo *appinfo, NULL, &class_key) != S_OK) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Can't find application")); + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Can't find application")); return FALSE; } #endif @@ -343,9 +343,9 @@ g_win32_app_info_launch_uris (GAppInfo *appinfo, GAppLaunchContext *launch_context, GError **error) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("URIs not supported")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("URIs not supported")); return FALSE; } @@ -365,9 +365,9 @@ g_win32_app_info_set_as_default_for_type (GAppInfo *appinfo, const char *content_type, GError **error) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("association changes not supported on win32")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("association changes not supported on win32")); return FALSE; } @@ -377,9 +377,9 @@ g_app_info_create_from_commandline (const char *commandline, GAppInfoCreateFlags flags, GError **error) { - g_set_error (error, G_IO_ERROR, - G_IO_ERROR_NOT_SUPPORTED, - _("Association creation not supported on win32")); + g_set_error_literal (error, G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + _("Association creation not supported on win32")); return NULL; } diff --git a/glib/gbookmarkfile.c b/glib/gbookmarkfile.c index 7c34312..cd5fce8 100644 --- a/glib/gbookmarkfile.c +++ b/glib/gbookmarkfile.c @@ -1793,9 +1793,9 @@ find_file_in_data_dirs (const gchar *file, if (!path) { - g_set_error (error, G_BOOKMARK_FILE_ERROR, - G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND, - _("No valid bookmark file found in data dirs")); + g_set_error_literal (error, G_BOOKMARK_FILE_ERROR, + G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND, + _("No valid bookmark file found in data dirs")); return NULL; } diff --git a/glib/gconvert.c b/glib/gconvert.c index 8ba4801..3d70654 100644 --- a/glib/gconvert.c +++ b/glib/gconvert.c @@ -628,8 +628,8 @@ g_convert_with_iconv (const gchar *str, break; case EILSEQ: if (error) - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Invalid byte sequence in conversion input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Invalid byte sequence in conversion input")); have_error = TRUE; break; default: @@ -665,8 +665,8 @@ g_convert_with_iconv (const gchar *str, if (!have_error) { if (error) - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, - _("Partial character sequence at end of input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, + _("Partial character sequence at end of input")); have_error = TRUE; } } @@ -1013,8 +1013,8 @@ strdup_len (const gchar *string, if (bytes_written) *bytes_written = 0; - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Invalid byte sequence in conversion input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Invalid byte sequence in conversion input")); return NULL; } @@ -1890,8 +1890,8 @@ g_filename_to_uri (const gchar *filename, !(g_utf8_validate (hostname, -1, NULL) && hostname_validate (hostname))) { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Invalid hostname")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Invalid hostname")); return NULL; } diff --git a/glib/gfileutils.c b/glib/gfileutils.c index 000e980..b91760b 100644 --- a/glib/gfileutils.c +++ b/glib/gfileutils.c @@ -1902,10 +1902,10 @@ g_file_read_link (const gchar *filename, buffer = g_realloc (buffer, size); } #else - g_set_error (error, - G_FILE_ERROR, - G_FILE_ERROR_INVAL, - _("Symbolic links not supported")); + g_set_error_literal (error, + G_FILE_ERROR, + G_FILE_ERROR_INVAL, + _("Symbolic links not supported")); return NULL; #endif diff --git a/glib/giochannel.c b/glib/giochannel.c index 3ef94e4..5ce9df0 100644 --- a/glib/giochannel.c +++ b/glib/giochannel.c @@ -1325,7 +1325,7 @@ reencode: status = G_IO_STATUS_NORMAL; else { - g_set_error (err, G_CONVERT_ERROR, + g_set_error_literal (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, _("Invalid byte sequence in conversion input")); return G_IO_STATUS_ERROR; @@ -1367,7 +1367,7 @@ reencode: status = G_IO_STATUS_NORMAL; else { - g_set_error (err, G_CONVERT_ERROR, + g_set_error_literal (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, _("Invalid byte sequence in conversion input")); status = G_IO_STATUS_ERROR; @@ -1503,8 +1503,8 @@ g_io_channel_read_line_backend (GIOChannel *channel, if (!channel->use_buffer) { /* Can't do a raw read in read_line */ - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, - _("Can't do a raw read in g_io_channel_read_line_string")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, + _("Can't do a raw read in g_io_channel_read_line_string")); return G_IO_STATUS_ERROR; } @@ -1549,9 +1549,10 @@ read_again: if (channel->encoding && channel->read_buf->len != 0) { - g_set_error (error, G_CONVERT_ERROR, - G_CONVERT_ERROR_PARTIAL_INPUT, - _("Leftover unconverted data in read buffer")); + g_set_error_literal (error, G_CONVERT_ERROR, + G_CONVERT_ERROR_PARTIAL_INPUT, + _("Leftover unconverted data in " + "read buffer")); return G_IO_STATUS_ERROR; } else @@ -1630,8 +1631,8 @@ read_again: { if (channel->encoding && channel->read_buf->len > 0) { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, - _("Channel terminates in a partial character")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, + _("Channel terminates in a partial character")); return G_IO_STATUS_ERROR; } line_length = use_buf->len; @@ -1693,8 +1694,8 @@ g_io_channel_read_to_end (GIOChannel *channel, if (!channel->use_buffer) { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, - _("Can't do a raw read in g_io_channel_read_to_end")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, + _("Can't do a raw read in g_io_channel_read_to_end")); return G_IO_STATUS_ERROR; } @@ -1707,8 +1708,8 @@ g_io_channel_read_to_end (GIOChannel *channel, if (channel->encoding && channel->read_buf->len > 0) { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, - _("Channel terminates in a partial character")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, + _("Channel terminates in a partial character")); return G_IO_STATUS_ERROR; } @@ -1806,9 +1807,9 @@ g_io_channel_read_chars (GIOChannel *channel, if (status == G_IO_STATUS_EOF && channel->encoding && BUF_LEN (channel->read_buf) > 0) { - g_set_error (error, G_CONVERT_ERROR, - G_CONVERT_ERROR_PARTIAL_INPUT, - _("Leftover unconverted data in read buffer")); + g_set_error_literal (error, G_CONVERT_ERROR, + G_CONVERT_ERROR_PARTIAL_INPUT, + _("Leftover unconverted data in read buffer")); status = G_IO_STATUS_ERROR; } @@ -1893,9 +1894,9 @@ g_io_channel_read_unichar (GIOChannel *channel, if (status == G_IO_STATUS_EOF && BUF_LEN (channel->read_buf) > 0) { - g_set_error (error, G_CONVERT_ERROR, - G_CONVERT_ERROR_PARTIAL_INPUT, - _("Leftover unconverted data in read buffer")); + g_set_error_literal (error, G_CONVERT_ERROR, + G_CONVERT_ERROR_PARTIAL_INPUT, + _("Leftover unconverted data in read buffer")); status = G_IO_STATUS_ERROR; } @@ -2210,7 +2211,7 @@ reconvert: } break; case EILSEQ: - g_set_error (error, G_CONVERT_ERROR, + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, _("Invalid byte sequence in conversion input")); if (from_buf_old_len > 0 && from_buf_len == left_len) diff --git a/glib/giounix.c b/glib/giounix.c index d2a7b34..e7449b8 100644 --- a/glib/giounix.c +++ b/glib/giounix.c @@ -203,9 +203,9 @@ g_io_unix_read (GIOChannel *channel, return G_IO_STATUS_AGAIN; #endif default: - g_set_error (err, G_IO_CHANNEL_ERROR, - g_io_channel_error_from_errno (errno), - g_strerror (errno)); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + g_io_channel_error_from_errno (errno), + g_strerror (errno)); return G_IO_STATUS_ERROR; } } @@ -243,9 +243,9 @@ g_io_unix_write (GIOChannel *channel, return G_IO_STATUS_AGAIN; #endif default: - g_set_error (err, G_IO_CHANNEL_ERROR, - g_io_channel_error_from_errno (errno), - g_strerror (errno)); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + g_io_channel_error_from_errno (errno), + g_strerror (errno)); return G_IO_STATUS_ERROR; } } @@ -285,9 +285,9 @@ g_io_unix_seek (GIOChannel *channel, tmp_offset = offset; if (tmp_offset != offset) { - g_set_error (err, G_IO_CHANNEL_ERROR, - g_io_channel_error_from_errno (EINVAL), - g_strerror (EINVAL)); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + g_io_channel_error_from_errno (EINVAL), + g_strerror (EINVAL)); return G_IO_STATUS_ERROR; } @@ -295,9 +295,9 @@ g_io_unix_seek (GIOChannel *channel, if (result < 0) { - g_set_error (err, G_IO_CHANNEL_ERROR, - g_io_channel_error_from_errno (errno), - g_strerror (errno)); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + g_io_channel_error_from_errno (errno), + g_strerror (errno)); return G_IO_STATUS_ERROR; } @@ -313,9 +313,9 @@ g_io_unix_close (GIOChannel *channel, if (close (unix_channel->fd) < 0) { - g_set_error (err, G_IO_CHANNEL_ERROR, - g_io_channel_error_from_errno (errno), - g_strerror (errno)); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + g_io_channel_error_from_errno (errno), + g_strerror (errno)); return G_IO_STATUS_ERROR; } @@ -376,9 +376,9 @@ g_io_unix_set_flags (GIOChannel *channel, if (fcntl (unix_channel->fd, F_SETFL, fcntl_flags) == -1) { - g_set_error (err, G_IO_CHANNEL_ERROR, - g_io_channel_error_from_errno (errno), - g_strerror (errno)); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + g_io_channel_error_from_errno (errno), + g_strerror (errno)); return G_IO_STATUS_ERROR; } @@ -512,18 +512,18 @@ g_io_channel_new_file (const gchar *filename, fid = open (filename, flags, create_mode); if (fid == -1) { - g_set_error (error, G_FILE_ERROR, - g_file_error_from_errno (errno), - g_strerror (errno)); + g_set_error_literal (error, G_FILE_ERROR, + g_file_error_from_errno (errno), + g_strerror (errno)); return (GIOChannel *)NULL; } if (fstat (fid, &buffer) == -1) /* In case someone opens a FIFO */ { close (fid); - g_set_error (error, G_FILE_ERROR, - g_file_error_from_errno (errno), - g_strerror (errno)); + g_set_error_literal (error, G_FILE_ERROR, + g_file_error_from_errno (errno), + g_strerror (errno)); return (GIOChannel *)NULL; } diff --git a/glib/giowin32.c b/glib/giowin32.c index b702fe8..eef439b 100644 --- a/glib/giowin32.c +++ b/glib/giowin32.c @@ -975,8 +975,8 @@ g_io_win32_msg_read (GIOChannel *channel, if (count < sizeof (MSG)) { - g_set_error (err, G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_INVAL, - "Incorrect message size"); /* Informative enough error message? */ + g_set_error_literal (err, G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_INVAL, + "Incorrect message size"); /* Informative enough error message? */ return G_IO_STATUS_ERROR; } @@ -1004,8 +1004,8 @@ g_io_win32_msg_write (GIOChannel *channel, if (count != sizeof (MSG)) { - g_set_error (err, G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_INVAL, - "Incorrect message size"); /* Informative enough error message? */ + g_set_error_literal (err, G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_INVAL, + "Incorrect message size"); /* Informative enough error message? */ return G_IO_STATUS_ERROR; } @@ -1014,7 +1014,7 @@ g_io_win32_msg_write (GIOChannel *channel, if (!PostMessage (win32_channel->hwnd, msg.message, msg.wParam, msg.lParam)) { gchar *emsg = g_win32_error_message (GetLastError ()); - g_set_error (err, G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_FAILED, emsg); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_FAILED, emsg); g_free (emsg); return G_IO_STATUS_ERROR; } @@ -1111,9 +1111,9 @@ g_io_win32_fd_and_console_read (GIOChannel *channel, return G_IO_STATUS_AGAIN; #endif default: - g_set_error (err, G_IO_CHANNEL_ERROR, - g_io_channel_error_from_errno (errno), - g_strerror (errno)); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + g_io_channel_error_from_errno (errno), + g_strerror (errno)); return G_IO_STATUS_ERROR; } } @@ -1154,9 +1154,9 @@ g_io_win32_fd_and_console_write (GIOChannel *channel, return G_IO_STATUS_AGAIN; #endif default: - g_set_error (err, G_IO_CHANNEL_ERROR, - g_io_channel_error_from_errno (errno), - g_strerror (errno)); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + g_io_channel_error_from_errno (errno), + g_strerror (errno)); return G_IO_STATUS_ERROR; } } @@ -1197,9 +1197,9 @@ g_io_win32_fd_seek (GIOChannel *channel, tmp_offset = offset; if (tmp_offset != offset) { - g_set_error (err, G_IO_CHANNEL_ERROR, - g_io_channel_error_from_errno (EINVAL), - g_strerror (EINVAL)); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + g_io_channel_error_from_errno (EINVAL), + g_strerror (EINVAL)); return G_IO_STATUS_ERROR; } @@ -1207,9 +1207,9 @@ g_io_win32_fd_seek (GIOChannel *channel, if (result < 0) { - g_set_error (err, G_IO_CHANNEL_ERROR, - g_io_channel_error_from_errno (errno), - g_strerror (errno)); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + g_io_channel_error_from_errno (errno), + g_strerror (errno)); return G_IO_STATUS_ERROR; } @@ -1303,9 +1303,9 @@ g_io_win32_console_close (GIOChannel *channel, if (close (win32_channel->fd) < 0) { - g_set_error (err, G_IO_CHANNEL_ERROR, - g_io_channel_error_from_errno (errno), - g_strerror (errno)); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + g_io_channel_error_from_errno (errno), + g_strerror (errno)); return G_IO_STATUS_ERROR; } @@ -1377,7 +1377,7 @@ g_io_win32_sock_read (GIOChannel *channel, error = G_IO_CHANNEL_ERROR_FAILED; break; } - g_set_error (err, G_IO_CHANNEL_ERROR, error, emsg); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, error, emsg); g_free (emsg); return G_IO_STATUS_ERROR; @@ -1440,7 +1440,7 @@ g_io_win32_sock_write (GIOChannel *channel, error = G_IO_CHANNEL_ERROR_FAILED; break; } - g_set_error (err, G_IO_CHANNEL_ERROR, error, emsg); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, error, emsg); g_free (emsg); return G_IO_STATUS_ERROR; @@ -1600,9 +1600,9 @@ g_io_channel_new_file (const gchar *filename, if (fid < 0) { - g_set_error (error, G_FILE_ERROR, - g_file_error_from_errno (errno), - g_strerror (errno)); + g_set_error_literal (error, G_FILE_ERROR, + g_file_error_from_errno (errno), + g_strerror (errno)); return (GIOChannel *)NULL; } @@ -1677,9 +1677,9 @@ g_io_win32_unimpl_set_flags (GIOChannel *channel, g_print ("\n"); } - g_set_error (err, G_IO_CHANNEL_ERROR, - G_IO_CHANNEL_ERROR_FAILED, - "Not implemented on Win32"); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + G_IO_CHANNEL_ERROR_FAILED, + "Not implemented on Win32"); return G_IO_STATUS_ERROR; } @@ -1785,9 +1785,9 @@ g_io_win32_sock_set_flags (GIOChannel *channel, { gchar *emsg = g_win32_error_message (WSAGetLastError ()); - g_set_error (err, G_IO_CHANNEL_ERROR, - G_IO_CHANNEL_ERROR_FAILED, - emsg); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + G_IO_CHANNEL_ERROR_FAILED, + emsg); g_free (emsg); return G_IO_STATUS_ERROR; @@ -1800,9 +1800,9 @@ g_io_win32_sock_set_flags (GIOChannel *channel, { gchar *emsg = g_win32_error_message (WSAGetLastError ()); - g_set_error (err, G_IO_CHANNEL_ERROR, - G_IO_CHANNEL_ERROR_FAILED, - emsg); + g_set_error_literal (err, G_IO_CHANNEL_ERROR, + G_IO_CHANNEL_ERROR_FAILED, + emsg); g_free (emsg); return G_IO_STATUS_ERROR; diff --git a/glib/gkeyfile.c b/glib/gkeyfile.c index 4246f51..0258df2 100644 --- a/glib/gkeyfile.c +++ b/glib/gkeyfile.c @@ -353,10 +353,10 @@ find_file_in_data_dirs (const gchar *file, if (fd < 0) { - g_set_error (error, G_KEY_FILE_ERROR, - G_KEY_FILE_ERROR_NOT_FOUND, - _("Valid key file could not be " - "found in search dirs")); + g_set_error_literal (error, G_KEY_FILE_ERROR, + G_KEY_FILE_ERROR_NOT_FOUND, + _("Valid key file could not be " + "found in search dirs")); } if (output_file != NULL && fd > 0) @@ -380,25 +380,25 @@ g_key_file_load_from_fd (GKeyFile *key_file, if (fstat (fd, &stat_buf) < 0) { - g_set_error (error, G_FILE_ERROR, - g_file_error_from_errno (errno), - "%s", g_strerror (errno)); + g_set_error_literal (error, G_FILE_ERROR, + g_file_error_from_errno (errno), + g_strerror (errno)); return FALSE; } if (!S_ISREG (stat_buf.st_mode)) { - g_set_error (error, G_KEY_FILE_ERROR, - G_KEY_FILE_ERROR_PARSE, - _("Not a regular file")); + g_set_error_literal (error, G_KEY_FILE_ERROR, + G_KEY_FILE_ERROR_PARSE, + _("Not a regular file")); return FALSE; } if (stat_buf.st_size == 0) { - g_set_error (error, G_KEY_FILE_ERROR, - G_KEY_FILE_ERROR_PARSE, - _("File is empty")); + g_set_error_literal (error, G_KEY_FILE_ERROR, + G_KEY_FILE_ERROR_PARSE, + _("File is empty")); return FALSE; } @@ -422,9 +422,9 @@ g_key_file_load_from_fd (GKeyFile *key_file, if (errno == EINTR || errno == EAGAIN) continue; - g_set_error (error, G_FILE_ERROR, - g_file_error_from_errno (errno), - "%s", g_strerror (errno)); + g_set_error_literal (error, G_FILE_ERROR, + g_file_error_from_errno (errno), + g_strerror (errno)); return FALSE; } @@ -482,9 +482,9 @@ g_key_file_load_from_file (GKeyFile *key_file, if (fd < 0) { - g_set_error (error, G_FILE_ERROR, - g_file_error_from_errno (errno), - "%s", g_strerror (errno)); + g_set_error_literal (error, G_FILE_ERROR, + g_file_error_from_errno (errno), + g_strerror (errno)); return FALSE; } @@ -838,9 +838,9 @@ g_key_file_parse_key_value_pair (GKeyFile *key_file, if (key_file->current_group == NULL || key_file->current_group->name == NULL) { - g_set_error (error, G_KEY_FILE_ERROR, - G_KEY_FILE_ERROR_GROUP_NOT_FOUND, - _("Key file does not start with a group")); + g_set_error_literal (error, G_KEY_FILE_ERROR, + G_KEY_FILE_ERROR_GROUP_NOT_FOUND, + _("Key file does not start with a group")); return; } @@ -3469,10 +3469,10 @@ g_key_file_parse_value_as_string (GKeyFile *key_file, break; case '\0': - g_set_error (error, G_KEY_FILE_ERROR, - G_KEY_FILE_ERROR_INVALID_VALUE, - _("Key file contains escape character " - "at end of line")); + g_set_error_literal (error, G_KEY_FILE_ERROR, + G_KEY_FILE_ERROR_INVALID_VALUE, + _("Key file contains escape character " + "at end of line")); break; default: diff --git a/glib/gregex.c b/glib/gregex.c index 8d43875..f4a1cbe 100644 --- a/glib/gregex.c +++ b/glib/gregex.c @@ -1097,7 +1097,7 @@ g_regex_new (const gchar *pattern, { msg = N_("PCRE library is compiled without UTF8 support"); g_critical (msg); - g_set_error (error, G_REGEX_ERROR, G_REGEX_ERROR_COMPILE, gettext (msg)); + g_set_error_literal (error, G_REGEX_ERROR, G_REGEX_ERROR_COMPILE, gettext (msg)); return NULL; } @@ -1106,7 +1106,7 @@ g_regex_new (const gchar *pattern, { msg = N_("PCRE library is compiled without UTF8 properties support"); g_critical (msg); - g_set_error (error, G_REGEX_ERROR, G_REGEX_ERROR_COMPILE, gettext (msg)); + g_set_error_literal (error, G_REGEX_ERROR, G_REGEX_ERROR_COMPILE, gettext (msg)); return NULL; } diff --git a/glib/gshell.c b/glib/gshell.c index 3bb434e..2ad21db 100644 --- a/glib/gshell.c +++ b/glib/gshell.c @@ -551,10 +551,10 @@ tokenize_command_line (const gchar *command_line, if (retval == NULL) { - g_set_error (error, - G_SHELL_ERROR, - G_SHELL_ERROR_EMPTY_STRING, - _("Text was empty (or contained only whitespace)")); + g_set_error_literal (error, + G_SHELL_ERROR, + G_SHELL_ERROR_EMPTY_STRING, + _("Text was empty (or contained only whitespace)")); goto error; } diff --git a/glib/gspawn-win32.c b/glib/gspawn-win32.c index 587bcda..a242a3b 100644 --- a/glib/gspawn-win32.c +++ b/glib/gspawn-win32.c @@ -275,8 +275,8 @@ read_data (GString *str, goto again; else if (giostatus == G_IO_STATUS_ERROR) { - g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_READ, - _("Failed to read data from child process")); + g_set_error_literal (error, G_SPAWN_ERROR, G_SPAWN_ERROR_READ, + _("Failed to read data from child process")); return READ_FAILED; } @@ -998,8 +998,8 @@ g_spawn_sync_utf8 (const gchar *working_directory, { failed = TRUE; - g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_READ, - _("Unexpected error in g_io_channel_win32_poll() reading data from a child process")); + g_set_error_literal (error, G_SPAWN_ERROR, G_SPAWN_ERROR_READ, + _("Unexpected error in g_io_channel_win32_poll() reading data from a child process")); break; } diff --git a/glib/gutf8.c b/glib/gutf8.c index 9e0d955..3873eec 100644 --- a/glib/gutf8.c +++ b/glib/gutf8.c @@ -948,12 +948,12 @@ g_utf8_to_ucs4 (const gchar *str, if (items_read) break; else - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, - _("Partial character sequence at end of input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, + _("Partial character sequence at end of input")); } else - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Invalid byte sequence in conversion input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Invalid byte sequence in conversion input")); goto err_out; } @@ -1026,8 +1026,8 @@ g_ucs4_to_utf8 (const gunichar *str, if (str[i] >= 0x80000000) { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Character out of range for UTF-8")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Character out of range for UTF-8")); goto err_out; } @@ -1120,8 +1120,8 @@ g_utf16_to_utf8 (const gunichar2 *str, } else { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Invalid sequence in conversion input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Invalid sequence in conversion input")); goto err_out; } } @@ -1129,8 +1129,8 @@ g_utf16_to_utf8 (const gunichar2 *str, { if (high_surrogate) { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Invalid sequence in conversion input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Invalid sequence in conversion input")); goto err_out; } @@ -1152,8 +1152,8 @@ g_utf16_to_utf8 (const gunichar2 *str, if (high_surrogate && !items_read) { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, - _("Partial character sequence at end of input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, + _("Partial character sequence at end of input")); goto err_out; } @@ -1261,8 +1261,8 @@ g_utf16_to_ucs4 (const gunichar2 *str, } else { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Invalid sequence in conversion input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Invalid sequence in conversion input")); goto err_out; } } @@ -1270,8 +1270,8 @@ g_utf16_to_ucs4 (const gunichar2 *str, { if (high_surrogate) { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Invalid sequence in conversion input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Invalid sequence in conversion input")); goto err_out; } @@ -1293,8 +1293,8 @@ g_utf16_to_ucs4 (const gunichar2 *str, if (high_surrogate && !items_read) { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, - _("Partial character sequence at end of input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, + _("Partial character sequence at end of input")); goto err_out; } @@ -1397,12 +1397,12 @@ g_utf8_to_utf16 (const gchar *str, if (items_read) break; else - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, - _("Partial character sequence at end of input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, + _("Partial character sequence at end of input")); } else - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Invalid byte sequence in conversion input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Invalid byte sequence in conversion input")); goto err_out; } @@ -1411,8 +1411,8 @@ g_utf8_to_utf16 (const gchar *str, n16 += 1; else if (wc < 0xe000) { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Invalid sequence in conversion input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Invalid sequence in conversion input")); goto err_out; } @@ -1422,8 +1422,8 @@ g_utf8_to_utf16 (const gchar *str, n16 += 2; else { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Character out of range for UTF-16")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Character out of range for UTF-16")); goto err_out; } @@ -1507,8 +1507,8 @@ g_ucs4_to_utf16 (const gunichar *str, n16 += 1; else if (wc < 0xe000) { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Invalid sequence in conversion input")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Invalid sequence in conversion input")); goto err_out; } @@ -1518,8 +1518,8 @@ g_ucs4_to_utf16 (const gunichar *str, n16 += 2; else { - g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - _("Character out of range for UTF-16")); + g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + _("Character out of range for UTF-16")); goto err_out; }