mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 08:18:30 +00:00
Make fixes, improvements, and chibicc python bindings
- python now mixes audio 10x faster - python octal notation is restored - chibicc now builds code 3x faster - chibicc now has help documentation - chibicc can now generate basic python bindings - linenoise now supports some paredit-like features See #141
This commit is contained in:
parent
28997f3acb
commit
7061c79c22
121 changed files with 5272 additions and 1928 deletions
|
@ -16,7 +16,6 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/nexgen32e/hascharacter.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
|
@ -24,17 +23,21 @@
|
|||
* @asyncsignalsafe
|
||||
*/
|
||||
char *strpbrk(const char *s, const char *accept) {
|
||||
size_t i;
|
||||
bool lut[256];
|
||||
if (accept[0]) {
|
||||
if (!accept[1]) {
|
||||
return strchr(s, accept[0]);
|
||||
} else {
|
||||
for (i = 0; s[i]; ++i) {
|
||||
if (HasCharacter(s[i], accept)) {
|
||||
return (/*unconst*/ char *)&s[i];
|
||||
memset(lut, 0, sizeof(lut));
|
||||
while (*accept) {
|
||||
lut[*accept++ & 255] = true;
|
||||
}
|
||||
for (; *s; ++s) {
|
||||
if (lut[*s & 255]) {
|
||||
return (/*unconst*/ char *)s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue