Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit f319cf6

Browse files
committed
重构: 初始化成员变量, 消除警告.
1 parent e017325 commit f319cf6

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

include/mirai/defs/group.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Cyan
1515
public:
1616
GID_t GID;
1717
string Name;
18-
GroupPermission Permission;
18+
GroupPermission Permission = GroupPermission::Member;
1919
virtual bool Set(const json& j) override
2020
{
2121
GID = GID_t(j["id"].get<int64_t>());

include/mirai/defs/group_config.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ namespace Cyan
1313
public:
1414
string Name;
1515
string Announcement;
16-
bool ConfessTalk;
17-
bool AllowMemberInvite;
18-
bool AutoApprove;
19-
bool AnonymousChat;
16+
bool ConfessTalk = false;
17+
bool AllowMemberInvite = false;
18+
bool AutoApprove = false;
19+
bool AnonymousChat = false;
2020
virtual bool Set(const json& j) override
2121
{
2222
Name = j["name"].get<string>();

include/mirai/defs/group_member.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Cyan
1616
public:
1717
QQ_t QQ;
1818
string MemberName;
19-
GroupPermission Permission;
19+
GroupPermission Permission = GroupPermission::Member;
2020
Group_t Group;
2121
virtual bool Set(const json& j) override
2222
{
@@ -35,9 +35,7 @@ namespace Cyan
3535
j["group"] = Group.ToJson();
3636
return j;
3737
}
38-
3938
};
40-
4139
}
4240

4341
#endif // !mirai_cpp_defs_group_member_hpp_H_

include/mirai/defs/qq_types.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ namespace Cyan
136136
{
137137
string Id;
138138
string FileName;
139-
size_t FileSize;
139+
size_t FileSize = 0;
140140
int InternalId = 102;
141141
};
142142

0 commit comments

Comments
 (0)