Skip to content

Commit a6f929b

Browse files
lib/atoi/a2i.h: Use const_cast() instead of a raw cast
This allows grepping for casts more easily. It also reduces the damage of a bogus cast. Signed-off-by: Alejandro Colomar <[email protected]>
1 parent 6827c62 commit a6f929b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/atoi/a2i.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include "atoi/strtoi/strtoi.h"
1515
#include "atoi/strtoi/strtou_noneg.h"
16+
#include "cast.h"
1617
#include "typetraits.h"
1718

1819

@@ -52,7 +53,7 @@
5253
unsigned int: strtou_noneg, \
5354
unsigned long: strtou_noneg, \
5455
unsigned long long: strtou_noneg \
55-
)(s, (char **) endp_, base, min_, max_, &status); \
56+
)(s, const_cast(char **, endp_), base, min_, max_, &status); \
5657
\
5758
if (status != 0) \
5859
errno = status; \

0 commit comments

Comments
 (0)