Run clang-format on most sources

This commit is contained in:
Justine Tunney 2023-04-26 20:45:01 -07:00
parent 614229e3f4
commit 369f9740de
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
228 changed files with 4844 additions and 4637 deletions

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/intrin/likely.h"
#include "libc/dce.h"
#include "libc/intrin/likely.h"
#include "libc/nexgen32e/x86feature.h"
#include "libc/str/str.h"

View file

@ -16,9 +16,9 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/blake2.h"
#include "libc/assert.h"
#include "libc/macros.internal.h"
#include "libc/str/blake2.h"
#include "libc/str/str.h"
#define ROR(v, n) (((v) >> (n)) | ((v) << (64 - (n))))

View file

@ -15,8 +15,8 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "libc/intrin/bits.h"
#include "libc/str/highwayhash64.h"
#include "libc/intrin/bits.h"
asm(".ident\t\"\\n\\n\
HighwayHash (Apache 2.0)\\n\

View file

@ -17,8 +17,8 @@ nodebuginfo forceinline bool32 iscont(wint_t c) {
char *strstr_sse42(const char *, const char *) strlenesque _Hide;
char16_t *strstr16_sse42(const char16_t *, const char16_t *) strlenesque _Hide;
void *memmem_sse42(const void *, size_t, const void *,
size_t) strlenesque _Hide;
void *memmem_sse42(const void *, size_t, const void *, size_t)
strlenesque _Hide;
void sha256_x86(uint32_t[hasatleast 8], const uint8_t[hasatleast 64],
uint32_t) _Hide;

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int isdigit_l(int c, locale_t l) {
return iswdigit(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int islower_l(int c, locale_t l) {
return islower(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int isupper_l(int c, locale_t l) {
return isupper(c);

View file

@ -16,9 +16,9 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/intrin/likely.h"
#include "libc/dce.h"
#include "libc/intrin/asan.internal.h"
#include "libc/intrin/likely.h"
#include "libc/str/str.h"
typedef char xmm_t __attribute__((__vector_size__(16), __aligned__(16)));

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int iswalpha_l(wint_t c, locale_t l) {
return iswalpha(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int iswblank_l(wint_t c, locale_t l) {
return iswblank(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int iswcntrl_l(wint_t c, locale_t l) {
return iswcntrl(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int iswdigit_l(wint_t c, locale_t l) {
return iswdigit(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int iswlower_l(wint_t c, locale_t l) {
return iswlower(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int iswprint_l(wint_t c, locale_t l) {
return iswprint(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int iswpunct_l(wint_t c, locale_t l) {
return iswpunct(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int iswspace_l(wint_t c, locale_t l) {
return iswspace(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int iswupper_l(wint_t c, locale_t l) {
return iswupper(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int iswxdigit_l(wint_t c, locale_t l) {
return iswxdigit(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int isxdigit_l(int c, locale_t l) {
return iswxdigit(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/sysv/errfuns.h"
#include "libc/str/locale.h"
#include "libc/sysv/errfuns.h"
locale_t newlocale(int catmask, const char *locale, locale_t base) {
// TODO: implement me

View file

@ -22,8 +22,8 @@
IN THE SOFTWARE.
*/
#include "libc/assert.h"
#include "libc/mem/alg.h"
#include "libc/intrin/bsf.h"
#include "libc/mem/alg.h"
#include "libc/str/str.h"
asm(".ident\t\"\\n\\n\

View file

@ -79,12 +79,14 @@ size_t wcsnlen(const wchar_t *, size_t) strlenesque;
size_t wcsnlen_s(const wchar_t *, size_t);
wchar_t *wcschr(const wchar_t *, wchar_t) strlenesque;
wchar_t *wmemchr(const wchar_t *, wchar_t, size_t) strlenesque;
wchar_t *wcschrnul(const wchar_t *, wchar_t) strlenesque returnsnonnull;
wchar_t *wcschrnul(const wchar_t *, wchar_t)
strlenesque returnsnonnull;
char *strstr(const char *, const char *) strlenesque;
char *strcasestr(const char *, const char *) strlenesque;
char16_t *strstr16(const char16_t *, const char16_t *) strlenesque;
wchar_t *wcsstr(const wchar_t *, const wchar_t *) strlenesque;
void *rawwmemchr(const void *, wchar_t) strlenesque returnsnonnull;
void *rawwmemchr(const void *, wchar_t)
strlenesque returnsnonnull;
int strcmp(const char *, const char *) strlenesque;
int strncmp(const char *, const char *, size_t) strlenesque;
int strcmp16(const char16_t *, const char16_t *) strlenesque;
@ -154,7 +156,8 @@ wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t) memcpyesque;
wchar_t *wmempcpy(wchar_t *, const wchar_t *, size_t) memcpyesque;
wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t) memcpyesque;
void *tinymemccpy(void *, const void *, int, size_t) memcpyesque;
void *memmem(const void *, size_t, const void *, size_t) libcesque nosideeffect;
void *memmem(const void *, size_t, const void *, size_t)
libcesque nosideeffect;
ssize_t strfmon(char *, size_t, const char *, ...);
long a64l(const char *);
char *l64a(long);
@ -211,11 +214,14 @@ wint_t towctrans(wint_t, wctrans_t);
char *strsignal(int) returnsnonnull libcesque;
char *strsignal_r(int, char[hasatleast 15]) returnsnonnull libcesque;
char *strerror(int) returnsnonnull dontthrow nocallback;
int strerror_r(int, char *, size_t) dontthrow nocallback;
int strerror_wr(int, uint32_t, char *, size_t) dontthrow nocallback;
int strerror_r(int, char *, size_t)
dontthrow nocallback;
int strerror_wr(int, uint32_t, char *, size_t)
dontthrow nocallback;
char *_strerrno(int) nosideeffect libcesque;
char *_strerdoc(int) nosideeffect libcesque;
int __xpg_strerror_r(int, char *, size_t) dontthrow nocallback;
int __xpg_strerror_r(int, char *, size_t)
dontthrow nocallback;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */

View file

@ -16,9 +16,9 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/dce.h"
#include "libc/intrin/asan.internal.h"
#include "libc/str/str.h"
#include "libc/str/tab.internal.h"
typedef char xmm_t __attribute__((__vector_size__(16), __aligned__(16)));

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int strcoll_l(const char *p, const char *q, locale_t l) {
return strcmp(p, q);

View file

@ -16,11 +16,11 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/intrin/bsf.h"
#include "libc/intrin/pcmpgtb.h"
#include "libc/intrin/pmovmskb.h"
#include "libc/intrin/psubb.h"
#include "libc/macros.internal.h"
#include "libc/intrin/bsf.h"
#include "libc/str/str.h"
#include "libc/str/thompike.h"
#include "libc/str/unicode.h"

View file

@ -16,9 +16,9 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/dce.h"
#include "libc/intrin/asan.internal.h"
#include "libc/str/str.h"
typedef char xmm_t __attribute__((__vector_size__(16), __aligned__(16)));

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
size_t strxfrm_l(char *dest, const char *src, size_t count, locale_t l) {
return strxfrm(dest, src, count);

View file

@ -16,17 +16,17 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/intrin/likely.h"
#include "libc/dce.h"
#include "libc/intrin/asan.internal.h"
#include "libc/intrin/likely.h"
#include "libc/nexgen32e/x86feature.h"
#include "libc/str/str.h"
typedef uint64_t xmm_t __attribute__((__vector_size__(16), __aligned__(1)));
noasan static dontinline antiquity unsigned timingsafe_bcmp_sse(const char *p,
const char *q,
size_t n) {
const char *q,
size_t n) {
uint64_t w;
xmm_t a = {0};
while (n > 16 + 16) {

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int tolower_l(int c, locale_t l) {
return tolower(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int toupper_l(int c, locale_t l) {
return toupper(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
wint_t towlower_l(wint_t c, locale_t l) {
return towlower(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
wint_t towupper_l(wint_t c, locale_t l) {
return towupper(c);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/sysv/errfuns.h"
#include "libc/str/locale.h"
#include "libc/sysv/errfuns.h"
locale_t uselocale(locale_t l) {
// TODO: implement me!

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
int wcscoll_l(const wchar_t *p, const wchar_t *q, locale_t l) {
return wcscmp(p, q);

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/str/str.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t count, locale_t l) {
return wcsxfrm(dest, src, count);