Skip to content

Commit

Permalink
lib/atoi/strtou_noneg.[ch], tests/: strtoul_noneg(): Remove unused fu…
Browse files Browse the repository at this point in the history
…nction

All call sites have been replaced by functions from "atoi/a2i.h" and
"atoi/str2i.h" recently.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
  • Loading branch information
alejandro-colomar committed Jan 17, 2024
1 parent 26bf109 commit ccf1910
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 85 deletions.
3 changes: 0 additions & 3 deletions lib/atoi/strtou_noneg.c
Expand Up @@ -11,6 +11,3 @@

extern inline uintmax_t strtou_noneg(const char *s, char **restrict endp,
int base, uintmax_t min, uintmax_t max, int *restrict status);

extern inline unsigned long strtoul_noneg(const char *s,
char **restrict endp, int base);
17 changes: 1 addition & 16 deletions lib/atoi/strtou_noneg.h
Expand Up @@ -9,8 +9,8 @@
#include <config.h>

#include <errno.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>

#include "atoi/strtoi.h"
#include "attr.h"
Expand All @@ -20,10 +20,6 @@ ATTR_STRING(1) ATTR_ACCESS(write_only, 2) ATTR_ACCESS(write_only, 6)
inline uintmax_t strtou_noneg(const char *s, char **restrict endp,
int base, uintmax_t min, uintmax_t max, int *restrict status);

ATTR_STRING(1) ATTR_ACCESS(write_only, 2)
inline unsigned long strtoul_noneg(const char *s,
char **restrict endp, int base);


inline uintmax_t
strtou_noneg(const char *s, char **restrict endp, int base,
Expand All @@ -40,15 +36,4 @@ strtou_noneg(const char *s, char **restrict endp, int base,
}


inline unsigned long
strtoul_noneg(const char *s, char **restrict endp, int base)
{
if (strtol(s, endp, base) < 0) {
errno = ERANGE;
return 0;
}
return strtoul(s, endp, base);
}


#endif // include guard
14 changes: 0 additions & 14 deletions tests/unit/Makefile.am
Expand Up @@ -6,7 +6,6 @@ TESTS = $(check_PROGRAMS)
check_PROGRAMS = \
test_adds \
test_atoi_strtoi \
test_atoi_strtou_noneg \
test_chkname \
test_sprintf \
test_strncpy \
Expand Down Expand Up @@ -47,19 +46,6 @@ test_atoi_strtoi_LDADD = \
$(CMOCKA_LIBS) \
$(NULL)

test_atoi_strtou_noneg_SOURCES = \
../../lib/atoi/strtou_noneg.c \
test_atoi_strtou_noneg.c \
$(NULL)
test_atoi_strtou_noneg_CFLAGS = \
$(AM_CFLAGS) \
$(NULL)
test_atoi_strtou_noneg_LDFLAGS = \
$(NULL)
test_atoi_strtou_noneg_LDADD = \
$(CMOCKA_LIBS) \
$(NULL)

test_chkname_SOURCES = \
../../lib/chkname.c \
test_chkname.c \
Expand Down
52 changes: 0 additions & 52 deletions tests/unit/test_atoi_strtou_noneg.c

This file was deleted.

0 comments on commit ccf1910

Please sign in to comment.