1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07: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

@ -26,4 +26,3 @@ private:
HashTable<SlavePTY*> m_slave_ptys;
};

View file

@ -1,9 +1,9 @@
#pragma once
#include <Kernel/UnixTypes.h>
#include <Kernel/FileSystem/DiskBackedFileSystem.h>
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/FileSystem/ext2_fs.h>
#include <Kernel/FileSystem/DiskBackedFileSystem.h>
#include <Kernel/UnixTypes.h>
struct ext2_group_desc;
struct ext2_inode;
@ -13,6 +13,7 @@ class Ext2FS;
class Ext2FSInode final : public Inode {
friend class Ext2FS;
public:
virtual ~Ext2FSInode() override;
@ -59,8 +60,9 @@ private:
class Ext2FS final : public DiskBackedFS {
friend class Ext2FSInode;
public:
static Retained <Ext2FS> create(Retained<DiskDevice>&&);
static Retained<Ext2FS> create(Retained<DiskDevice>&&);
virtual ~Ext2FS() override;
virtual bool initialize() override;

View file

@ -1,15 +1,18 @@
#pragma once
#include <Kernel/DoubleBuffer.h>
#include <Kernel/UnixTypes.h>
#include <Kernel/File.h>
#include <Kernel/UnixTypes.h>
class FileDescriptor;
class FIFO final : public File {
public:
enum class Direction : byte {
Neither, Reader, Writer
enum class Direction : byte
{
Neither,
Reader,
Writer
};
static RetainPtr<FIFO> from_fifo_id(dword);

View file

@ -1,14 +1,14 @@
#pragma once
#include <Kernel/FileSystem/VirtualFileSystem.h>
#include <Kernel/FileSystem/InodeMetadata.h>
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/FileSystem/FIFO.h>
#include <Kernel/LinearAddress.h>
#include <AK/Badge.h>
#include <AK/ByteBuffer.h>
#include <AK/CircularQueue.h>
#include <AK/Retainable.h>
#include <AK/Badge.h>
#include <Kernel/FileSystem/FIFO.h>
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/FileSystem/InodeMetadata.h>
#include <Kernel/FileSystem/VirtualFileSystem.h>
#include <Kernel/LinearAddress.h>
#include <Kernel/Net/Socket.h>
class File;
@ -119,4 +119,3 @@ private:
SocketRole m_socket_role { SocketRole::None };
FIFO::Direction m_fifo_direction { FIFO::Direction::Neither };
};

View file

@ -1,20 +1,20 @@
#pragma once
#include <Kernel/Devices/DiskDevice.h>
#include "InodeIdentifier.h"
#include "InodeMetadata.h"
#include "UnixTypes.h"
#include <AK/AKString.h>
#include <AK/ByteBuffer.h>
#include <AK/Function.h>
#include <AK/HashMap.h>
#include <AK/OwnPtr.h>
#include <AK/Retainable.h>
#include <AK/RetainPtr.h>
#include <AK/AKString.h>
#include <AK/Function.h>
#include <AK/kstdio.h>
#include <Kernel/Lock.h>
#include <AK/Retainable.h>
#include <AK/WeakPtr.h>
#include <AK/kstdio.h>
#include <Kernel/Devices/DiskDevice.h>
#include <Kernel/KResult.h>
#include <Kernel/Lock.h>
static const dword mepoch = 476763780;
@ -25,6 +25,7 @@ class VMObject;
class FS : public Retainable<FS> {
friend class Inode;
public:
virtual ~FS();
@ -57,7 +58,7 @@ public:
virtual RetainPtr<Inode> get_inode(InodeIdentifier) const = 0;
virtual void flush_writes() { }
virtual void flush_writes() {}
protected:
FS();
@ -93,4 +94,3 @@ struct Traits<InodeIdentifier> {
};
}

View file

@ -1,12 +1,12 @@
#pragma once
#include <AK/Retainable.h>
#include <AK/AKString.h>
#include <AK/Function.h>
#include <AK/Retainable.h>
#include <AK/WeakPtr.h>
#include <Kernel/FileSystem/FileSystem.h>
#include <Kernel/FileSystem/InodeIdentifier.h>
#include <Kernel/FileSystem/InodeMetadata.h>
#include <Kernel/FileSystem/FileSystem.h>
#include <Kernel/KResult.h>
#include <Kernel/Lock.h>
@ -17,10 +17,11 @@ class VMObject;
class Inode : public Retainable<Inode> {
friend class VFS;
friend class FS;
public:
virtual ~Inode();
virtual void one_retain_left() { }
virtual void one_retain_left() {}
FS& fs() { return m_fs; }
const FS& fs() const { return m_fs; }
@ -89,4 +90,3 @@ private:
RetainPtr<LocalSocket> m_socket;
bool m_metadata_dirty { false };
};

View file

@ -8,7 +8,7 @@ struct InodeMetadata;
class InodeIdentifier {
public:
InodeIdentifier() { }
InodeIdentifier() {}
InodeIdentifier(dword fsid, dword inode)
: m_fsid(fsid)
, m_index(inode)
@ -39,4 +39,3 @@ private:
dword m_fsid { 0 };
dword m_index { 0 };
};

View file

@ -84,5 +84,3 @@ struct InodeMetadata {
unsigned major_device { 0 };
unsigned minor_device { 0 };
};

View file

@ -1,9 +1,9 @@
#pragma once
#include <Kernel/Lock.h>
#include <AK/Types.h>
#include <Kernel/FileSystem/FileSystem.h>
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/Lock.h>
class Process;
@ -11,6 +11,7 @@ class ProcFSInode;
class ProcFS final : public FS {
friend class ProcFSInode;
public:
[[gnu::pure]] static ProcFS& the();
@ -34,7 +35,7 @@ private:
ProcFS();
struct ProcFSDirectoryEntry {
ProcFSDirectoryEntry() { }
ProcFSDirectoryEntry() {}
ProcFSDirectoryEntry(const char* a_name, unsigned a_proc_file_type, Function<ByteBuffer(InodeIdentifier)>&& a_read_callback = nullptr, Function<ssize_t(InodeIdentifier, const ByteBuffer&)>&& a_write_callback = nullptr, RetainPtr<ProcFSInode>&& a_inode = nullptr)
: name(a_name)
, proc_file_type(a_proc_file_type)
@ -69,6 +70,7 @@ struct ProcFSInodeCustomData {
class ProcFSInode final : public Inode {
friend class ProcFS;
public:
virtual ~ProcFSInode() override;

View file

@ -1,9 +1,9 @@
#pragma once
#include <AK/HashMap.h>
#include <Kernel/FileSystem/FileSystem.h>
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/UnixTypes.h>
#include <AK/HashMap.h>
class SynthFSInode;
@ -47,6 +47,7 @@ struct SynthFSInodeCustomData {
class SynthFSInode final : public Inode {
friend class SynthFS;
friend class DevPtsFS;
public:
virtual ~SynthFSInode() override;

View file

@ -1,14 +1,14 @@
#pragma once
#include "FileSystem.h"
#include "InodeIdentifier.h"
#include "InodeMetadata.h"
#include <AK/AKString.h>
#include <AK/Function.h>
#include <AK/HashMap.h>
#include <AK/OwnPtr.h>
#include <AK/RetainPtr.h>
#include <AK/AKString.h>
#include <AK/Vector.h>
#include <AK/Function.h>
#include "InodeIdentifier.h"
#include "InodeMetadata.h"
#include "FileSystem.h"
#include <Kernel/KResult.h>
#define O_RDONLY 0
@ -116,4 +116,3 @@ private:
Vector<OwnPtr<Mount>> m_mounts;
HashMap<dword, Device*> m_devices;
};

File diff suppressed because it is too large Load diff

View file

@ -3,140 +3,141 @@
* everything we need. (cross fingers) Other header files may have
* also defined the types that we need.
*/
#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
!defined(_EXT2_TYPES_H))
#define _EXT2_TYPES_H
#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && !defined(_EXT2_TYPES_H))
# define _EXT2_TYPES_H
#define __S8_TYPEDEF __signed__ char
#define __U8_TYPEDEF unsigned char
#define __S16_TYPEDEF __signed__ short
#define __U16_TYPEDEF unsigned short
#define __S32_TYPEDEF __signed__ int
#define __U32_TYPEDEF unsigned int
#define __S64_TYPEDEF __signed__ long long
#define __U64_TYPEDEF unsigned long long
# define __S8_TYPEDEF __signed__ char
# define __U8_TYPEDEF unsigned char
# define __S16_TYPEDEF __signed__ short
# define __U16_TYPEDEF unsigned short
# define __S32_TYPEDEF __signed__ int
# define __U32_TYPEDEF unsigned int
# define __S64_TYPEDEF __signed__ long long
# define __U64_TYPEDEF unsigned long long
#ifdef __U8_TYPEDEF
# ifdef __U8_TYPEDEF
typedef __U8_TYPEDEF __u8;
#else
# else
typedef unsigned char __u8;
#endif
# endif
#ifdef __S8_TYPEDEF
# ifdef __S8_TYPEDEF
typedef __S8_TYPEDEF __s8;
#else
# else
typedef signed char __s8;
#endif
# endif
#ifdef __U16_TYPEDEF
# ifdef __U16_TYPEDEF
typedef __U16_TYPEDEF __u16;
#else
#if (4 == 2)
typedef unsigned int __u16;
#else
#if (2 == 2)
typedef unsigned short __u16;
#else
?==error: undefined 16 bit type
#endif /* SIZEOF_SHORT == 2 */
#endif /* SIZEOF_INT == 2 */
#endif /* __U16_TYPEDEF */
# else
# if (4 == 2)
typedef unsigned int __u16;
# else
# if (2 == 2)
typedef unsigned short __u16;
# else
? == error : undefined 16 bit type
# endif /* SIZEOF_SHORT == 2 */
# endif /* SIZEOF_INT == 2 */
# endif /* __U16_TYPEDEF */
#ifdef __S16_TYPEDEF
# ifdef __S16_TYPEDEF
typedef __S16_TYPEDEF __s16;
#else
#if (4 == 2)
typedef int __s16;
#else
#if (2 == 2)
typedef short __s16;
#else
?==error: undefined 16 bit type
#endif /* SIZEOF_SHORT == 2 */
#endif /* SIZEOF_INT == 2 */
#endif /* __S16_TYPEDEF */
# else
# if (4 == 2)
typedef int __s16;
# else
# if (2 == 2)
typedef short __s16;
# else
? == error
: undefined 16 bit type
# endif /* SIZEOF_SHORT == 2 */
# endif /* SIZEOF_INT == 2 */
# endif /* __S16_TYPEDEF */
#ifdef __U32_TYPEDEF
# ifdef __U32_TYPEDEF
typedef __U32_TYPEDEF __u32;
#else
#if (4 == 4)
typedef unsigned int __u32;
#else
#if (4 == 4)
typedef unsigned long __u32;
#else
#if (2 == 4)
typedef unsigned short __u32;
#else
?== error: undefined 32 bit type
#endif /* SIZEOF_SHORT == 4 */
#endif /* SIZEOF_LONG == 4 */
#endif /* SIZEOF_INT == 4 */
#endif /* __U32_TYPEDEF */
# else
# if (4 == 4)
typedef unsigned int __u32;
# else
# if (4 == 4)
typedef unsigned long __u32;
# else
# if (2 == 4)
typedef unsigned short __u32;
# else
? == error
: undefined 32 bit type
# endif /* SIZEOF_SHORT == 4 */
# endif /* SIZEOF_LONG == 4 */
# endif /* SIZEOF_INT == 4 */
# endif /* __U32_TYPEDEF */
#ifdef __S32_TYPEDEF
# ifdef __S32_TYPEDEF
typedef __S32_TYPEDEF __s32;
#else
#if (4 == 4)
typedef int __s32;
#else
#if (4 == 4)
typedef long __s32;
#else
#if (2 == 4)
typedef short __s32;
#else
?== error: undefined 32 bit type
#endif /* SIZEOF_SHORT == 4 */
#endif /* SIZEOF_LONG == 4 */
#endif /* SIZEOF_INT == 4 */
#endif /* __S32_TYPEDEF */
# else
# if (4 == 4)
typedef int __s32;
# else
# if (4 == 4)
typedef long __s32;
# else
# if (2 == 4)
typedef short __s32;
# else
? == error
: undefined 32 bit type
# endif /* SIZEOF_SHORT == 4 */
# endif /* SIZEOF_LONG == 4 */
# endif /* SIZEOF_INT == 4 */
# endif /* __S32_TYPEDEF */
#ifdef __U64_TYPEDEF
# ifdef __U64_TYPEDEF
typedef __U64_TYPEDEF __u64;
#else
#if (4 == 8)
typedef unsigned int __u64;
#else
#if (4 == 8)
typedef unsigned long __u64;
#else
#if (8 == 8)
typedef unsigned long long __u64;
#endif /* SIZEOF_LONG_LONG == 8 */
#endif /* SIZEOF_LONG == 8 */
#endif /* SIZEOF_INT == 8 */
#endif /* __U64_TYPEDEF */
# else
# if (4 == 8)
typedef unsigned int __u64;
# else
# if (4 == 8)
typedef unsigned long __u64;
# else
# if (8 == 8)
typedef unsigned long long __u64;
# endif /* SIZEOF_LONG_LONG == 8 */
# endif /* SIZEOF_LONG == 8 */
# endif /* SIZEOF_INT == 8 */
# endif /* __U64_TYPEDEF */
#ifdef __S64_TYPEDEF
# ifdef __S64_TYPEDEF
typedef __S64_TYPEDEF __s64;
#else
#if (4 == 8)
typedef int __s64;
#else
#if (4 == 8)
typedef long __s64;
#else
#if (8 == 8)
#if defined(__GNUC__)
typedef __signed__ long long __s64;
#else
typedef signed long long __s64;
#endif /* __GNUC__ */
#endif /* SIZEOF_LONG_LONG == 8 */
#endif /* SIZEOF_LONG == 8 */
#endif /* SIZEOF_INT == 8 */
#endif /* __S64_TYPEDEF */
# else
# if (4 == 8)
typedef int __s64;
# else
# if (4 == 8)
typedef long __s64;
# else
# if (8 == 8)
# if defined(__GNUC__)
typedef __signed__ long long __s64;
# else
typedef signed long long __s64;
# endif /* __GNUC__ */
# endif /* SIZEOF_LONG_LONG == 8 */
# endif /* SIZEOF_LONG == 8 */
# endif /* SIZEOF_INT == 8 */
# endif /* __S64_TYPEDEF */
#undef __S8_TYPEDEF
#undef __U8_TYPEDEF
#undef __S16_TYPEDEF
#undef __U16_TYPEDEF
#undef __S32_TYPEDEF
#undef __U32_TYPEDEF
#undef __S64_TYPEDEF
#undef __U64_TYPEDEF
# undef __S8_TYPEDEF
# undef __U8_TYPEDEF
# undef __S16_TYPEDEF
# undef __U16_TYPEDEF
# undef __S32_TYPEDEF
# undef __U32_TYPEDEF
# undef __S64_TYPEDEF
# undef __U64_TYPEDEF
#endif /* _*_TYPES_H */