Commit 3c63abd
committed
string: Cast memchr and memrchr val to 'unsigned long' while building mask
In the speed-optimized version of this code, the needle is replicated
to fill an unsigned long. It does that by oring various shifts of the
value. Of course, C performs the first of those by first casting to
int, and on MSP430, the compiler ends up sign extending so values >=
0x80 end up with high bits set which wrecks the resulting mask value.
Signed-off-by: Keith Packard <[email protected]>1 parent 0fa07d9 commit 3c63abd
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
0 commit comments