]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: use C99 __func__ rather than obsolete __FUNCTION__
authorLennart Poettering <lennart@poettering.net>
Mon, 11 Oct 2021 11:50:29 +0000 (13:50 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 11 Oct 2021 12:10:39 +0000 (14:10 +0200)
We use __func__ almost everywhere, but there are some holdouts. Fix
that.

src/core/selinux-access.c
src/libsystemd-network/test-dhcp-client.c
src/libsystemd-network/test-ipv4ll.c
src/libsystemd-network/test-ndisc-ra.c
src/libsystemd-network/test-ndisc-rs.c
src/udev/scsi_id/scsi_serial.c

index 984e324d74aa7103d0f9853f11ce157e92930506..513a4fb00e7dc1d12349dd01e0af21ae7d2955b5 100644 (file)
@@ -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);
index 4428e54bc7878f9036fe9921de25306d4b78395d..4b11cdbc167d6d4edd90e0ccf769bd729562226b 100644 (file)
@@ -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);
index 7985185b33d563fbb76dc1394f39bb60dab29e71..e90e73459d9570f125ab76041a02eaa93ea03685 100644 (file)
@@ -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);
index 927e21b3cdf69d923aa0eed58167b0a556f3b070..4713bc99b5b47bf434b0107d8de263fe8c0c6ea8 100644 (file)
@@ -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);
 
index 5e50453c35fafa62ee78de495e60040b5b6b133c..ae26ee7e741cdd2510666eacc9a5bcc522b955a7 100644 (file)
@@ -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;
 
index 489f5ad16a6cdb95a1a879cf2a6b0c36af56849c..bde2811dd75bb6f8ca38f0977c09fe4b1aa89f85 100644 (file)
@@ -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);