]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-id128: Use static instead of _SD_ARRAY_STATIC in source files
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 30 Apr 2025 08:09:00 +0000 (10:09 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 1 May 2025 12:02:17 +0000 (14:02 +0200)
When compiling the source files, we know static is going to be available
so there's no need to use the macro from _sd-common.h and we can just use
static instead.

src/libsystemd-network/lldp-neighbor.c
src/libsystemd/sd-id128/sd-id128.c

index 457b1e5926b0c3becac55dabb8404792e3c8fe00..67500895f8b80c990eeec693c0ddc90c2c517553 100644 (file)
@@ -685,7 +685,7 @@ int sd_lldp_neighbor_tlv_is_type(sd_lldp_neighbor *n, uint8_t type) {
         return type == k;
 }
 
-int sd_lldp_neighbor_tlv_get_oui(sd_lldp_neighbor *n, uint8_t oui[_SD_ARRAY_STATIC 3], uint8_t *subtype) {
+int sd_lldp_neighbor_tlv_get_oui(sd_lldp_neighbor *n, uint8_t oui[static 3], uint8_t *subtype) {
         const uint8_t *d;
         size_t length;
         int r;
@@ -714,7 +714,7 @@ int sd_lldp_neighbor_tlv_get_oui(sd_lldp_neighbor *n, uint8_t oui[_SD_ARRAY_STAT
         return 0;
 }
 
-int sd_lldp_neighbor_tlv_is_oui(sd_lldp_neighbor *n, const uint8_t oui[_SD_ARRAY_STATIC 3], uint8_t subtype) {
+int sd_lldp_neighbor_tlv_is_oui(sd_lldp_neighbor *n, const uint8_t oui[static 3], uint8_t subtype) {
         uint8_t k[3], st;
         int r;
 
index 1f59f834ef6ec8cb0d939c9bfacf439caf53c714..54fb403a54b24d9327db87b7d4b20eb697f71ccc 100644 (file)
@@ -23,7 +23,7 @@
 #include "stat-util.h"
 #include "user-util.h"
 
-_public_ char *sd_id128_to_string(sd_id128_t id, char s[_SD_ARRAY_STATIC SD_ID128_STRING_MAX]) {
+_public_ char *sd_id128_to_string(sd_id128_t id, char s[static SD_ID128_STRING_MAX]) {
         size_t k = 0;
 
         assert_return(s, NULL);
@@ -39,7 +39,7 @@ _public_ char *sd_id128_to_string(sd_id128_t id, char s[_SD_ARRAY_STATIC SD_ID12
         return s;
 }
 
-_public_ char *sd_id128_to_uuid_string(sd_id128_t id, char s[_SD_ARRAY_STATIC SD_ID128_UUID_STRING_MAX]) {
+_public_ char *sd_id128_to_uuid_string(sd_id128_t id, char s[static SD_ID128_UUID_STRING_MAX]) {
         size_t k = 0;
 
         assert_return(s, NULL);