Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
ygopro
Commits
270ac63c
Commit
270ac63c
authored
May 31, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace unsigned short to uint16_t
parent
a0ed32c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
gframe/network.h
gframe/network.h
+14
-14
No files found.
gframe/network.h
View file @
270ac63c
...
...
@@ -30,26 +30,26 @@ struct HostInfo {
unsigned
int
start_lp
{};
unsigned
char
start_hand
{};
unsigned
char
draw_count
{};
u
nsigned
shor
t
time_limit
{};
u
int16_
t
time_limit
{};
};
check_trivially_copyable
(
HostInfo
);
static_assert
(
sizeof
(
HostInfo
)
==
20
,
"size mismatch: HostInfo"
);
struct
HostPacket
{
u
nsigned
shor
t
identifier
;
u
nsigned
shor
t
version
;
u
nsigned
shor
t
port
;
u
int16_
t
identifier
;
u
int16_
t
version
;
u
int16_
t
port
;
// byte padding[2]
unsigned
int
ipaddr
;
u
nsigned
shor
t
name
[
20
];
u
int16_
t
name
[
20
];
HostInfo
host
;
};
check_trivially_copyable
(
HostPacket
);
static_assert
(
sizeof
(
HostPacket
)
==
72
,
"size mismatch: HostPacket"
);
struct
HostRequest
{
u
nsigned
shor
t
identifier
;
u
int16_
t
identifier
;
};
check_trivially_copyable
(
HostRequest
);
static_assert
(
sizeof
(
HostRequest
)
==
2
,
"size mismatch: HostRequest"
);
...
...
@@ -67,25 +67,25 @@ check_trivially_copyable(CTOS_TPResult);
static_assert
(
sizeof
(
CTOS_TPResult
)
==
1
,
"size mismatch: CTOS_TPResult"
);
struct
CTOS_PlayerInfo
{
u
nsigned
shor
t
name
[
20
];
u
int16_
t
name
[
20
];
};
check_trivially_copyable
(
CTOS_PlayerInfo
);
static_assert
(
sizeof
(
CTOS_PlayerInfo
)
==
40
,
"size mismatch: CTOS_PlayerInfo"
);
struct
CTOS_CreateGame
{
HostInfo
info
;
u
nsigned
shor
t
name
[
20
];
u
nsigned
shor
t
pass
[
20
];
u
int16_
t
name
[
20
];
u
int16_
t
pass
[
20
];
};
check_trivially_copyable
(
CTOS_CreateGame
);
static_assert
(
sizeof
(
CTOS_CreateGame
)
==
100
,
"size mismatch: CTOS_CreateGame"
);
struct
CTOS_JoinGame
{
u
nsigned
shor
t
version
;
u
int16_
t
version
;
// byte padding[2]
unsigned
int
gameid
;
u
nsigned
shor
t
pass
[
20
];
u
int16_
t
pass
[
20
];
};
check_trivially_copyable
(
CTOS_JoinGame
);
static_assert
(
sizeof
(
CTOS_JoinGame
)
==
48
,
"size mismatch: CTOS_JoinGame"
);
...
...
@@ -141,7 +141,7 @@ struct STOC_TimeLimit {
unsigned
char
player
;
// byte padding[1]
u
nsigned
shor
t
left_time
;
u
int16_
t
left_time
;
};
check_trivially_copyable
(
STOC_TimeLimit
);
static_assert
(
sizeof
(
STOC_TimeLimit
)
==
4
,
"size mismatch: STOC_TimeLimit"
);
...
...
@@ -156,7 +156,7 @@ constexpr int LEN_CHAT_MSG = 256;
constexpr
int
SIZE_STOC_CHAT
=
(
LEN_CHAT_PLAYER
+
LEN_CHAT_MSG
)
*
sizeof
(
uint16_t
);
struct
STOC_HS_PlayerEnter
{
u
nsigned
shor
t
name
[
20
];
u
int16_
t
name
[
20
];
unsigned
char
pos
;
// byte padding[1]
};
...
...
@@ -171,7 +171,7 @@ check_trivially_copyable(STOC_HS_PlayerChange);
static_assert
(
sizeof
(
STOC_HS_PlayerChange
)
==
1
,
"size mismatch: STOC_HS_PlayerChange"
);
struct
STOC_HS_WatchChange
{
u
nsigned
shor
t
watch_count
;
u
int16_
t
watch_count
;
};
check_trivially_copyable
(
STOC_HS_WatchChange
);
static_assert
(
sizeof
(
STOC_HS_WatchChange
)
==
2
,
"size mismatch: STOC_HS_WatchChange"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment