Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
8b94e8f2
Commit
8b94e8f2
authored
Oct 12, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/PollGroupWinSelect: use `SOCKET` instead of `int`
parent
41bc17a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
PollGroupWinSelect.cxx
src/event/PollGroupWinSelect.cxx
+4
-4
PollGroupWinSelect.hxx
src/event/PollGroupWinSelect.hxx
+7
-7
No files found.
src/event/PollGroupWinSelect.cxx
View file @
8b94e8f2
...
...
@@ -45,7 +45,7 @@ PollGroupWinSelect::CanModify(PollGroupWinSelect::Item &item,
}
void
PollGroupWinSelect
::
Modify
(
PollGroupWinSelect
::
Item
&
item
,
int
fd
,
PollGroupWinSelect
::
Modify
(
PollGroupWinSelect
::
Item
&
item
,
SOCKET
fd
,
unsigned
events
,
int
event_id
)
noexcept
{
int
index
=
item
.
index
[
event_id
];
...
...
@@ -64,7 +64,7 @@ PollGroupWinSelect::Modify(PollGroupWinSelect::Item &item, int fd,
}
bool
PollGroupWinSelect
::
Add
(
int
fd
,
unsigned
events
,
void
*
obj
)
noexcept
PollGroupWinSelect
::
Add
(
SOCKET
fd
,
unsigned
events
,
void
*
obj
)
noexcept
{
assert
(
items
.
find
(
fd
)
==
items
.
end
());
auto
&
item
=
items
[
fd
];
...
...
@@ -89,7 +89,7 @@ PollGroupWinSelect::Add(int fd, unsigned events, void *obj) noexcept
}
bool
PollGroupWinSelect
::
Modify
(
int
fd
,
unsigned
events
,
void
*
obj
)
noexcept
PollGroupWinSelect
::
Modify
(
SOCKET
fd
,
unsigned
events
,
void
*
obj
)
noexcept
{
auto
item_iter
=
items
.
find
(
fd
);
assert
(
item_iter
!=
items
.
end
());
...
...
@@ -107,7 +107,7 @@ PollGroupWinSelect::Modify(int fd, unsigned events, void *obj) noexcept
}
bool
PollGroupWinSelect
::
Remove
(
int
fd
)
noexcept
PollGroupWinSelect
::
Remove
(
SOCKET
fd
)
noexcept
{
auto
item_iter
=
items
.
find
(
fd
);
assert
(
item_iter
!=
items
.
end
());
...
...
src/event/PollGroupWinSelect.hxx
View file @
8b94e8f2
...
...
@@ -67,12 +67,12 @@ public:
return
set
.
fd_count
==
FD_SETSIZE
;
}
int
operator
[](
size_t
index
)
const
noexcept
{
SOCKET
operator
[](
size_t
index
)
const
noexcept
{
assert
(
index
<
set
.
fd_count
);
return
set
.
fd_array
[
index
];
}
size_t
Add
(
int
fd
)
noexcept
{
size_t
Add
(
SOCKET
fd
)
noexcept
{
assert
(
!
IsFull
());
set
.
fd_array
[
set
.
fd_count
]
=
fd
;
return
set
.
fd_count
++
;
...
...
@@ -103,7 +103,7 @@ class PollGroupWinSelect
bool
CanModify
(
Item
&
item
,
unsigned
events
,
int
event_id
)
const
noexcept
;
void
Modify
(
Item
&
item
,
int
fd
,
unsigned
events
,
void
Modify
(
Item
&
item
,
SOCKET
fd
,
unsigned
events
,
int
event_id
)
noexcept
;
PollGroupWinSelect
(
PollGroupWinSelect
&
)
=
delete
;
...
...
@@ -118,10 +118,10 @@ public:
~
PollGroupWinSelect
()
noexcept
;
void
ReadEvents
(
PollResultGeneric
&
result
,
int
timeout_ms
)
noexcept
;
bool
Add
(
int
fd
,
unsigned
events
,
void
*
obj
)
noexcept
;
bool
Modify
(
int
fd
,
unsigned
events
,
void
*
obj
)
noexcept
;
bool
Remove
(
int
fd
)
noexcept
;
bool
Abandon
(
int
fd
)
noexcept
{
bool
Add
(
SOCKET
fd
,
unsigned
events
,
void
*
obj
)
noexcept
;
bool
Modify
(
SOCKET
fd
,
unsigned
events
,
void
*
obj
)
noexcept
;
bool
Remove
(
SOCKET
fd
)
noexcept
;
bool
Abandon
(
SOCKET
fd
)
noexcept
{
return
Remove
(
fd
);
}
};
...
...
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