diff --git a/glib/gerror.c b/glib/gerror.c index d978a93af..5093876ff 100644 --- a/glib/gerror.c +++ b/glib/gerror.c @@ -242,108 +242,86 @@ * handle them by doing nothing. * * Error domains and codes are conventionally named as follows: - * - * - * The error domain is called - * <NAMESPACE>_<MODULE>_ERROR, + * + * - The error domain is called <NAMESPACE>_<MODULE>_ERROR, * for example %G_SPAWN_ERROR or %G_THREAD_ERROR: * |[ - * #define G_SPAWN_ERROR g_spawn_error_quark () + * #define G_SPAWN_ERROR g_spawn_error_quark () * - * GQuark - * g_spawn_error_quark (void) - * { - * return g_quark_from_static_string ("g-spawn-error-quark"); - * } + * GQuark + * g_spawn_error_quark (void) + * { + * return g_quark_from_static_string ("g-spawn-error-quark"); + * } * ]| - * - * - * The quark function for the error domain is called - * <namespace>_<module>_error_quark, + * + * - The quark function for the error domain is called + * <namespace>_<module>_error_quark, * for example g_spawn_error_quark() or g_thread_error_quark(). - * - * - * The error codes are in an enumeration called - * <Namespace><Module>Error; + * + * - The error codes are in an enumeration called + * <Namespace><Module>Error; * for example,#GThreadError or #GSpawnError. - * - * - * Members of the error code enumeration are called - * <NAMESPACE>_<MODULE>_ERROR_<CODE>, + * + * - Members of the error code enumeration are called + * <NAMESPACE>_<MODULE>_ERROR_<CODE>, * for example %G_SPAWN_ERROR_FORK or %G_THREAD_ERROR_AGAIN. - * - * - * If there's a "generic" or "unknown" error code for unrecoverable + * + * - If there's a "generic" or "unknown" error code for unrecoverable * errors it doesn't make sense to distinguish with specific codes, - * it should be called <NAMESPACE>_<MODULE>_ERROR_FAILED, + * it should be called <NAMESPACE>_<MODULE>_ERROR_FAILED, * for example %G_SPAWN_ERROR_FAILED. - * - * * * Summary of rules for use of #GError: - * - * - * Do not report programming errors via #GError. - * - * - * The last argument of a function that returns an error should + * + * - Do not report programming errors via #GError. + * + * - The last argument of a function that returns an error should * be a location where a #GError can be placed (i.e. "#GError** error"). * If #GError is used with varargs, the #GError** should be the last * argument before the "...". - * - * - * The caller may pass %NULL for the #GError** if they are not interested + * + * - The caller may pass %NULL for the #GError** if they are not interested * in details of the exact error that occurred. - * - * - * If %NULL is passed for the #GError** argument, then errors should + * + * - If %NULL is passed for the #GError** argument, then errors should * not be returned to the caller, but your function should still * abort and return if an error occurs. That is, control flow should * not be affected by whether the caller wants to get a #GError. - * - * - * If a #GError is reported, then your function by definition had a + * + * - If a #GError is reported, then your function by definition had a * fatal failure and did not complete whatever it was supposed to do. * If the failure was not fatal, then you handled it and you should not * report it. If it was fatal, then you must report it and discontinue * whatever you were doing immediately. - * - * - * If a #GError is reported, out parameters are not guaranteed to + * + * - If a #GError is reported, out parameters are not guaranteed to * be set to any defined value. - * - * - * A #GError* must be initialized to %NULL before passing its address + * + * - A #GError* must be initialized to %NULL before passing its address * to a function that can report errors. - * - * - * "Piling up" errors is always a bug. That is, if you assign a + * + * - "Piling up" errors is always a bug. That is, if you assign a * new #GError to a #GError* that is non-%NULL, thus overwriting * the previous error, it indicates that you should have aborted * the operation instead of continuing. If you were able to continue, * you should have cleared the previous error with g_clear_error(). * g_set_error() will complain if you pile up errors. - * - * - * By convention, if you return a boolean value indicating success + * + * - By convention, if you return a boolean value indicating success * then %TRUE means success and %FALSE means failure. If %FALSE is - * returned, the error must be set to a non-%NULL - * value. - * - * - * A %NULL return value is also frequently used to mean that an error + * returned, the error must be set to a non-%NULL value. + * + * - A %NULL return value is also frequently used to mean that an error * occurred. You should make clear in your documentation whether %NULL * is a valid return value in non-error cases; if %NULL is a valid value, * then users must check whether an error was returned to see if the * function succeeded. - * - * - * When implementing a function that can report errors, you may want + * + * - When implementing a function that can report errors, you may want * to add a check at the top of your function that the error return * location is either %NULL or contains a %NULL error (e.g. * g_return_if_fail (error == NULL || *error == NULL);). - * - * */ #include "config.h"