From 7fbae5b7069c67ab203d50a2d8295a4d970f10c5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 11 Oct 2021 13:50:29 +0200 Subject: [PATCH] tree-wide: use C99 __func__ rather than obsolete __FUNCTION__ We use __func__ almost everywhere, but there are some holdouts. Fix that. --- src/core/selinux-access.c | 2 +- src/libsystemd-network/test-dhcp-client.c | 10 +++++----- src/libsystemd-network/test-ipv4ll.c | 4 ++-- src/libsystemd-network/test-ndisc-ra.c | 6 +++--- src/libsystemd-network/test-ndisc-rs.c | 4 ++-- src/udev/scsi_id/scsi_serial.c | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c index 984e324d74..513a4fb00e 100644 --- a/src/core/selinux-access.c +++ b/src/core/selinux-access.c @@ -126,7 +126,7 @@ _printf_(2, 3) static int log_callback(int type, const char *fmt, ...) { DISABLE_WARNING_FORMAT_NONLITERAL; log_internalv(LOG_AUTH | callback_type_to_priority(type), - 0, PROJECT_FILE, __LINE__, __FUNCTION__, + 0, PROJECT_FILE, __LINE__, __func__, fmt2, ap); REENABLE_WARNING; va_end(ap); diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c index 4428e54bc7..4b11cdbc16 100644 --- a/src/libsystemd-network/test-dhcp-client.c +++ b/src/libsystemd-network/test-dhcp-client.c @@ -45,7 +45,7 @@ static void test_request_basic(sd_event *e) { sd_dhcp_client *client; if (verbose) - printf("* %s\n", __FUNCTION__); + printf("* %s\n", __func__); /* Initialize client without Anonymize settings. */ r = sd_dhcp_client_new(&client, false); @@ -105,7 +105,7 @@ static void test_request_anonymize(sd_event *e) { sd_dhcp_client *client; if (verbose) - printf("* %s\n", __FUNCTION__); + printf("* %s\n", __func__); /* Initialize client with Anonymize settings. */ r = sd_dhcp_client_new(&client, true); @@ -137,7 +137,7 @@ static void test_checksum(void) { }; if (verbose) - printf("* %s\n", __FUNCTION__); + printf("* %s\n", __func__); assert_se(dhcp_packet_checksum((uint8_t*)&buf, 20) == be16toh(0x78ae)); } @@ -279,7 +279,7 @@ static void test_discover_message(sd_event *e) { int res, r; if (verbose) - printf("* %s\n", __FUNCTION__); + printf("* %s\n", __func__); r = sd_dhcp_client_new(&client, false); assert_se(r >= 0); @@ -497,7 +497,7 @@ static void test_addr_acq(sd_event *e) { int res, r; if (verbose) - printf("* %s\n", __FUNCTION__); + printf("* %s\n", __func__); r = sd_dhcp_client_new(&client, false); assert_se(r >= 0); diff --git a/src/libsystemd-network/test-ipv4ll.c b/src/libsystemd-network/test-ipv4ll.c index 7985185b33..e90e73459d 100644 --- a/src/libsystemd-network/test-ipv4ll.c +++ b/src/libsystemd-network/test-ipv4ll.c @@ -81,7 +81,7 @@ static void test_public_api_setters(sd_event *e) { .ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'}}; if (verbose) - printf("* %s\n", __FUNCTION__); + printf("* %s\n", __func__); assert_se(sd_ipv4ll_new(&ll) == 0); assert_se(ll); @@ -130,7 +130,7 @@ static void test_basic_request(sd_event *e) { .ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'}}; if (verbose) - printf("* %s\n", __FUNCTION__); + printf("* %s\n", __func__); assert_se(sd_ipv4ll_new(&ll) == 0); assert_se(sd_ipv4ll_start(ll) == -EINVAL); diff --git a/src/libsystemd-network/test-ndisc-ra.c b/src/libsystemd-network/test-ndisc-ra.c index 927e21b3cd..4713bc99b5 100644 --- a/src/libsystemd-network/test-ndisc-ra.c +++ b/src/libsystemd-network/test-ndisc-ra.c @@ -111,7 +111,7 @@ static int test_rs_hangcheck(sd_event_source *s, uint64_t usec, static void test_radv_prefix(void) { sd_radv_prefix *p; - printf("* %s\n", __FUNCTION__); + printf("* %s\n", __func__); assert_se(sd_radv_prefix_new(&p) >= 0); @@ -153,7 +153,7 @@ static void test_radv_prefix(void) { static void test_radv(void) { sd_radv *ra; - printf("* %s\n", __FUNCTION__); + printf("* %s\n", __func__); assert_se(sd_radv_new(&ra) >= 0); assert_se(ra); @@ -295,7 +295,7 @@ static void test_ra(void) { sd_radv *ra; unsigned i; - printf("* %s\n", __FUNCTION__); + printf("* %s\n", __func__); assert_se(socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, test_fd) >= 0); diff --git a/src/libsystemd-network/test-ndisc-rs.c b/src/libsystemd-network/test-ndisc-rs.c index 5e50453c35..ae26ee7e74 100644 --- a/src/libsystemd-network/test-ndisc-rs.c +++ b/src/libsystemd-network/test-ndisc-rs.c @@ -273,7 +273,7 @@ static void test_rs(void) { sd_ndisc *nd; if (verbose) - printf("* %s\n", __FUNCTION__); + printf("* %s\n", __func__); send_ra_function = send_ra; @@ -366,7 +366,7 @@ static void test_timeout(void) { sd_ndisc *nd; if (verbose) - printf("* %s\n", __FUNCTION__); + printf("* %s\n", __func__); send_ra_function = test_timeout_value; diff --git a/src/udev/scsi_id/scsi_serial.c b/src/udev/scsi_id/scsi_serial.c index 489f5ad16a..bde2811dd7 100644 --- a/src/udev/scsi_id/scsi_serial.c +++ b/src/udev/scsi_id/scsi_serial.c @@ -237,7 +237,7 @@ static int scsi_dump(struct scsi_id_device *dev_scsi, struct sg_io_hdr *io) { */ return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "%s: called with no error", - __FUNCTION__); + __func__); log_debug("%s: sg_io failed status 0x%x 0x%x 0x%x 0x%x", dev_scsi->kernel, io->driver_status, io->host_status, io->msg_status, io->status); @@ -255,7 +255,7 @@ static int scsi_dump_v4(struct scsi_id_device *dev_scsi, struct sg_io_v4 *io) { */ return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "%s: called with no error", - __FUNCTION__); + __func__); log_debug("%s: sg_io failed status 0x%x 0x%x 0x%x", dev_scsi->kernel, io->driver_status, io->transport_status, io->device_status);