From eeef787418d7733f145a425a634669a53804ae6c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 10 Jun 2020 09:47:15 +0100 Subject: [PATCH] Normalize C source files to end with exactly one newline Some editors automatically remove trailing blank lines, or automatically add a trailing newline to avoid having a trailing non-blank line that is not terminated by a newline. To avoid unrelated whitespace changes when users of such editors contribute to dbus, let's pre-emptively normalize all files. Unlike more intrusive whitespace normalization like removing trailing whitespace from each line, this seems unlikely to cause significant issues with cherry-picking changes to stable branches. Implemented by: find . -name '*.[ch]' -print0 | \ xargs -0 perl -0777 -p -i -e 's/\n+\z//g; s/\z/\n/g' Signed-off-by: Simon McVittie --- bus/activation-helper-bin.c | 1 - bus/activation-helper.c | 1 - bus/config-parser-common.c | 1 - bus/config-parser-common.h | 1 - bus/config-parser-trivial.c | 1 - bus/config-parser.c | 1 - bus/policy.c | 1 - bus/signals.c | 1 - dbus/dbus-address.h | 1 - dbus/dbus-file-win.c | 1 - dbus/dbus-file.c | 1 - dbus/dbus-mainloop.h | 1 - dbus/dbus-misc.h | 1 - dbus/dbus-server-debug-pipe.c | 1 - dbus/dbus-server-socket.c | 1 - dbus/dbus-server-win.c | 1 - dbus/dbus-shell.h | 2 -- dbus/dbus-transport-socket.c | 1 - tools/dbus-monitor.c | 1 - tools/dbus-print-message.c | 1 - tools/strtoll.c | 1 - 21 files changed, 22 deletions(-) diff --git a/bus/activation-helper-bin.c b/bus/activation-helper-bin.c index f5f16d2c..0446ee23 100644 --- a/bus/activation-helper-bin.c +++ b/bus/activation-helper-bin.c @@ -100,4 +100,3 @@ main (int argc, char **argv) return retval; } - diff --git a/bus/activation-helper.c b/bus/activation-helper.c index 5b6a0908..8172b6cf 100644 --- a/bus/activation-helper.c +++ b/bus/activation-helper.c @@ -546,4 +546,3 @@ error_free_parser: error: return retval; } - diff --git a/bus/config-parser-common.c b/bus/config-parser-common.c index 1d981640..627c9013 100644 --- a/bus/config-parser-common.c +++ b/bus/config-parser-common.c @@ -192,4 +192,3 @@ bus_config_parser_element_type_to_name (ElementType type) return NULL; } } - diff --git a/bus/config-parser-common.h b/bus/config-parser-common.h index e3775eef..1c601e97 100644 --- a/bus/config-parser-common.h +++ b/bus/config-parser-common.h @@ -57,4 +57,3 @@ ElementType bus_config_parser_element_name_to_type (const char *element_name); const char* bus_config_parser_element_type_to_name (ElementType type); #endif /* BUS_CONFIG_PARSER_COMMON_H */ - diff --git a/bus/config-parser-trivial.c b/bus/config-parser-trivial.c index fd7bbf00..9a2087cf 100644 --- a/bus/config-parser-trivial.c +++ b/bus/config-parser-trivial.c @@ -750,4 +750,3 @@ finish: } #endif /* DBUS_ENABLE_EMBEDDED_TESTS */ - diff --git a/bus/config-parser.c b/bus/config-parser.c index a47b8a58..f9b70477 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -4056,4 +4056,3 @@ bus_config_parser_test (const char *test_data_dir_cstr) } #endif /* DBUS_ENABLE_EMBEDDED_TESTS */ - diff --git a/bus/policy.c b/bus/policy.c index 0e67e64c..74cb41bd 100644 --- a/bus/policy.c +++ b/bus/policy.c @@ -1406,4 +1406,3 @@ bus_policy_check_can_own (BusPolicy *policy, return bus_rules_check_can_own (policy->default_rules, service_name); } #endif /* DBUS_ENABLE_EMBEDDED_TESTS */ - diff --git a/bus/signals.c b/bus/signals.c index c1224e7e..08304c5b 100644 --- a/bus/signals.c +++ b/bus/signals.c @@ -2984,4 +2984,3 @@ bus_signals_test (const char *test_data_dir _DBUS_GNUC_UNUSED) } #endif /* DBUS_ENABLE_EMBEDDED_TESTS */ - diff --git a/dbus/dbus-address.h b/dbus/dbus-address.h index d3985439..30df4463 100644 --- a/dbus/dbus-address.h +++ b/dbus/dbus-address.h @@ -83,4 +83,3 @@ dbus_clear_address_entries (DBusAddressEntry ***pointer_to_entries) DBUS_END_DECLS #endif /* DBUS_ADDRESS_H */ - diff --git a/dbus/dbus-file-win.c b/dbus/dbus-file-win.c index e5b577a2..5385f856 100644 --- a/dbus/dbus-file-win.c +++ b/dbus/dbus-file-win.c @@ -404,4 +404,3 @@ _dbus_create_file_exclusively (const DBusString *filename, return TRUE; } - diff --git a/dbus/dbus-file.c b/dbus/dbus-file.c index e7272d70..c0eb1aca 100644 --- a/dbus/dbus-file.c +++ b/dbus/dbus-file.c @@ -25,4 +25,3 @@ #include #include "dbus-file.h" - diff --git a/dbus/dbus-mainloop.h b/dbus/dbus-mainloop.h index fdfa74fe..40350977 100644 --- a/dbus/dbus-mainloop.h +++ b/dbus/dbus-mainloop.h @@ -70,4 +70,3 @@ _dbus_clear_loop (DBusLoop **pointer_to_loop) #endif /* !DOXYGEN_SHOULD_SKIP_THIS */ #endif /* DBUS_MAINLOOP_H */ - diff --git a/dbus/dbus-misc.h b/dbus/dbus-misc.h index 8b154130..ff2a7e4b 100644 --- a/dbus/dbus-misc.h +++ b/dbus/dbus-misc.h @@ -56,4 +56,3 @@ char *dbus_try_get_local_machine_id (DBusError *error); DBUS_END_DECLS #endif /* DBUS_MISC_H */ - diff --git a/dbus/dbus-server-debug-pipe.c b/dbus/dbus-server-debug-pipe.c index a82688d1..c396bc82 100644 --- a/dbus/dbus-server-debug-pipe.c +++ b/dbus/dbus-server-debug-pipe.c @@ -429,4 +429,3 @@ _dbus_transport_open_debug_pipe (DBusAddressEntry *entry, /** @} */ #endif /* DBUS_ENABLE_EMBEDDED_TESTS */ - diff --git a/dbus/dbus-server-socket.c b/dbus/dbus-server-socket.c index e51e946e..bc5e3a9d 100644 --- a/dbus/dbus-server-socket.c +++ b/dbus/dbus-server-socket.c @@ -598,4 +598,3 @@ _dbus_server_socket_own_filename (DBusServer *server, /** @} */ - diff --git a/dbus/dbus-server-win.c b/dbus/dbus-server-win.c index 5d43c87b..890ee328 100644 --- a/dbus/dbus-server-win.c +++ b/dbus/dbus-server-win.c @@ -93,4 +93,3 @@ _dbus_server_listen_platform_specific (DBusAddressEntry *entry, } /** @} */ - diff --git a/dbus/dbus-shell.h b/dbus/dbus-shell.h index 06da274e..e6f6b595 100644 --- a/dbus/dbus-shell.h +++ b/dbus/dbus-shell.h @@ -37,5 +37,3 @@ dbus_bool_t _dbus_shell_parse_argv (const char *command_line, DBUS_END_DECLS #endif /* DBUS_SHELL_H */ - - diff --git a/dbus/dbus-transport-socket.c b/dbus/dbus-transport-socket.c index 04b3b414..fa1307bd 100644 --- a/dbus/dbus-transport-socket.c +++ b/dbus/dbus-transport-socket.c @@ -1503,4 +1503,3 @@ _dbus_transport_open_socket(DBusAddressEntry *entry, } /** @} */ - diff --git a/tools/dbus-monitor.c b/tools/dbus-monitor.c index c6f36d59..fcc923ee 100644 --- a/tools/dbus-monitor.c +++ b/tools/dbus-monitor.c @@ -600,4 +600,3 @@ main (int argc, char *argv[]) fprintf (stderr, "Error: %s\n", error.message); exit (1); } - diff --git a/tools/dbus-print-message.c b/tools/dbus-print-message.c index 547f72f8..2ce7f68b 100644 --- a/tools/dbus-print-message.c +++ b/tools/dbus-print-message.c @@ -600,4 +600,3 @@ print_message (DBusMessage *message, dbus_bool_t literal, long sec, long usec) fflush (stdout); } - diff --git a/tools/strtoll.c b/tools/strtoll.c index 7360c630..00f14c3c 100644 --- a/tools/strtoll.c +++ b/tools/strtoll.c @@ -164,4 +164,3 @@ noconv: *endptr = (char *)(any ? s - 1 : nptr); return (acc); } -