spm: constify badchars; suggested by cppcheck

pull/7392/head
Victor Julien 3 years ago
parent 99f212bc8c
commit 55de18c675

@ -90,7 +90,8 @@ void Bs2BmBadcharsNocase(const uint8_t *needle, uint16_t needle_len, uint8_t *ba
* *
* \retval ptr to start of the match; NULL if no match * \retval ptr to start of the match; NULL if no match
*/ */
uint8_t * Bs2Bm(const uint8_t *haystack, uint32_t haystack_len, const uint8_t *needle, uint16_t needle_len, uint8_t badchars[]) uint8_t *Bs2Bm(const uint8_t *haystack, uint32_t haystack_len, const uint8_t *needle,
uint16_t needle_len, const uint8_t badchars[])
{ {
const uint8_t *h, *n; const uint8_t *h, *n;
const uint8_t *hmax = haystack + haystack_len; const uint8_t *hmax = haystack + haystack_len;
@ -139,7 +140,8 @@ uint8_t * Bs2Bm(const uint8_t *haystack, uint32_t haystack_len, const uint8_t *n
* *
* \retval ptr to start of the match; NULL if no match * \retval ptr to start of the match; NULL if no match
*/ */
uint8_t *Bs2BmNocase(const uint8_t *haystack, uint32_t haystack_len, const uint8_t *needle, uint16_t needle_len, uint8_t badchars[]) uint8_t *Bs2BmNocase(const uint8_t *haystack, uint32_t haystack_len, const uint8_t *needle,
uint16_t needle_len, const uint8_t badchars[])
{ {
const uint8_t *h, *n; const uint8_t *h, *n;
const uint8_t *hmax = haystack + haystack_len; const uint8_t *hmax = haystack + haystack_len;

@ -31,8 +31,8 @@
void Bs2BmBadchars(const uint8_t *, uint16_t, uint8_t *); void Bs2BmBadchars(const uint8_t *, uint16_t, uint8_t *);
void Bs2BmBadcharsNocase(const uint8_t *, uint16_t, uint8_t *); void Bs2BmBadcharsNocase(const uint8_t *, uint16_t, uint8_t *);
uint8_t * Bs2Bm(const uint8_t *, uint32_t, const uint8_t *, uint16_t, uint8_t []); uint8_t *Bs2Bm(const uint8_t *, uint32_t, const uint8_t *, uint16_t, const uint8_t[]);
uint8_t *Bs2BmNocase(const uint8_t *, uint32_t, const uint8_t *, uint16_t, uint8_t []); uint8_t *Bs2BmNocase(const uint8_t *, uint32_t, const uint8_t *, uint16_t, const uint8_t[]);
#endif /* __UTIL_SPM_BS2BM__ */ #endif /* __UTIL_SPM_BS2BM__ */

Loading…
Cancel
Save