clang-format

This commit is contained in:
Gluzskiy Alexandr 2020-07-27 10:34:40 +03:00
parent 3bb5d57b70
commit 481f3b32f6
No known key found for this signature in database
GPG Key ID: 081C9B2CC6377450

View File

@ -645,8 +645,7 @@ typedef struct _hotplug_dev
BOOL to_add; BOOL to_add;
} hotplug_dev; } hotplug_dev;
static void static void handle_mountpoint(hotplug_dev* dev_array, size_t* size, const char* mountpoint)
handle_mountpoint(hotplug_dev *dev_array, size_t *size, const char *mountpoint)
{ {
if (!mountpoint) if (!mountpoint)
return; return;
@ -661,8 +660,7 @@ handle_mountpoint(hotplug_dev *dev_array, size_t *size, const char *mountpoint)
#ifdef __sun #ifdef __sun
#include <sys/mnttab.h> #include <sys/mnttab.h>
static UINT static UINT handle_platform_mounts_sun(hotplug_dev* dev_array, size_t* size)
handle_platform_mounts_sun(hotplug_dev *dev_array, size_t *size)
{ {
FILE* f; FILE* f;
struct mnttab ent; struct mnttab ent;
@ -683,12 +681,11 @@ handle_platform_mounts_sun(hotplug_dev *dev_array, size_t *size)
#if defined(__FreeBSD__) || defined(__OpenBSD__) #if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/mount.h> #include <sys/mount.h>
static UINT static UINT handle_platform_mounts_bsd(hotplug_dev* dev_array, size_t* size)
handle_platform_mounts_bsd(hotplug_dev *dev_array, size_t *size)
{ {
int mntsize; int mntsize;
size_t idx; size_t idx;
struct statfs *mntbuf = NULL; struct statfs* mntbuf = NULL;
mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
if (!mntsize) if (!mntsize)
@ -697,7 +694,7 @@ handle_platform_mounts_bsd(hotplug_dev *dev_array, size_t *size)
WLog_ERR(TAG, "getmntinfo failed!"); WLog_ERR(TAG, "getmntinfo failed!");
return ERROR_OPEN_FAILED; return ERROR_OPEN_FAILED;
} }
for (idx = 0; idx < (size_t)mntsize; idx ++) for (idx = 0; idx < (size_t)mntsize; idx++)
{ {
handle_mountpoint(dev_array, size, mntbuf[idx].f_mntonname); handle_mountpoint(dev_array, size, mntbuf[idx].f_mntonname);
} }
@ -706,10 +703,9 @@ handle_platform_mounts_bsd(hotplug_dev *dev_array, size_t *size)
} }
#endif #endif
#if defined(__LINUX__) || defined (__linux__) #if defined(__LINUX__) || defined(__linux__)
#include <mntent.h> #include <mntent.h>
static UINT static UINT handle_platform_mounts_linux(hotplug_dev* dev_array, size_t* size)
handle_platform_mounts_linux(hotplug_dev *dev_array, size_t *size)
{ {
FILE* f; FILE* f;
struct mntent* ent; struct mntent* ent;
@ -728,14 +724,13 @@ handle_platform_mounts_linux(hotplug_dev *dev_array, size_t *size)
} }
#endif #endif
static UINT static UINT handle_platform_mounts(hotplug_dev* dev_array, size_t* size)
handle_platform_mounts(hotplug_dev *dev_array, size_t *size)
{ {
#ifdef __sun #ifdef __sun
return handle_platform_mounts_sun(dev_array, size); return handle_platform_mounts_sun(dev_array, size);
#elif defined(__FreeBSD__) || defined(__OpenBSD__) #elif defined(__FreeBSD__) || defined(__OpenBSD__)
return handle_platform_mounts_bsd(dev_array, size); return handle_platform_mounts_bsd(dev_array, size);
#elif defined(__LINUX__) || defined (__linux__) #elif defined(__LINUX__) || defined(__linux__)
return handle_platform_mounts_linux(dev_array, size); return handle_platform_mounts_linux(dev_array, size);
#endif #endif
return ERROR_CALL_NOT_IMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED;