clang-format

This commit is contained in:
2024-09-10 13:03:02 -04:00
parent 53c617d779
commit d66450e427
381 changed files with 28864 additions and 34170 deletions

View File

@@ -45,32 +45,28 @@
* memory.
*/
void
bzero(void *vblock, size_t len)
{
char *block = vblock;
size_t i;
void bzero(void *vblock, size_t len) {
char *block = vblock;
size_t i;
/*
* For performance, optimize the common case where the pointer
* and the length are word-aligned, and write word-at-a-time
* instead of byte-at-a-time. Otherwise, write bytes.
*
* The alignment logic here should be portable. We rely on the
* compiler to be reasonably intelligent about optimizing the
* divides and moduli out. Fortunately, it is.
*/
/*
* For performance, optimize the common case where the pointer
* and the length are word-aligned, and write word-at-a-time
* instead of byte-at-a-time. Otherwise, write bytes.
*
* The alignment logic here should be portable. We rely on the
* compiler to be reasonably intelligent about optimizing the
* divides and moduli out. Fortunately, it is.
*/
if ((uintptr_t)block % sizeof(long) == 0 &&
len % sizeof(long) == 0) {
long *lb = (long *)block;
for (i=0; i<len/sizeof(long); i++) {
lb[i] = 0;
}
}
else {
for (i=0; i<len; i++) {
block[i] = 0;
}
}
if ((uintptr_t)block % sizeof(long) == 0 && len % sizeof(long) == 0) {
long *lb = (long *)block;
for (i = 0; i < len / sizeof(long); i++) {
lb[i] = 0;
}
} else {
for (i = 0; i < len; i++) {
block[i] = 0;
}
}
}