Merge branch '796385-indentation' into 'master'

Fix misleading indentation (bug #796385)

See merge request GNOME/glib!42
This commit is contained in:
Philip Withnall 2018-05-30 09:33:56 +00:00
commit e03f83212d
3 changed files with 14 additions and 13 deletions

View File

@ -3508,7 +3508,7 @@ AC_ARG_ENABLE(compile-warnings,
enable_compile_warnings=yes) enable_compile_warnings=yes)
AS_IF([test "x$enable_compile_warnings" != xno], [ AS_IF([test "x$enable_compile_warnings" != xno], [
CC_CHECK_FLAGS_APPEND([GLIB_WARN_CFLAGS], [CFLAGS], [\ CC_CHECK_FLAGS_APPEND([GLIB_WARN_CFLAGS], [CFLAGS], [\
-Wall -Wstrict-prototypes -Wduplicated-branches \ -Wall -Wstrict-prototypes -Wduplicated-branches -Wmisleading-indentation \
-Werror=declaration-after-statement \ -Werror=declaration-after-statement \
-Werror=missing-prototypes -Werror=implicit-function-declaration \ -Werror=missing-prototypes -Werror=implicit-function-declaration \
-Werror=pointer-arith -Werror=init-self -Werror=format-security \ -Werror=pointer-arith -Werror=init-self -Werror=format-security \

View File

@ -331,6 +331,7 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
test_c_args = [ test_c_args = [
'-Wall', '-Wall',
'-Wduplicated-branches', '-Wduplicated-branches',
'-Wmisleading-indentation',
'-Wstrict-prototypes', '-Wstrict-prototypes',
'-Wunused', '-Wunused',
'-Werror=declaration-after-statement', '-Werror=declaration-after-statement',

View File

@ -955,18 +955,18 @@ test_paths (void)
if (g_test_verbose ()) if (g_test_verbose ())
g_printerr ("checking g_canonicalize_filename() supports NULL..."); g_printerr ("checking g_canonicalize_filename() supports NULL...");
{ {
const gchar *relative_path = "./"; const gchar *relative_path = "./";
gchar *canonical_path = g_canonicalize_filename (relative_path, NULL); gchar *canonical_path = g_canonicalize_filename (relative_path, NULL);
gchar *cwd = g_get_current_dir (); gchar *cwd = g_get_current_dir ();
if (g_strcmp0 (canonical_path, cwd) != 0) if (g_strcmp0 (canonical_path, cwd) != 0)
{ {
g_error ("\nfailed for \"%s\"==\"%s\" (returned: \"%s\")\n", g_error ("\nfailed for \"%s\"==\"%s\" (returned: \"%s\")\n",
relative_path, cwd, canonical_path); relative_path, cwd, canonical_path);
} }
g_free (cwd); g_free (cwd);
g_free (canonical_path); g_free (canonical_path);
} }
if (g_test_verbose ()) if (g_test_verbose ())
g_printerr ("ok\n"); g_printerr ("ok\n");