aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2019-01-04 09:48:20 +0100
committerAnders Broman <a.broman58@gmail.com>2019-01-04 11:33:32 +0000
commit2fe46f29c48641b622614faa60a3a7f02bd05274 (patch)
treea26e4c811acfb315beb6c6956f4cfee88cf34332
parentbab774d2601929754d268fa4e2a1cf2bd7f56b2a (diff)
ws_mempbrk_sse42: use same var names.
Found by clang-tidy. Change-Id: I2f89c6860d591c5c1563b9ca01306bb3d9e5e42c Reviewed-on: https://code.wireshark.org/review/31359 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--wsutil/ws_mempbrk_sse42.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/wsutil/ws_mempbrk_sse42.c b/wsutil/ws_mempbrk_sse42.c
index 4e1e87f737..ac8b8ce105 100644
--- a/wsutil/ws_mempbrk_sse42.c
+++ b/wsutil/ws_mempbrk_sse42.c
@@ -96,13 +96,13 @@ ws_mempbrk_sse42_compile(ws_mempbrk_pattern* pattern, const gchar *needles)
X for case 1. */
const char *
-ws_mempbrk_sse42_exec(const char *s, size_t slen, const ws_mempbrk_pattern* pattern, guchar *found_needle)
+ws_mempbrk_sse42_exec(const char *haystack, size_t haystacklen, const ws_mempbrk_pattern* pattern, guchar *found_needle)
{
const char *aligned;
int offset;
- offset = (int) ((size_t) s & 15);
- aligned = (const char *) ((size_t) s & -16L);
+ offset = (int) ((size_t) haystack & 15);
+ aligned = (const char *) ((size_t) haystack & -16L);
if (offset != 0)
{
/* Check partial string. cast safe it's 16B aligned */
@@ -116,23 +116,23 @@ ws_mempbrk_sse42_exec(const char *s, size_t slen, const ws_mempbrk_pattern* patt
if (cflag) {
if (found_needle)
- *found_needle = *(s + length);
- return s + length;
+ *found_needle = *(haystack + length);
+ return haystack + length;
}
/* Find where the NULL terminator is. */
if (idx < 16 - offset)
{
/* found NUL @ 'idx', need to switch to slower mempbrk */
- return ws_mempbrk_portable_exec(s + idx + 1, slen - idx - 1, pattern, found_needle); /* slen is bigger than 16 & idx < 16 so no undeflow here */
+ return ws_mempbrk_portable_exec(haystack + idx + 1, haystacklen - idx - 1, pattern, found_needle); /* haystacklen is bigger than 16 & idx < 16 so no undeflow here */
}
aligned += 16;
- slen -= (16 - offset);
+ haystacklen -= (16 - offset);
}
else
- aligned = s;
+ aligned = haystack;
- while (slen >= 16)
+ while (haystacklen >= 16)
{
__m128i value = _mm_load_si128 (cast_128aligned__m128i(aligned));
int idx = _mm_cmpistri (pattern->mask, value, 0x2);
@@ -148,14 +148,14 @@ ws_mempbrk_sse42_exec(const char *s, size_t slen, const ws_mempbrk_pattern* patt
if (zflag)
{
/* found NUL, need to switch to slower mempbrk */
- return ws_mempbrk_portable_exec(aligned, slen, pattern, found_needle);
+ return ws_mempbrk_portable_exec(aligned, haystacklen, pattern, found_needle);
}
aligned += 16;
- slen -= 16;
+ haystacklen -= 16;
}
/* XXX, use mempbrk_slow here? */
- return ws_mempbrk_portable_exec(aligned, slen, pattern, found_needle);
+ return ws_mempbrk_portable_exec(aligned, haystacklen, pattern, found_needle);
}
#endif /* HAVE_SSE4_2 */