mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-23 17:38:54 +02:00
docs: let go of *
Since we are no longer using sgml mode, using /* */ to escape block comments inside examples does not work anymore. Switch to using line comments with //
This commit is contained in:
@@ -69,14 +69,14 @@
|
||||
* g_assert ((contents == NULL && err != NULL) || (contents != NULL && err == NULL));
|
||||
* if (err != NULL)
|
||||
* {
|
||||
* /* Report error to user, and free error */
|
||||
* // Report error to user, and free error
|
||||
* g_assert (contents == NULL);
|
||||
* fprintf (stderr, "Unable to read file: %s\n", err->message);
|
||||
* g_error_free (err);
|
||||
* }
|
||||
* else
|
||||
* {
|
||||
* /* Use file contents */
|
||||
* // Use file contents
|
||||
* g_assert (contents != NULL);
|
||||
* }
|
||||
* ]|
|
||||
@@ -89,10 +89,12 @@
|
||||
* are only interested in whether it failed and don't need to display
|
||||
* an error message, you can pass %NULL for the @error argument:
|
||||
* |[<!-- language="C" -->
|
||||
* if (g_file_get_contents ("foo.txt", &contents, NULL, NULL)) /* ignore errors */
|
||||
* /* no error occurred */ ;
|
||||
* if (g_file_get_contents ("foo.txt", &contents, NULL, NULL)) // ignore errors
|
||||
* // no error occurred
|
||||
* ;
|
||||
* else
|
||||
* /* error */ ;
|
||||
* // error
|
||||
* ;
|
||||
* ]|
|
||||
*
|
||||
* The #GError object contains three fields: @domain indicates the module
|
||||
@@ -125,9 +127,9 @@
|
||||
* if (fd < 0)
|
||||
* {
|
||||
* g_set_error (error,
|
||||
* FOO_ERROR, /* error domain */
|
||||
* FOO_ERROR_BLAH, /* error code */
|
||||
* "Failed to open file: %s", /* error message format string */
|
||||
* FOO_ERROR, // error domain
|
||||
* FOO_ERROR_BLAH, // error code
|
||||
* "Failed to open file: %s", // error message format string
|
||||
* g_strerror (errno));
|
||||
* return -1;
|
||||
* }
|
||||
@@ -148,12 +150,12 @@
|
||||
*
|
||||
* if (!sub_function_that_can_fail (err))
|
||||
* {
|
||||
* /* assert that error was set by the sub-function */
|
||||
* // assert that error was set by the sub-function
|
||||
* g_assert (err == NULL || *err != NULL);
|
||||
* return FALSE;
|
||||
* }
|
||||
*
|
||||
* /* otherwise continue, no error occurred */
|
||||
* // otherwise continue, no error occurred
|
||||
* g_assert (err == NULL || *err == NULL);
|
||||
* }
|
||||
* ]|
|
||||
@@ -175,14 +177,13 @@
|
||||
*
|
||||
* if (tmp_error != NULL)
|
||||
* {
|
||||
* /* store tmp_error in err, if err != NULL,
|
||||
* * otherwise call g_error_free() on tmp_error
|
||||
* */
|
||||
* // store tmp_error in err, if err != NULL,
|
||||
* // otherwise call g_error_free() on tmp_error
|
||||
* g_propagate_error (err, tmp_error);
|
||||
* return FALSE;
|
||||
* }
|
||||
*
|
||||
* /* otherwise continue, no error occurred */
|
||||
* // otherwise continue, no error occurred
|
||||
* }
|
||||
* ]|
|
||||
*
|
||||
@@ -222,7 +223,7 @@
|
||||
*
|
||||
* g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
|
||||
*
|
||||
* sub_function_that_can_fail (NULL); /* ignore errors */
|
||||
* sub_function_that_can_fail (NULL); // ignore errors
|
||||
*
|
||||
* tmp_error = NULL;
|
||||
* other_function_that_can_fail (&tmp_error);
|
||||
|
Reference in New Issue
Block a user