1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:17:35 +00:00

Add clang-format file

Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
This commit is contained in:
Robin Burchell 2019-05-28 11:53:16 +02:00 committed by Andreas Kling
parent c11351ac50
commit 0dc9af5f7e
286 changed files with 3244 additions and 2424 deletions

View file

@ -5,11 +5,11 @@
#define ALWAYS_INLINE inline __attribute__((always_inline))
#ifdef __cplusplus
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
#define __BEGIN_DECLS
#define __END_DECLS
# define __BEGIN_DECLS
# define __END_DECLS
#endif
#undef __P
@ -20,4 +20,3 @@
#ifdef __cplusplus
//extern "C" int main(int, char**);
#endif

View file

@ -1,6 +1,7 @@
#pragma once
enum IOCtlNumber {
enum IOCtlNumber
{
TIOCGPGRP,
TIOCSPGRP,
TCGETS,
@ -12,4 +13,3 @@ enum IOCtlNumber {
TIOCNOTTY,
TIOCSWINSZ,
};

View file

@ -27,6 +27,6 @@ struct rusage {
#define RUSAGE_SELF 1
#define RUSAGE_CHILDREN 2
int getrusage(int who, struct rusage *usage);
int getrusage(int who, struct rusage* usage);
__END_DECLS

View file

@ -1,13 +1,12 @@
#pragma once
#include <fd_set.h>
#include <string.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <string.h>
#include <fd_set.h>
__BEGIN_DECLS
int select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, struct timeval* timeout);
__END_DECLS

View file

@ -1,8 +1,8 @@
#pragma once
#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <stdint.h>
#include <sys/un.h>
__BEGIN_DECLS
@ -68,4 +68,3 @@ int getsockname(int sockfd, struct sockaddr*, socklen_t*);
int getpeername(int sockfd, struct sockaddr*, socklen_t*);
__END_DECLS

View file

@ -1,18 +1,18 @@
#pragma once
#include <fcntl.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <fcntl.h>
__BEGIN_DECLS
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR)
#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK)
#define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO)
#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK)
#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK)
mode_t umask(mode_t);
int chmod(const char* pathname, mode_t);

View file

@ -15,6 +15,6 @@ struct timezone {
int tz_dsttime;
};
int gettimeofday(struct timeval* __restrict__, void* __restrict__) __attribute__((nonnull(1)));
int gettimeofday(struct timeval* __restrict__, void* __restrict__) __attribute__((nonnull(1)));
__END_DECLS

View file

@ -38,19 +38,19 @@ typedef uint32_t clock_t;
typedef __socklen_t socklen_t;
struct stat {
dev_t st_dev; /* ID of device containing file */
ino_t st_ino; /* inode number */
mode_t st_mode; /* protection */
nlink_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of owner */
gid_t st_gid; /* group ID of owner */
dev_t st_rdev; /* device ID (if special file) */
off_t st_size; /* total size, in bytes */
dev_t st_dev; /* ID of device containing file */
ino_t st_ino; /* inode number */
mode_t st_mode; /* protection */
nlink_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of owner */
gid_t st_gid; /* group ID of owner */
dev_t st_rdev; /* device ID (if special file) */
off_t st_size; /* total size, in bytes */
blksize_t st_blksize; /* blocksize for file system I/O */
blkcnt_t st_blocks; /* number of 512B blocks allocated */
time_t st_atime; /* time of last access */
time_t st_mtime; /* time of last modification */
time_t st_ctime; /* time of last status change */
blkcnt_t st_blocks; /* number of 512B blocks allocated */
time_t st_atime; /* time of last access */
time_t st_mtime; /* time of last modification */
time_t st_ctime; /* time of last status change */
};
struct utimbuf {
@ -59,4 +59,3 @@ struct utimbuf {
};
__END_DECLS

View file

@ -17,4 +17,3 @@ struct utsname {
int uname(struct utsname*);
__END_DECLS