]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nss_files: use booleans in parser macro calls
authorAndreas Schwab <schwab@suse.de>
Tue, 19 May 2026 09:45:41 +0000 (11:45 +0200)
committerAndreas Schwab <schwab@suse.de>
Tue, 19 May 2026 13:20:20 +0000 (15:20 +0200)
The swallow argument in the INT_FIELD and STRING_FIELD macros is used as a
boolean, change all callers to use false and true instead of 0 and 1.

nss/nss_files/files-ethers.c
nss/nss_files/files-hosts.c
nss/nss_files/files-network.c
nss/nss_files/files-parse.c
nss/nss_files/files-proto.c
nss/nss_files/files-rpc.c
nss/nss_files/files-service.c

index a689b1a5b441edfa53fffe3668d91d2f1f0b6d04..bdbb64d6997910e56d80175d51645fb4b170cbd9 100644 (file)
@@ -36,16 +36,16 @@ LINE_PARSER
        unsigned int number;
 
        if (cnt < 5)
-        INT_FIELD (number, ISCOLON , 0, 16, (unsigned int))
+        INT_FIELD (number, ISCOLON , false, 16, (unsigned int))
        else
-        INT_FIELD (number, isspace, 1, 16, (unsigned int))
+        INT_FIELD (number, isspace, true, 16, (unsigned int))
 
        if (number > 0xff)
         return 0;
        result->e_addr.ether_addr_octet[cnt] = number;
      }
  };
- STRING_FIELD (result->e_name, isspace, 1);
+ STRING_FIELD (result->e_name, isspace, true);
  )
 
 
index bfbffa3b5451ae2ad09ddd59b47bacdb6f51ec0c..8d7c90945af2b46e125f921e582b5574bd97867d 100644 (file)
@@ -53,7 +53,7 @@ LINE_PARSER
  {
    char *addr;
 
-   STRING_FIELD (addr, isspace, 1);
+   STRING_FIELD (addr, isspace, true);
 
    /* Parse address.  */
    if (__inet_pton (af == AF_UNSPEC ? AF_INET : af, addr, entdata->host_addr)
@@ -96,7 +96,7 @@ LINE_PARSER
    entdata->h_addr_ptrs[1] = NULL;
    result->h_addr_list = entdata->h_addr_ptrs;
 
-   STRING_FIELD (result->h_name, isspace, 1);
+   STRING_FIELD (result->h_name, isspace, true);
  })
 
 #define EXTRA_ARGS_VALUE , AF_INET, 0
index 86cab9e4e9da1939a37a344c2c767c299f31a21d..b5d6f536f93912181510f2ab24a94f562a13b172 100644 (file)
@@ -38,9 +38,9 @@ LINE_PARSER
    char *cp;
    int n = 1;
 
-   STRING_FIELD (result->n_name, isspace, 1);
+   STRING_FIELD (result->n_name, isspace, true);
 
-   STRING_FIELD (addr, isspace, 1);
+   STRING_FIELD (addr, isspace, true);
    /* 'inet_network' does not add zeroes at the end if the network number
       does not contain four byte values.  We shift result ourselves if
       necessary.  */
index 016b0965e4a9bec54a5a7816a7da6df8d989ab18..f9fcb64c0182441798855af9de5116795665e7ef 100644 (file)
@@ -20,6 +20,7 @@
 #include <errno.h>
 #include <string.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <stdint.h>
 #include <nss_files.h>
 
index 59dc134fe6214a7aca47592fa531117d97df26cf..398ba85519ae80bd65d2b8caca5f4d2676978f1c 100644 (file)
@@ -29,8 +29,8 @@ struct protoent_data {};
 #include "files-parse.c"
 LINE_PARSER
 ("#",
- STRING_FIELD (result->p_name, isspace, 1);
- INT_FIELD (result->p_proto, isspace, 1, 10,);
+ STRING_FIELD (result->p_name, isspace, true);
+ INT_FIELD (result->p_proto, isspace, true, 10,);
  )
 
 #include GENERIC
index 76056c04e816129042eeb3fa43ff65cbb8ca53a9..f159f04686974fb1da07d3b3a04055fd417e4ca3 100644 (file)
@@ -29,8 +29,8 @@ struct rpcent_data {};
 #include "files-parse.c"
 LINE_PARSER
 ("#",
- STRING_FIELD (result->r_name, isspace, 1);
- INT_FIELD (result->r_number, isspace, 1, 10,);
+ STRING_FIELD (result->r_name, isspace, true);
+ INT_FIELD (result->r_number, isspace, true, 10,);
  )
 
 #include GENERIC
index 2ba48b798d88065e30701bf480186615ab994b88..ba141438c4e0b936e468fa466a96ba58fd3ebeb4 100644 (file)
@@ -31,9 +31,9 @@ struct servent_data {};
 #define ISSLASH(c) ((c) == '/')
 LINE_PARSER
 ("#",
- STRING_FIELD (result->s_name, isspace, 1);
- INT_FIELD (result->s_port, ISSLASH, 0, 10, htons);
- STRING_FIELD (result->s_proto, isspace, 1);
+ STRING_FIELD (result->s_name, isspace, true);
+ INT_FIELD (result->s_port, ISSLASH, false, 10, htons);
+ STRING_FIELD (result->s_proto, isspace, true);
  )
 
 #include GENERIC