mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-07-12 22:14:32 +02:00
applied clang-format (no functional changes), but exempted custom include order in keyboard.c and main.c
This commit is contained in:
committed by
John Sullivan
parent
4695a78e25
commit
bb1eff09be
12
shm_open.c
12
shm_open.c
@ -6,21 +6,19 @@
|
||||
#include <unistd.h>
|
||||
|
||||
static void
|
||||
randname(char *buf)
|
||||
{
|
||||
randname(char *buf) {
|
||||
struct timespec ts;
|
||||
long r;
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
r = ts.tv_nsec;
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
buf[i] = 'A'+(r&15)+(r&16)*2;
|
||||
buf[i] = 'A' + (r & 15) + (r & 16) * 2;
|
||||
r >>= 5;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
create_shm_file(void)
|
||||
{
|
||||
create_shm_file(void) {
|
||||
int retries = 100;
|
||||
int fd;
|
||||
do {
|
||||
@ -37,8 +35,7 @@ create_shm_file(void)
|
||||
}
|
||||
|
||||
int
|
||||
allocate_shm_file(size_t size)
|
||||
{
|
||||
allocate_shm_file(size_t size) {
|
||||
int fd = create_shm_file();
|
||||
int ret;
|
||||
if (fd < 0)
|
||||
@ -52,4 +49,3 @@ allocate_shm_file(size_t size)
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user