Rename _bsr/_bsf to bsr/bsf

Now that these functions are behind _COSMO_SOURCE there's no reason for
having the ugly underscore anymore. To use these functions, you need to
pass -mcosmo to cosmocc.
This commit is contained in:
Justine Tunney 2024-03-04 17:33:26 -08:00
parent a6baba1b07
commit 8bfd56b59e
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
53 changed files with 110 additions and 93 deletions

View file

@ -369,7 +369,7 @@ static wint_t Capitalize(wint_t c) {
static struct rune DecodeUtf8(int c) {
struct rune r;
if (c < 252) {
r.n = _bsr(255 & ~c);
r.n = bsr(255 & ~c);
r.c = c & (((1 << r.n) - 1) | 3);
r.n = 6 - r.n;
} else {
@ -645,7 +645,7 @@ static void abAppendw(struct abuf *a, unsigned long long w) {
p[5] = (0x0000ff0000000000 & w) >> 050;
p[6] = (0x00ff000000000000 & w) >> 060;
p[7] = (0xff00000000000000 & w) >> 070;
a->len += w ? (_bsrll(w) >> 3) + 1 : 1;
a->len += w ? (bsrll(w) >> 3) + 1 : 1;
p[8] = 0;
}
@ -1634,7 +1634,7 @@ static size_t linenoiseEscape(char *d, const char *s, size_t n) {
break;
}
WRITE32LE(p, w);
p += (_bsr(w) >> 3) + 1;
p += (bsr(w) >> 3) + 1;
l = w;
}
return p - d;