Apply clang-format code style to all source files
This commit is contained in:
+1
-3
@@ -14,9 +14,7 @@ uint8_t p3io_req_cmd(const union p3io_req_any *src)
|
||||
}
|
||||
|
||||
void p3io_resp_init(
|
||||
struct p3io_hdr *dest,
|
||||
size_t nbytes,
|
||||
const struct p3io_hdr *req)
|
||||
struct p3io_hdr *dest, size_t nbytes, const struct p3io_hdr *req)
|
||||
{
|
||||
log_assert(dest != NULL);
|
||||
log_assert(req != NULL);
|
||||
|
||||
+19
-21
@@ -6,30 +6,30 @@
|
||||
#include "p3io/frame.h"
|
||||
|
||||
enum {
|
||||
P3IO_CMD_GET_VERSION = 0x01,
|
||||
P3IO_CMD_SET_WATCHDOG = 0x05,
|
||||
P3IO_CMD_POWEROFF = 0x22,
|
||||
P3IO_CMD_SET_OUTPUTS = 0x24,
|
||||
P3IO_CMD_READ_PLUG = 0x25,
|
||||
P3IO_CMD_GET_CAB_TYPE_OR_DIPSW = 0x27,
|
||||
P3IO_CMD_GET_VIDEO_FREQ = 0x29,
|
||||
P3IO_CMD_SET_MODE = 0x2F,
|
||||
P3IO_CMD_GET_COINSTOCK = 0x31,
|
||||
P3IO_CMD_SET_COINCOUNTER = 0x32,
|
||||
P3IO_CMD_RS232_OPEN_CLOSE = 0x38,
|
||||
P3IO_CMD_RS232_WRITE = 0x3A,
|
||||
P3IO_CMD_RS232_READ = 0x3B,
|
||||
P3IO_CMD_GET_VERSION = 0x01,
|
||||
P3IO_CMD_SET_WATCHDOG = 0x05,
|
||||
P3IO_CMD_POWEROFF = 0x22,
|
||||
P3IO_CMD_SET_OUTPUTS = 0x24,
|
||||
P3IO_CMD_READ_PLUG = 0x25,
|
||||
P3IO_CMD_GET_CAB_TYPE_OR_DIPSW = 0x27,
|
||||
P3IO_CMD_GET_VIDEO_FREQ = 0x29,
|
||||
P3IO_CMD_SET_MODE = 0x2F,
|
||||
P3IO_CMD_GET_COINSTOCK = 0x31,
|
||||
P3IO_CMD_SET_COINCOUNTER = 0x32,
|
||||
P3IO_CMD_RS232_OPEN_CLOSE = 0x38,
|
||||
P3IO_CMD_RS232_WRITE = 0x3A,
|
||||
P3IO_CMD_RS232_READ = 0x3B,
|
||||
};
|
||||
|
||||
enum {
|
||||
P3IO_RS232_CMD_OPEN = 0x00,
|
||||
P3IO_RS232_CMD_CLOSE = 0xFF,
|
||||
P3IO_RS232_CMD_OPEN = 0x00,
|
||||
P3IO_RS232_CMD_CLOSE = 0xFF,
|
||||
};
|
||||
|
||||
enum {
|
||||
P3IO_RS232_BAUD_19200 = 0x02,
|
||||
P3IO_RS232_BAUD_38400 = 0x03,
|
||||
P3IO_RS232_BAUD_57600 = 0x04,
|
||||
P3IO_RS232_BAUD_19200 = 0x02,
|
||||
P3IO_RS232_BAUD_38400 = 0x03,
|
||||
P3IO_RS232_BAUD_57600 = 0x04,
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
@@ -170,8 +170,6 @@ union p3io_resp_any {
|
||||
uint8_t p3io_req_cmd(const union p3io_req_any *src);
|
||||
|
||||
void p3io_resp_init(
|
||||
struct p3io_hdr *dest,
|
||||
size_t nbytes,
|
||||
const struct p3io_hdr *req);
|
||||
struct p3io_hdr *dest, size_t nbytes, const struct p3io_hdr *req);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
#include "util/iobuf.h"
|
||||
#include "util/log.h"
|
||||
|
||||
HRESULT p3io_frame_encode(
|
||||
struct iobuf *dest,
|
||||
const void *ptr,
|
||||
size_t nbytes)
|
||||
HRESULT
|
||||
p3io_frame_encode(struct iobuf *dest, const void *ptr, size_t nbytes)
|
||||
{
|
||||
const uint8_t *bytes;
|
||||
uint8_t b;
|
||||
@@ -28,7 +26,7 @@ HRESULT p3io_frame_encode(
|
||||
|
||||
dest->bytes[dest->pos++] = 0xAA;
|
||||
|
||||
for (i = 0 ; i < nbytes ; i++) {
|
||||
for (i = 0; i < nbytes; i++) {
|
||||
b = bytes[i];
|
||||
|
||||
if (b == 0xAA || b == 0xFF) {
|
||||
@@ -57,9 +55,8 @@ trunc:
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT p3io_frame_decode(
|
||||
struct iobuf *dest,
|
||||
struct const_iobuf *src)
|
||||
HRESULT
|
||||
p3io_frame_decode(struct iobuf *dest, struct const_iobuf *src)
|
||||
{
|
||||
bool escape;
|
||||
uint8_t b;
|
||||
|
||||
@@ -7,13 +7,8 @@
|
||||
|
||||
#include "util/iobuf.h"
|
||||
|
||||
HRESULT p3io_frame_encode(
|
||||
struct iobuf *dest,
|
||||
const void *bytes,
|
||||
size_t nbytes);
|
||||
HRESULT p3io_frame_encode(struct iobuf *dest, const void *bytes, size_t nbytes);
|
||||
|
||||
HRESULT p3io_frame_decode(
|
||||
struct iobuf *dest,
|
||||
struct const_iobuf *src);
|
||||
HRESULT p3io_frame_decode(struct iobuf *dest, struct const_iobuf *src);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <windows.h>
|
||||
#include <initguid.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "p3io/guid.h"
|
||||
|
||||
+12
-5
@@ -4,10 +4,17 @@
|
||||
#include <windows.h>
|
||||
|
||||
DEFINE_GUID(
|
||||
p3io_guid,
|
||||
0x1FA4A480,
|
||||
0xAC60,
|
||||
0x40C7,
|
||||
0xA7, 0xAC, 0x52, 0x79, 0x0F, 0x34, 0x57, 0x5A);
|
||||
p3io_guid,
|
||||
0x1FA4A480,
|
||||
0xAC60,
|
||||
0x40C7,
|
||||
0xA7,
|
||||
0xAC,
|
||||
0x52,
|
||||
0x79,
|
||||
0x0F,
|
||||
0x34,
|
||||
0x57,
|
||||
0x5A);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define P3IO_IOCTL_H
|
||||
|
||||
enum {
|
||||
P3IO_IOCTL_READ_JAMMA = 0x00222068,
|
||||
P3IO_IOCTL_READ_JAMMA = 0x00222068,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user