diff options
| author | David Marchand <[email protected]> | 2024-02-14 13:12:19 +0100 |
|---|---|---|
| committer | David Marchand <[email protected]> | 2024-02-16 18:03:41 +0100 |
| commit | 2df20a1d345a5fc0a1b6dc0317d11fc7b1fda7e7 (patch) | |
| tree | 856357a7c8a306548b97b8d62406c842c38a35c3 /examples/fips_validation | |
| parent | 537caad2c70057c68e110211bab0cb4088f391d2 (diff) | |
eal: add helper to skip whitespaces
Reduce code duplication by providing a simple inline helper.
Signed-off-by: David Marchand <[email protected]>
Acked-by: Tyler Retzlaff <[email protected]>
Acked-by: Bruce Richardson <[email protected]>
Diffstat (limited to 'examples/fips_validation')
| -rw-r--r-- | examples/fips_validation/fips_validation.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c index f840804009..c15178e55b 100644 --- a/examples/fips_validation/fips_validation.c +++ b/examples/fips_validation/fips_validation.c @@ -13,14 +13,6 @@ #include "fips_validation.h" -#define skip_white_spaces(pos) \ -({ \ - __typeof__(pos) _p = (pos); \ - for ( ; isspace(*_p); _p++) \ - ; \ - _p; \ -}) - static int get_file_line(void) { @@ -579,13 +571,13 @@ parser_read_uint64_hex(uint64_t *value, const char *p) char *next; uint64_t val; - p = skip_white_spaces(p); + p = rte_str_skip_leading_spaces(p); val = strtoul(p, &next, 16); if (p == next) return -EINVAL; - p = skip_white_spaces(next); + p = rte_str_skip_leading_spaces(next); if (*p != '\0') return -EINVAL; @@ -759,7 +751,7 @@ parser_read_uint64(uint64_t *value, const char *p) char *next; uint64_t val; - p = skip_white_spaces(p); + p = rte_str_skip_leading_spaces(p); if (!isdigit(*p)) return -EINVAL; @@ -785,7 +777,7 @@ parser_read_uint64(uint64_t *value, const char *p) break; } - p = skip_white_spaces(p); + p = rte_str_skip_leading_spaces(p); if (*p != '\0') return -EINVAL; |
