Apply clang-format code style to all source files

This commit is contained in:
icex2
2019-10-20 00:50:40 +02:00
parent c600e1a423
commit c3bc8782f4
401 changed files with 13844 additions and 11361 deletions
+30 -19
View File
@@ -8,11 +8,22 @@
#include <windows.h>
#define HID_FLAG_NULLABLE 0x01
#define HID_FLAG_RELATIVE 0x02
#define HID_FLAG_NULLABLE 0x01
#define HID_FLAG_RELATIVE 0x02
DEFINE_GUID(hid_guid, 0x4D1E55B2L, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, \
0x11, 0x11, 0x00, 0x00, 0x30);
DEFINE_GUID(
hid_guid,
0x4D1E55B2L,
0xF16F,
0x11CF,
0x88,
0xCB,
0x00,
0x11,
0x11,
0x00,
0x00,
0x30);
/* Alright, I'd take the vtable stuff from C++, because this is just gross.
But you can keep everything else from that trainwreck of a language. */
@@ -44,10 +55,10 @@ struct hid_vtbl {
void (*close)(struct hid *hid);
bool (*get_device_usage)(const struct hid *hid, uint32_t *usage);
bool (*get_name)(const struct hid *hid, wchar_t *chars, size_t *nchars);
bool (*get_controls)(const struct hid *hid, struct hid_control *controls,
size_t *ncontrols);
bool (*get_lights)(const struct hid *hid, struct hid_light *lights,
size_t *nlights);
bool (*get_controls)(
const struct hid *hid, struct hid_control *controls, size_t *ncontrols);
bool (*get_lights)(
const struct hid *hid, struct hid_light *lights, size_t *nlights);
bool (*get_value)(struct hid *hid, size_t control_no, int32_t *out_value);
bool (*set_light)(struct hid *hid, size_t light_no, uint32_t intensity);
};
@@ -56,8 +67,7 @@ struct hid {
const struct hid_vtbl *vptr;
};
#define hid_close(hid) \
(hid)->vptr->close(hid)
#define hid_close(hid) (hid)->vptr->close(hid)
#define hid_get_device_usage(hid, usage) \
(hid)->vptr->get_device_usage(hid, usage)
@@ -89,20 +99,21 @@ struct hid_ri {
};
wchar_t *hid_ri_init_name(const GUID *class_guid, const char *dev_node);
bool hid_ri_get_name(wchar_t *chars, size_t *nchars,
const wchar_t *src_chars);
bool hid_ri_get_controls(struct hid_control *controls, size_t *ncontrols,
const struct hid_control *src_controls, size_t src_ncontrols);
bool hid_ri_get_name(wchar_t *chars, size_t *nchars, const wchar_t *src_chars);
bool hid_ri_get_controls(
struct hid_control *controls,
size_t *ncontrols,
const struct hid_control *src_controls,
size_t src_ncontrols);
#define hid_ri_handle_event(hid_ri, ri) \
(hid_ri)->vptr->handle_event(hid_ri, ri)
#define hid_ri_handle_event(hid_ri, ri) (hid_ri)->vptr->handle_event(hid_ri, ri)
struct hid_fd;
struct hid_fd_vtbl {
struct hid_vtbl super;
bool (*handle_completion)(struct hid_fd *hid, OVERLAPPED *ovl,
size_t nbytes);
bool (*handle_completion)(
struct hid_fd *hid, OVERLAPPED *ovl, size_t nbytes);
};
struct hid_fd {
@@ -110,6 +121,6 @@ struct hid_fd {
};
#define hid_fd_handle_completion(hid_fd, ovl, nbytes) \
(hid_fd)->vptr->handle_completion(hid_fd, ovl, nbytes)
(hid_fd)->vptr->handle_completion(hid_fd, ovl, nbytes)
#endif